Ichimoku Dax M15 automatic trading strategy
Forums › ProRealTime English forum › ProOrder support › Ichimoku Dax M15 automatic trading strategy
- This topic has 17 replies, 6 voices, and was last updated 4 years ago by
nonetheless.
-
-
10/26/2020 at 10:34 AM #148452
Hello,
I present you a strategy based on ichimoku and some optimizations.
Ichimoku is optimized to give the best components while keeping the same ratios of difference between the components of the ichimoku.
The values are therefore simply multiplied.
Purchases and sales are processed independently, which makes the backtest more profitable.
Also a currency management system is incorporated into the strategy and can be modified as required.
I wouldn’t have 100% confidence in this strategy given that it has just been developed and we know the effects of optimization.
However, I find it an interesting basis, which could be applied in other markets.
Maybe some ideas could be added to this one to make it more profitable!
Feel free to give your opinions and suggestions.
IV
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224////=/===============/=//=/===============/=//=/ Basic settings////=/ Cumulation of OrdersDefParam CumulateOrders = False////=/===============/=//=/===============/=//=/ Management Settings////=/ CapitalCapital = 10000//=/ Percentage RiskRisk = 1//=/ ReinvestmentReinvestment = 0////=/===============/=//=/===============/=//=/ Calcul Management Settings////=/ Reinvestment Settingsif Reinvestment = 1 thenCapital = Capital + StrategyProfitelsif Reinvestment = 0 thenCapital = Capitalendif//=/ Lotss SettingsLotss = ((Capital*Risk) /100) /RiskVolatilityif Lotss < 0.5 thenLotss = 0.5endifif Lotss > (0.0015*Capital) thenLotss = 0.0015*Capitalendif//=/ Risk by Volatility SettingsVL1 = Average[500,0](TypicalPrice)VH1 = VL1 + (1*Average[500,1](Range))VD1 = VL1 - (1*Average[500,1](Range))VL2 = Average[1000,0](TypicalPrice)VH2 = VL2 + (1*Average[1000,1](Range))VD2 = VL2 - (1*Average[1000,1](Range))VH = (VH1+VH2) /2VD = (VD1+VD2) /2RiskVolatility = VH-VD////=/===============/=//=/===============/=//=/ Activation Settings////=/ Buy ActivationBuyActivation = 1//=/ Sell ActivationSellActivation = 1////=/===============/=//=/===============/=//=/ Time Settings////=/ TimeTableBefore = Time >= 080000After = Time < 220000TTime = Before and After//=/ No Tradeif OpenDayOfWeek = 5 and Time > 200000 thenNoTrade = 1elseNoTrade = 0endif////=/===============/=//=/===============/=//=/ Indicator Settings////=/ Ichimoku BuyICBuy = 1.13BSpanA = (BTenkan[26*ICBuy]+BKijun[26*ICBuy])/2BTenkan = (highest[9*ICBuy](high)+lowest[9*ICBuy](low))/2BKijun = (highest[26*ICBuy](high)+lowest[26*ICBuy](low))/2BSpanB = (highest[52*ICBuy](high[26*ICBuy])+lowest[52*ICBuy](low[26*ICBuy]))/2//=/ Ichimoku SellICSell = 0.86SSpanA = (STenkan[26*ICSell]+SKijun[26*ICSell])/2STenkan = (highest[9*ICSell](high)+lowest[9*ICSell](low))/2SKijun = (highest[26*ICSell](high)+lowest[26*ICSell](low))/2SSpanB = (highest[52*ICSell](high[26*ICSell])+lowest[52*ICSell](low[26*ICSell]))/2////=/===============/=//=/===============/=//=/ Buy Settings////=/ Conditions BuyCB1 = momentum[9] > 0CB2 = momentum[44] > 0CB3 = momentum[187] > 0CB4 = close > BSpanA and close > BSpanBCB5 = BKijun > BSpanA and BKijun > BSpanBCB6 = close > BTenkan and close > BKijunCB7 = BTenkan > BSpanA and BTenkan > BSpanBCB8 = close > BSpanA[26*ICBuy] and close > BSpanB[26*ICBuy]CB9 = close > BTenkan[26*ICBuy] and close > BKijun[26*ICBuy]ConditionsBuy = CB1 and CB2 and CB3 and CB4 and CB5 and CB6 and CB7 and CB8 and CB9//=/ Conditions SellCXB1 = close < openCXB2 = close < BSpanA and close < BSpanBCXB3 = BKijun < BSpanA and BKijun < BSpanBCXB4 = close < BTenkan and close < BKijunCXB5 = BTenkan < BSpanA and BTenkan < BSpanBCXB6 = close < BSpanA[26*ICBuy] and close < BSpanB[26*ICBuy]CXB7 = close < BTenkan[26*ICBuy] and close < BKijun[26*ICBuy]ConditionsSell = CXB1 and CXB2 and CXB3 and CXB4 and CXB5 and CXB6 and CXB7//=/ Confirmation Time Buyif ConditionsBuy thenCB = 1elsif ConditionsSell thenCB = -1elseCB = 0endifCTB1 = CB[1] = 1CTB2 = CB[2] = 1CTB3 = CB[3] = 1CTB4 = CB[4] = 1CTB5 = CB[5] = 1CTB6 = CB[6] = 1CTB7 = (close-open) > (high-close)CTB = CTB1 and CTB2 and CTB3 and CTB4 and CTB5 and CTB6 and CTB7if CTB thenConfirmationTimeBuy = 1elseConfirmationTimeBuy = 0endif//=/ Buyif NoTrade = 0 and BuyActivation = 1 and TTime and ConditionsBuy and ConfirmationTimeBuy = 1 thenBuy Lotss Contract at MarketSet Stop %Loss 2.27endif//=/ Sellif NoTrade = 1 or close < BKijun and close > PositionPrice or ConditionsSell thenSell at Marketendif////=/===============/=//=/===============/=//=/ Sell Settings////=/ Conditions Sell ShortCS1 = close < openCS2 = momentum[18] < 0CS3 = momentum[167] < 0CS4 = momentum[224] < 0CS5 = close < SSpanA and close < SSpanBCS6 = SKijun < SSpanA and SKijun < SSpanBCS7 = close < STenkan and close < SKijunCS8 = STenkan < SSpanA and STenkan < SSpanBCS9 = close < SSpanA[26*ICSell] and close < SSpanB[26*ICSell]CS10 = close < STenkan[26*ICSell] and close < SKijun[26*ICSell]ConditionsSellShort = CS1 and CS2 and CS3 and CS4 and CS5 and CS6 and CS7 and CS8 and CS9 and CS10CXS1 = close > openCXS2 = close > SSpanA and close > SSpanBCXS3 = SKijun > SSpanA and SKijun > SSpanBCXS4 = close > STenkan and close > SKijunCXS5 = STenkan > SSpanA and STenkan > SSpanBCXS6 = close > SSpanA[26*ICSell] and close > SSpanB[26*ICSell]CXS7 = close > STenkan[26*ICSell] and close > SKijun[26*ICSell]ConditionsExitShort = CXS1 and CXS2 and CXS3 and CXS4 and CXS5 and CXS6 and CXS7//=/ Confirmation Time Sellif ConditionsSellShort thenCS = 1elsif ConditionsExitShort thenCS = -1elseCS = 0endifCTS1 = CS[1] = 1CTS2 = CS[2] = 1CTS3 = (open-close) > (close-low)CTS = CTS1 and CTS2 and CTS3if CTS thenConfirmationTimeSell = 1elseConfirmationTimeSell = 0endif//=/ Sell Shortif NoTrade = 0 and SellActivation = 1 and TTime and ConditionsSellShort and ConfirmationTimeSell = 1 thenSellShort Lotss Contract at MarketSet Stop %Loss 1.09endif//=/ Exit Shortif NoTrade = 1 or close > SKijun and close < PositionPrice or ConditionsExitShort thenExitShort at Marketendif////=/===============/=//=/===============/=//=/ End//////=/===============/=//=/ IV mcm//3 users thanked author for this post.
10/26/2020 at 6:28 PM #148558thanks for that, looks interesting – can you post the results with all money management turned off to get a better idea of the level performance?
10/27/2020 at 10:06 AM #14863710/27/2020 at 11:16 AM #148642Hello Nicolas
No indeed, the OOS tests were not performed for the simple reason that I don’t know how to do it, could you tell me how to proceed?
Thank you
10/27/2020 at 11:26 AM #148644Hello nonetheless
The strategy is developed with system management, so for a fixed batch system, you should probably review the parameters to get more conclusive results.
Sincerely yours,
10/27/2020 at 1:49 PM #148654Use the walk forward tool in the platform in order to test your optimization over an out of sample period (OOS period). You should always divide your backtest history when optimizing, into 2 parts, the first one to optimize the value (In-Sample period = IS) and the second one to test those variables values into “real” market conditions, the OOS period. There are so many topics discussing strategy robustness over the forums, you should dig into them 🙂
1 user thanked author for this post.
02/18/2021 at 11:31 AM #161907Hello IV Mcm,
did you test your strategu with Walkforward ?
02/19/2021 at 2:34 PM #161993Here’s a version of this with no MM, optimized 70/30
Not too bad (apart from 2 awful months) … but unfortunately I’m getting the dreaded Negative/Zero Parameter error in demo.
Most grateful to anyone with any thoughts on this.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165DefParam CumulateOrders = False////=/===============/=//=/===============/=//=/ Activation Settings//BuyActivation = 1SellActivation = 1////=/===============/=//=/===============/=//=/ Time Settings//Before = Time >= 080000After = Time < 213000TTime = Before and After////=/===============/=//=/===============/=//=/ Indicator Settings//=/ Ichimoku BuyICBuy = 1.15BSpanA = (BTenkan[26*ICBuy]+BKijun[26*ICBuy])/2BTenkan = (highest[9*ICBuy](high)+lowest[9*ICBuy](low))/2BKijun = (highest[26*ICBuy](high)+lowest[26*ICBuy](low))/2BSpanB = (highest[52*ICBuy](high[26*ICBuy])+lowest[52*ICBuy](low[26*ICBuy]))/2//=/ Ichimoku SellICSell = 0.9SSpanA = (STenkan[26*ICSell]+SKijun[26*ICSell])/2STenkan = (highest[9*ICSell](high)+lowest[9*ICSell](low))/2SKijun = (highest[26*ICSell](high)+lowest[26*ICSell](low))/2SSpanB = (highest[52*ICSell](high[26*ICSell])+lowest[52*ICSell](low[26*ICSell]))/2MA = average[36,5](typicalprice)MAS = average[53,4](typicalprice)//=/===============/=//=/===============/=//=/ Buy Settings////=/ Conditions BuyCB1 = momentum[9] > 0CB2 = momentum[45] > 0CB3 = momentum[160] > 0CB4 = close > BSpanA and close > BSpanBCB5 = BKijun > BSpanA and BKijun > BSpanBCB6 = close > BTenkan and close > BKijunCB7 = BTenkan > BSpanA and BTenkan > BSpanBCB8 = close > BSpanA[26*ICBuy] and close > BSpanB[26*ICBuy]CB9 = close > BTenkan[26*ICBuy] and close > BKijun[26*ICBuy]CB10 = ma > ma[1]ConditionsBuy = CB1 and CB2 and CB3 and CB4 and CB5 and CB6 and CB7 and CB8 and CB9 and CB10//=/ Conditions SellCXB1 = close < openCXB2 = close < BSpanA and close < BSpanBCXB3 = BKijun < BSpanA and BKijun < BSpanBCXB4 = close < BTenkan and close < BKijunCXB5 = BTenkan < BSpanA and BTenkan < BSpanBCXB6 = close < BSpanA[26*ICBuy] and close < BSpanB[26*ICBuy]CXB7 = close < BTenkan[26*ICBuy] and close < BKijun[26*ICBuy]ConditionsSell = CXB1 and CXB2 and CXB3 and CXB4 and CXB5 and CXB6 and CXB7//=/ Confirmation Time Buyif ConditionsBuy thenCB = 1elsif ConditionsSell thenCB = -1elseCB = 0endifCTB1 = CB[1] = 1CTB2 = CB[2] = 1CTB3 = CB[3] = 1CTB4 = CB[4] = 1CTB5 = CB[5] = 1CTB6 = CB[6] = 1CTB7 = (close-open) > (high-close)CTB = CTB1 and CTB2 and CTB3 and CTB4 and CTB5 and CTB6 and CTB7if CTB thenConfirmationTimeBuy = 1elseConfirmationTimeBuy = 0endif//=/ Buyif BuyActivation = 1 and TTime and ConditionsBuy and ConfirmationTimeBuy = 1 thenBuy 1 Contract at MarketSet Stop %Loss 1.4SET TARGET %PROFIT 1.5endif//=/ Sellif close < BKijun and close > PositionPrice or ConditionsSell thenSell at Marketendif////=/===============/=//=/===============/=//=/ Sell Settings////=/ Conditions Sell ShortCS1 = close < openCS2 = momentum[22] < 0CS3 = momentum[170] < 0CS4 = momentum[230] < 0CS5 = close < SSpanA and close < SSpanBCS6 = SKijun < SSpanA and SKijun < SSpanBCS7 = close < STenkan and close < SKijunCS8 = STenkan < SSpanA and STenkan < SSpanBCS9 = close < SSpanA[26*ICSell] and close < SSpanB[26*ICSell]CS10 = close < STenkan[26*ICSell] and close < SKijun[26*ICSell]CS11 = mas < mas[1]ConditionsSellShort = CS1 and CS2 and CS3 and CS4 and CS5 and CS6 and CS7 and CS8 and CS9 and CS10 and CS11CXS1 = close > openCXS2 = close > SSpanA and close > SSpanBCXS3 = SKijun > SSpanA and SKijun > SSpanBCXS4 = close > STenkan and close > SKijunCXS5 = STenkan > SSpanA and STenkan > SSpanBCXS6 = close > SSpanA[26*ICSell] and close > SSpanB[26*ICSell]CXS7 = close > STenkan[26*ICSell] and close > SKijun[26*ICSell]ConditionsExitShort = CXS1 and CXS2 and CXS3 and CXS4 and CXS5 and CXS6 and CXS7//=/ Confirmation Time Sellif ConditionsSellShort thenCS = 1elsif ConditionsExitShort thenCS = -1elseCS = 0endifCTS1 = CS[1] = 1CTS2 = CS[2] = 1CTS3 = (open-close) > (close-low)CTS = CTS1 and CTS2 and CTS3if CTS thenConfirmationTimeSell = 1elseConfirmationTimeSell = 0endif//=/ Sell Shortif SellActivation = 1 and TTime and ConditionsSellShort and ConfirmationTimeSell = 1 thenSellShort 1 Contract at MarketSet Stop %Loss 1.1SET TARGET %PROFIT 1.6endif//=/ Exit Shortif close > SKijun and close < PositionPrice or ConditionsExitShort thenExitShort at Marketendif//MFE exitONCE MFEx = 0if mfex thenMFE = summation[barindex-tradeindex](positionperf > 0)IF longonmarket and barindex-tradeindex > 9 and (MFE = 0) thensell at marketendifendif4 users thanked author for this post.
02/28/2021 at 1:25 PM #162768No Walkforward :/
02/28/2021 at 2:01 PM #162772Not sure what you mean. The optimization is 70/30, so almost 3 years OOS.
But the Negative/Zero Parameter is the bigger problem as it won’t run as it is.
03/25/2021 at 11:30 AM #165293You will notice that the version without MM loses a lot in gain.
The MM allows you to adapt to the volatility to avoid ruining yourself during a crack or gaining nothing during low volatility.
03/25/2021 at 12:20 PM #165297I am all in favour of MM, but for backtest and optimization it’s better to run with level stakes so you know what you’re dealing with. Also easier to compare performance with other algos. MM is added after.
Here’s another version, lower profit but more trades and better %win. Also fixes the zero parameter problem.
2nd image is with my MM code.
5 users thanked author for this post.
03/26/2021 at 11:45 AM #165399Nice algo. I changed some variables. Backtested it since 13.03.2019
03/26/2021 at 7:11 PM #16544403/27/2021 at 9:58 AM #165474Hi, would you like to post your set of variables / algo including it ?
If yr post was adressed to me, pls find attached the itf file.
4 users thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on