Swing Hi-Lo DAX weekly mtf

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #80213 quote
    robertogozzi
    Moderator
    Master

    This a simple (basic) strategy to exploit any swing HIGH & LOW occurring in the weekly TF.

    This strategy may stay ONMARKET even more than 1 year!  Owing (or due ?) to high TP & SL there’s no advantage in backtesting it in tick-by-tick mode.

    I suggest using the 2 or 4-hour TF as default to launch the strategy.

    Experimenting is left to anyone to improve it.

    TIMEFRAME (weekly, updateonclose)
    //                      Swing High - Low
    ONCE LookBack = 50                              //50   bars to make sure SWINGs have enough empty space to their left
    ONCE MaxBars  = 2                               //2    bars to keep holding SWING valid
    ONCE MaxHigh  = 0
    ONCE MinLow   = 0
    //    Swing HIGH
    Hi =        high[1] = highest[LookBack](high)
    Hi = Hi AND low[1]  = highest[3](low)
    Hi = Hi AND close < open
    //    Swing LOW
    Lo =        high[1] = lowest[3](high)
    Lo = Lo AND low[1]  = lowest[LookBack](low)
    Lo = Lo AND close >= open
    //
    IF Hi OR Lo THEN
       MaxHigh = highest[3](high)
       MinLow  = lowest[3](low)
    ENDIF
    x = summation[MaxBars](Hi)
    y = summation[MaxBars](Lo)
    ////////////////////////////////////////////////////////////////////////
    TIMEFRAME (default)                             //2 or 4-hour TF suggested
    ONCE nLots              = 1
    ONCE Multiplier         = 4.0                   //4.0
    DaysForbidden           = OpenDayOfWeek < 1 OR OpenDayOfWeek > 5
    TimeForbidden           = OpenTime < 090000 OR OpenTime > 190000
    //                           LONG  trades
    a = y AND close < MaxHigh AND close > MinLow
    IF a AND Not OnMarket AND Not DaysForbidden AND Not TimeForbidden THEN
       SL = (close - MinLow) / pipsize
       TP = SL * Multiplier
       BUY nLots CONTRACT AT MARKET
    ENDIF
    //                           SHORT trades
    b = x AND close > MinLow AND close < MaxHigh
    IF b AND Not Onmarket AND Not DaysForbidden AND Not TimeForbidden THEN
       SL = (MaxHigh - close) / pipsize
       TP = SL * Multiplier
       SELLSHORT nLots CONTRACT AT MARKET
    ENDIF
    SET TARGET pPROFIT TP
    SET STOP   pLOSS   SL
    Nicolas and Berra thanked this post
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Swing Hi-Lo DAX weekly mtf


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 1 voice and has 0 replies.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/12/2018
Status: Active
Attachments: 2 files
Logo Logo
Loading...