Ichimoku Dax M15 automatic trading strategy

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #148452 quote
    Ichimoku Reading
    Participant
    Master

    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

    //
    //=/===============/=//=/===============/=//=/ Basic settings
    //
    
    //=/ Cumulation of Orders
    DefParam CumulateOrders = False
    
    //
    //=/===============/=//=/===============/=//=/ Management Settings
    //
    
    //=/ Capital
    Capital = 10000
    
    //=/ Percentage Risk
    Risk = 1
    
    //=/ Reinvestment
    Reinvestment = 0
    
    //
    //=/===============/=//=/===============/=//=/ Calcul Management Settings
    //
    
    //=/ Reinvestment Settings
    if Reinvestment = 1 then
    Capital = Capital + StrategyProfit
    
    elsif Reinvestment = 0 then
    Capital = Capital
    endif
    
    //=/ Lotss Settings
    Lotss = ((Capital*Risk) /100) /RiskVolatility
    
    if Lotss < 0.5 then
    Lotss = 0.5
    endif
    
    if Lotss > (0.0015*Capital) then
    Lotss = 0.0015*Capital
    endif
    
    //=/ Risk by Volatility Settings
    VL1 = 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) /2
    VD = (VD1+VD2) /2
    RiskVolatility = VH-VD
    
    //
    //=/===============/=//=/===============/=//=/ Activation Settings
    //
    
    //=/ Buy Activation
    BuyActivation = 1
    
    //=/ Sell Activation
    SellActivation = 1
    
    //
    //=/===============/=//=/===============/=//=/ Time Settings
    //
    
    //=/ TimeTable
    Before = Time >= 080000
    After = Time < 220000
    TTime = Before and After
    
    //=/ No Trade
    if OpenDayOfWeek = 5 and Time > 200000 then
    NoTrade = 1
    else
    NoTrade = 0
    endif
    
    //
    //=/===============/=//=/===============/=//=/ Indicator Settings
    //
    
    //=/ Ichimoku Buy
    ICBuy = 1.13
    BSpanA = (BTenkan[26*ICBuy]+BKijun[26*ICBuy])/2
    BTenkan = (highest[9*ICBuy](high)+lowest[9*ICBuy](low))/2
    BKijun = (highest[26*ICBuy](high)+lowest[26*ICBuy](low))/2
    BSpanB = (highest[52*ICBuy](high[26*ICBuy])+lowest[52*ICBuy](low[26*ICBuy]))/2
    
    //=/ Ichimoku Sell
    ICSell = 0.86
    SSpanA = (STenkan[26*ICSell]+SKijun[26*ICSell])/2
    STenkan = (highest[9*ICSell](high)+lowest[9*ICSell](low))/2
    SKijun = (highest[26*ICSell](high)+lowest[26*ICSell](low))/2
    SSpanB = (highest[52*ICSell](high[26*ICSell])+lowest[52*ICSell](low[26*ICSell]))/2
    
    //
    //=/===============/=//=/===============/=//=/ Buy Settings
    //
    
    //=/ Conditions Buy
    CB1 = momentum[9] > 0
    CB2 = momentum[44] > 0
    CB3 = momentum[187] > 0
    CB4 = close > BSpanA and close > BSpanB
    CB5 = BKijun > BSpanA and BKijun > BSpanB
    CB6 = close > BTenkan and close > BKijun
    CB7 = BTenkan > BSpanA and BTenkan > BSpanB
    CB8 = 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 Sell
    CXB1 = close < open
    CXB2 = close < BSpanA and close < BSpanB
    CXB3 = BKijun < BSpanA and BKijun < BSpanB
    CXB4 = close < BTenkan and close < BKijun
    CXB5 = BTenkan < BSpanA and BTenkan < BSpanB
    CXB6 = 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 Buy
    if ConditionsBuy then
    CB = 1
    elsif ConditionsSell then
    CB = -1
    else
    CB = 0
    endif
    
    CTB1 = CB[1] = 1
    CTB2 = CB[2] = 1
    CTB3 = CB[3] = 1
    CTB4 = CB[4] = 1
    CTB5 = CB[5] = 1
    CTB6 = CB[6] = 1
    CTB7 = (close-open) > (high-close)
    CTB = CTB1 and CTB2 and CTB3 and CTB4 and CTB5 and CTB6 and CTB7
    
    if CTB  then
    ConfirmationTimeBuy = 1
    else
    ConfirmationTimeBuy = 0
    endif
    
    
    //=/ Buy
    if NoTrade = 0 and BuyActivation = 1 and TTime and ConditionsBuy and ConfirmationTimeBuy = 1 then
    Buy Lotss Contract at Market
    Set Stop %Loss 2.27
    endif
    
    //=/ Sell
    if NoTrade = 1 or close < BKijun and close > PositionPrice or ConditionsSell then
    Sell at Market
    endif
    
    //
    //=/===============/=//=/===============/=//=/ Sell Settings
    //
    
    //=/ Conditions Sell Short
    CS1 = close < open
    CS2 = momentum[18] < 0
    CS3 = momentum[167] < 0
    CS4 = momentum[224] < 0
    CS5 = close < SSpanA and close < SSpanB
    CS6 = SKijun < SSpanA and SKijun < SSpanB
    CS7 = close < STenkan and close < SKijun
    CS8 = STenkan < SSpanA and STenkan < SSpanB
    CS9 = 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 CS10
    
    CXS1 = close > open
    CXS2 = close > SSpanA and close > SSpanB
    CXS3 = SKijun > SSpanA and SKijun > SSpanB
    CXS4 = close > STenkan and close > SKijun
    CXS5 = STenkan > SSpanA and STenkan > SSpanB
    CXS6 = 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 Sell
    if ConditionsSellShort then
    CS = 1
    elsif ConditionsExitShort then
    CS = -1
    else
    CS = 0
    endif
    
    CTS1 = CS[1] = 1
    CTS2 = CS[2] = 1
    CTS3 = (open-close) > (close-low)
    CTS = CTS1 and CTS2 and CTS3
    
    if CTS  then
    ConfirmationTimeSell = 1
    else
    ConfirmationTimeSell = 0
    endif
    
    //=/ Sell Short
    if NoTrade = 0 and SellActivation = 1 and TTime and ConditionsSellShort and ConfirmationTimeSell = 1 then
    SellShort Lotss Contract at Market
    Set Stop %Loss 1.09
    endif
    
    //=/ Exit Short
    if NoTrade = 1 or close > SKijun and close < PositionPrice or ConditionsExitShort then
    ExitShort at Market
    endif
    
    //
    //=/===============/=//=/===============/=//=/ End
    //
    
    //
    //=/===============/=//=/ IV mcm
    //

     

     

    GraHal, Midlanddave and josef1604 thanked this post
    capture-16036684274cl8p.png capture-16036684274cl8p.png Ichimoku-Dax-M15.itf capture-16036684274cl8p1.png capture-16036684274cl8p1.png
    #148558 quote
    nonetheless
    Participant
    Master

    thanks for that, looks interesting – can you post the results with all money management turned off to get a better idea of the level performance?

    #148637 quote
    Nicolas
    Keymaster
    Master

    Thanks a lot for this new idea, I moved your post into the forum to discuss about, because it would attract a lot of questions in the library because of its optimization settings. Did you made some OOS testing?

    #148642 quote
    Ichimoku Reading
    Participant
    Master

    Hello 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

    #148644 quote
    Ichimoku Reading
    Participant
    Master

    Hello 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,

    #148654 quote
    Nicolas
    Keymaster
    Master

    Use 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 🙂

    Ichimoku Reading thanked this post
    #161907 quote
    LaurentBZH35
    Participant
    Average

    Hello IV Mcm,

     

    did you test your strategu with Walkforward ?

    #161993 quote
    nonetheless
    Participant
    Master

    Here’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.

    DefParam CumulateOrders = False
    //
    //=/===============/=//=/===============/=//=/ Activation Settings
    //
    
    BuyActivation = 1
    SellActivation = 1
     
    //
    //=/===============/=//=/===============/=//=/ Time Settings
    //
    
    Before = Time >= 080000
    After = Time < 213000
    TTime = Before and After
    
    //
    //=/===============/=//=/===============/=//=/ Indicator Settings
    //=/ Ichimoku Buy
    ICBuy = 1.15
    BSpanA = (BTenkan[26*ICBuy]+BKijun[26*ICBuy])/2
    BTenkan = (highest[9*ICBuy](high)+lowest[9*ICBuy](low))/2
    BKijun = (highest[26*ICBuy](high)+lowest[26*ICBuy](low))/2
    BSpanB = (highest[52*ICBuy](high[26*ICBuy])+lowest[52*ICBuy](low[26*ICBuy]))/2
     
    //=/ Ichimoku Sell
    ICSell = 0.9
    SSpanA = (STenkan[26*ICSell]+SKijun[26*ICSell])/2
    STenkan = (highest[9*ICSell](high)+lowest[9*ICSell](low))/2
    SKijun = (highest[26*ICSell](high)+lowest[26*ICSell](low))/2
    SSpanB = (highest[52*ICSell](high[26*ICSell])+lowest[52*ICSell](low[26*ICSell]))/2
    
    MA = average[36,5](typicalprice)
    MAS = average[53,4](typicalprice)
    
    //=/===============/=//=/===============/=//=/ Buy Settings
    //
     
    //=/ Conditions Buy
    CB1 = momentum[9] > 0
    CB2 = momentum[45] > 0
    CB3 = momentum[160] > 0
    CB4 = close > BSpanA and close > BSpanB
    CB5 = BKijun > BSpanA and BKijun > BSpanB
    CB6 = close > BTenkan and close > BKijun
    CB7 = BTenkan > BSpanA and BTenkan > BSpanB
    CB8 = 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 Sell
    CXB1 = close < open
    CXB2 = close < BSpanA and close < BSpanB
    CXB3 = BKijun < BSpanA and BKijun < BSpanB
    CXB4 = close < BTenkan and close < BKijun
    CXB5 = BTenkan < BSpanA and BTenkan < BSpanB
    CXB6 = 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 Buy
    if ConditionsBuy then
    CB = 1
    elsif ConditionsSell then
    CB = -1
    else
    CB = 0
    endif
     
    CTB1 = CB[1] = 1
    CTB2 = CB[2] = 1
    CTB3 = CB[3] = 1
    CTB4 = CB[4] = 1
    CTB5 = CB[5] = 1
    CTB6 = CB[6] = 1
    CTB7 = (close-open) > (high-close)
    CTB = CTB1 and CTB2 and CTB3 and CTB4 and CTB5 and CTB6 and CTB7
     
    if CTB  then
    ConfirmationTimeBuy = 1
    else
    ConfirmationTimeBuy = 0
    endif
     
     
    //=/ Buy
    if   BuyActivation = 1 and TTime and ConditionsBuy and ConfirmationTimeBuy = 1 then
    Buy 1 Contract at Market
    Set Stop %Loss 1.4
    SET TARGET %PROFIT 1.5
    endif
     
    //=/ Sell
    if  close < BKijun and close > PositionPrice or ConditionsSell then
    Sell at Market
    endif
     
    //
    //=/===============/=//=/===============/=//=/ Sell Settings
    //
     
    //=/ Conditions Sell Short
    CS1 = close < open
    CS2 = momentum[22] < 0
    CS3 = momentum[170] < 0
    CS4 = momentum[230] < 0
    CS5 = close < SSpanA and close < SSpanB
    CS6 = SKijun < SSpanA and SKijun < SSpanB
    CS7 = close < STenkan and close < SKijun
    CS8 = STenkan < SSpanA and STenkan < SSpanB
    CS9 = 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 CS11
     
    CXS1 = close > open
    CXS2 = close > SSpanA and close > SSpanB
    CXS3 = SKijun > SSpanA and SKijun > SSpanB
    CXS4 = close > STenkan and close > SKijun
    CXS5 = STenkan > SSpanA and STenkan > SSpanB
    CXS6 = 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 Sell
    if ConditionsSellShort then
    CS = 1
    elsif ConditionsExitShort then
    CS = -1
    else
    CS = 0
    endif
     
    CTS1 = CS[1] = 1
    CTS2 = CS[2] = 1
    CTS3 = (open-close) > (close-low)
    CTS = CTS1 and CTS2 and CTS3
     
    if CTS  then
    ConfirmationTimeSell = 1
    else
    ConfirmationTimeSell = 0
    endif
     
    //=/ Sell Short
    if  SellActivation = 1 and TTime and ConditionsSellShort and ConfirmationTimeSell = 1 then
    SellShort 1 Contract at Market
    Set Stop %Loss 1.1
    SET TARGET %PROFIT 1.6
    endif
     
    //=/ Exit Short
    if  close > SKijun and close < PositionPrice or ConditionsExitShort then
    ExitShort at Market
    endif
    
    //MFE exit
    ONCE MFEx = 0
    if mfex then
    MFE = summation[barindex-tradeindex](positionperf > 0)
    IF longonmarket and barindex-tradeindex > 9 and (MFE = 0) then
    sell at market
    endif
    endif
    
    DAX-15m-Ichimoku-v2.jpg DAX-15m-Ichimoku-v2.jpg DAX-15m-Ichimoku-v2.itf
    #162768 quote
    Ichimoku Reading
    Participant
    Master

    No Walkforward :/

    #162772 quote
    nonetheless
    Participant
    Master

    Not 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.

    #165293 quote
    Ichimoku Reading
    Participant
    Master

    You 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.

    #165297 quote
    nonetheless
    Participant
    Master

    I 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.

    DAX-15m-Ichimoku-v3.jpg DAX-15m-Ichimoku-v3.jpg DAX-15m-Ichimoku-v3-MM.jpg DAX-15m-Ichimoku-v3-MM.jpg DAX-15m-Ichimoku-v3.itf
    #165399 quote
    VinzentVega
    Participant
    Veteran

    Nice algo. I changed some variables. Backtested it since 13.03.2019

    Unbenannt.png Unbenannt.png
    #165444 quote
    Arno G
    Participant
    Average

    Hi, would you like to post your set of variables / algo including it ?

    #165474 quote
    VinzentVega
    Participant
    Veteran

    Hi, 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.

    Midlanddave, GraHal, Arno G and HannesA thanked this post
    DAX-Ichimoku-15m-Test1.itf
Viewing 15 posts - 1 through 15 (of 18 total)
  • You must be logged in to reply to this topic.

Ichimoku Dax M15 automatic trading strategy


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 17 replies,
has 6 voices, and was last updated by nonetheless
4 years, 10 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 10/26/2020
Status: Active
Attachments: 9 files
Logo Logo
Loading...