Market: Dow Jones
Timeframe: 1H
Direction: Long only
This strategy combines a breakout above a 600-period moving average with a trend filter based on the Ichimoku cloud.
The strategy aims to capture large bullish moves while filtering out weaker breakouts using the Ichimoku cloud.
A long position is opened when:
The ATR(14) is recorded at the time of entry and is used to calculate two profit targets:
The ATR value is fixed at the time of entry and does not change during the trade.
The remaining position is closed if price closes:
There is no fixed stop-loss in this version.
The strategy does not take overnight financing costs into account. This is particularly important when trading CFDs. The backtest was performed using an average spread of 4 points.
———————————————————————————————————————————————————————————
Marché : Dow Jones
Unité de temps : 1H
Direction : Achat uniquement
Cette stratégie combine une cassure de moyenne mobile 600 périodes avec un filtre de tendance basé sur le nuage Ichimoku.
La stratégie cherche à capter de grandes phases haussières tout en filtrant les cassures faibles grâce au nuage Ichimoku.
Une position acheteuse est ouverte lorsque :
L’ATR(14) est enregistré au moment de l’entrée et sert à calculer deux objectifs :
La valeur de l’ATR est figée au moment de l’entrée et ne change pas pendant le trade.
La position restante est fermée si le prix clôture :
Il n’y a pas de stop-loss fixe dans cette version.
La stratégie ne tient pas comptes des frais overnight. Attention si vous êtes en Cfd notamment. Backtest réalisé avec un spread moyen de 4.
//Dow Kumo Breakout
//DOW JONES
//TF 1H
defparam cumulateorders = false
defparam preloadbars = 100000
maperiod = 600
atrperiod = 14
tp1atr = 8
tp2atr = 20
positionsize = 2
tp1size = 1
tp2size = 1
trendma = average[maperiod](close)
myatr = averagetruerange[atrperiod](close)
tenkan = (highest[9](high) + lowest[9](low)) / 2
kijun = (highest[26](high) + lowest[26](low)) / 2
spana = (tenkan[26] + kijun[26]) / 2
spanb = (highest[52](high[26]) + lowest[52](low[26])) / 2
kumotop = max(spana,spanb)
kumobottom = min(spana,spanb)
once entryatr = 0
once initialpositionsize = 0
once tp1done = 0
breakma = close crosses over trendma
abovekumo = close > kumotop
longsignal = breakma and abovekumo
if not onmarket then
entryatr = 0
initialpositionsize = 0
tp1done = 0
if longsignal then
entryatr = myatr
initialpositionsize = positionsize
buy positionsize contracts at market
endif
endif
if longonmarket then
if tp1done = 0 and countofposition < initialpositionsize then
tp1done = 1
endif
tp1price = positionprice + (tp1atr * entryatr)
tp2price = positionprice + (tp2atr * entryatr)
breakmaexit = close < trendma
breakkumoexit = close < kumobottom
structurebreak = breakmaexit and breakkumoexit
if structurebreak then
sell at market
else
if tp1done = 0 then
sell tp1size contracts at tp1price limit
sell tp2size contracts at tp2price limit
else
sell at tp2price limit
endif
endif
endif
You must be logged in to post a comment.
Hello ! I haven't tried it on other instruments, but I have tested it across several timeframes. Originally, I was looking for a day trading strategy, but it wasn't working very well. So I tried it on a higher timeframe and was surprised by the results, without making any changes to the original code. I decided to share it because I can't use it myself, as my broker charges me too much in fees. Be careful if you use it: overnight fees can significantly reduce the strategy's performance depending on your broker. These fees are not included in the backtest.
Thanks for the details. That's not good news ! I’m going to test this strategy myself on shorter timeframes and other instruments. I’ll let you know my results if they turn out well on those shorter timeframes. I’ve never used Ichimoku in my strategies before, so this will be a first for me ! For reference, here is some code I found online for calculating overnight fees within a strategy: // Exemple pour un calcul à 22:00 (heure du fixing) IF LongOnMarket AND (Time = 220000) THEN // Formule indicative : (Nombre de contrats * Valeur * Cours * Taux annuel) / 365 OvernightCost = (CountOfLongShares * PositionPrice * (BrokerFeeRate / 100) / 365) // Vous pouvez cumuler ces coûts dans une variable globale de frais TotalOvernightFees = TotalOvernightFees + OvernightCost ENDIF // You can then set this as a chart variable and deduct it manually.
I have my own, more comprehensive code for calculating overnight financing costs. I get 15,063 in overnight fees over the entire backtest period. The code below is designed for Wall Street Cash, but by changing a few parameters, it can be adapted to any asset: // --------------------------------------------------------------------- // PARAMETRES // --------------------------------------------------------------------- // SOFR actuel // Dernier SOFR disponible au 25/09/2026 : 3.87 % SOFR = 0.0387 // Frais administratifs IG // 3 % pour mini-contrat. // Si ton contrat IG est facturé à 2.5 %, remplacer par 0.025. FraisIG = 0.030 // Base de calcul USD BaseAnnuelle = 360 // --------------------------------------------------------------------- // INITIALISATION // --------------------------------------------------------------------- ONCE FraisOvernightCumules = 0 ONCE DernierFraisOvernight = 0 ONCE NombreNuitsFinancees = 0 // --------------------------------------------------------------------- // DETECTION DU PASSAGE DE 23H00 // // TIME correspond à l'heure de clôture de la bougie. // Cette méthode fonctionne aussi si ton UT n'a pas exactement // une bougie clôturant à 23:00, à condition qu'une barre traverse 23h. // --------------------------------------------------------------------- Passage23h = TIME >= 230000 AND TIME[1] crédit de financement. // --------------------------------------------------------------- IF SHORTONMARKET THEN TauxFinancement = FraisIG - SOFR DernierFraisOvernight = NominalPosition * TauxFinancement / BaseAnnuelle * NbJoursFinancement ENDIF // --------------------------------------------------------------- // CUMUL // --------------------------------------------------------------- FraisOvernightCumules = FraisOvernightCumules + DernierFraisOvernight NombreNuitsFinancees = NombreNuitsFinancees + NbJoursFinancement ENDIF // --------------------------------------------------------------------- // RESULTAT NET THEORIQUE DE LA STRATEGIE // // Frais positifs = débit // Frais négatifs = crédit // --------------------------------------------------------------------- ProfitNetApresOvernight = StrategyProfit - FraisOvernightCumules // ===================================================================== // AFFICHAGE // ===================================================================== GRAPH FraisOvernightCumules AS "Frais overnight cumules"
The code you posted above for calculating costs should return 0, not 15,063. For it to work, you would need "LONGONMARKET" instead of "SHORTONMARKET" because you use LONG TRADE into your strategy. Furthermore, "passage23h" isn't actually used to satisfy the condition; the variable "nbjoursFinancement" isn't initialized; and the variables "NombreNuitsFinancees" and "baseAnnuelle" don't seem to serve any purpose in the code. Could you also explain what "FraisIG" refers to? With IG, transaction fees are usually included in the spread. The only cost I know during a trade is the overnight cost.
This is the first time I’ve calculated overnight fees for a strategy, and I wasn't aware that administrative fees also applied. Here is the code calculating overnight fees for one contract. For the Dow at €1 per point, overnight fees since 2011 amount to €7,840, or €15,680 for two contracts. Of course, this is just a cost estimate, as rates change daily. Please note that the code below also includes weekends. //Dow Kumo Breakout //DOW JONES //TF 1H defparam cumulateorders = false defparam preloadbars = 100000 nbsize = 1 ContractValue = nbsize * pointvalue IGadm = 3 BrokerFeeRate = 3.73 maperiod = 600 atrperiod = 14 tp1atr = 8 tp2atr = 20 positionsize = nbsize tp1size = nbsize/2 tp2size = nbsize/2 trendma = average[maperiod](close) myatr = averagetruerange[atrperiod](close) tenkan = (highest[9](high) + lowest[9](low)) / 2 kijun = (highest[26](high) + lowest[26](low)) / 2 spana = (tenkan[26] + kijun[26]) / 2 spanb = (highest[52](high[26]) + lowest[52](low[26])) / 2 kumotop = max(spana,spanb) kumobottom = min(spana,spanb) once entryatr = 0 once initialpositionsize = 0 once tp1done = 0 breakma = close crosses over trendma abovekumo = close > kumotop longsignal = breakma and abovekumo if not onmarket then entryatr = 0 initialpositionsize = 0 tp1done = 0 if longsignal then entryatr = myatr initialpositionsize = positionsize buy positionsize contracts at market endif endif if longonmarket then if tp1done = 0 and countofposition < initialpositionsize then tp1done = 1 endif tp1price = positionprice + (tp1atr * entryatr) tp2price = positionprice + (tp2atr * entryatr) breakmaexit = close < trendma breakkumoexit = close < kumobottom structurebreak = breakmaexit and breakkumoexit if structurebreak then sell at market else if tp1done = 0 then sell tp1size contracts at tp1price limit sell tp2size contracts at tp2price limit else sell at tp2price limit endif endif endif IF LongOnMarket AND dayday[1] THEN // Formule indicative : (Nombre de contrats * Valeur * Cours * Taux annuel) / 365 OvernightCost = (nbsize * contractvalue * PositionPrice * ((IGAdm + BrokerFeeRate) / 100) / 360) // Vous pouvez cumuler ces coûts dans une variable globale de frais TotalOvernightFees = TotalOvernightFees + OvernightCost ENDIF graph TotalOvernightFees
Here is the code with the correct calculation for the weekends. It changes the total overnight costs a lot. //Dow Kumo Breakout //DOW JONES //TF 1H defparam cumulateorders = false defparam preloadbars = 100000 nbsize = 1 ContractValue = nbsize * pointvalue IGadm = 3 BrokerFeeRate = 3.73 maperiod = 600 atrperiod = 14 tp1atr = 8 tp2atr = 20 positionsize = nbsize tp1size = nbsize/2 tp2size = nbsize/2 trendma = average[maperiod](close) myatr = averagetruerange[atrperiod](close) tenkan = (highest[9](high) + lowest[9](low)) / 2 kijun = (highest[26](high) + lowest[26](low)) / 2 spana = (tenkan[26] + kijun[26]) / 2 spanb = (highest[52](high[26]) + lowest[52](low[26])) / 2 kumotop = max(spana,spanb) kumobottom = min(spana,spanb) once entryatr = 0 once initialpositionsize = 0 once tp1done = 0 breakma = close crosses over trendma abovekumo = close > kumotop longsignal = breakma and abovekumo if not onmarket then entryatr = 0 initialpositionsize = 0 tp1done = 0 if longsignal then entryatr = myatr initialpositionsize = positionsize buy positionsize contracts at market endif endif if longonmarket then if tp1done = 0 and countofposition < initialpositionsize then tp1done = 1 endif tp1price = positionprice + (tp1atr * entryatr) tp2price = positionprice + (tp2atr * entryatr) breakmaexit = close < trendma breakkumoexit = close < kumobottom structurebreak = breakmaexit and breakkumoexit if structurebreak then sell at market else if tp1done = 0 then sell tp1size contracts at tp1price limit sell tp2size contracts at tp2price limit else sell at tp2price limit endif endif endif IF LongOnMarket AND dayday[1] THEN // Formule indicative : (Nombre de contrats * Valeur * Cours * Taux annuel) / 365 if dayofweek=1 then OvernightCost = ((nbsize * contractvalue * PositionPrice * ((IGAdm + BrokerFeeRate) / 100) / 360))*3 else OvernightCost = (nbsize * contractvalue * PositionPrice * ((IGAdm + BrokerFeeRate) / 100) / 360) endif // Vous pouvez cumuler ces coûts dans une variable globale de frais TotalOvernightFees = TotalOvernightFees + OvernightCost ENDIF graph TotalOvernightFees
nice!
I get an error message when trying to launch the automated system. Pls can you advise.
see image below: