Trend following strategy, multi market, 30min to 4h

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #104431 quote
    jeremyben
    Participant
    Average

    Hello,

     

    I developed this strategy that follows the trend (buy and sell). It’s based on 3 conditions only related with the exponential moving average.

    It works better without target and stop loss.

    It keeps positions open for a minimum of 24h.

     

    You can backtest this strategy with different timeframe, but you’ll have to adapt R :
    – R=200 for TF=30min
    – R=100 for TF=1h
    – R=50 for TF=2h
    – R=25 for TF=4h

     

    It gives good results with all the major indices and forex (TF=2H) :
    – DAX, GL=3.07 (90 trades)
    – FTSE, GL=2.20 (81 trades)
    – CAC, GL=2.07 (86 trades)
    – US500, GL=2.41 (69 trades)
    – DOW, GL=1.83 (69 trades)
    – US100, GL=1.65 (72 trades)
    – ASX, GL=1.54 (96 trades)
    – EURUSD, GL=1.95 (91 trades)
    – GBPUSD, GL=1.43 (82 trades)
    – USDJPY, GL=1.27 (75 trades)

     

    These results are with the exact same code for each market with a timeframe=2H

    You can easily get a better GL for each market by changing few settings, but the initial idea was to use the same code for all markets.

     

    These backtests are with no spreads, and no fees, how much fees we can expect for 1 contrat on one of this market for a duration of 1 week open?

     

    What are your ideas to improve this strategy?

     

    Jérémy

    DEFPARAM cumulateorders = false
    
    positionSize = 1
    SL = 0 // stop loss in %, set to 0 to not use TP
    TP = 0 // target in %, set to 0 to not use SL
    minimumBarKeepOpen = 12 // keep open at least 24h, as example if TF=2h then the calcul is 24/2h = 12
    
    R = 50 // R=200 for TF=30min, R=100 for TF=1h, R=50 for TF=2h, R=25 for TF=4h
    
    crossEntry = R * 1
    crossExit = R * 2
    period1 = R * 2
    period2 = R * 2
    period3 = R * 4
    
    MM1 = Average[period1](close)
    MM2 = Average[period2](close)
    MM3 = Average[period3](close)
    
    entryBuy = MM1 > MM1[crossEntry] and MM2 > close and MM3 > close
    entrySell = MM1 < MM1[crossEntry] and MM2 < close and MM3 < close
    exitBuy = shortonmarket and MM1 < MM1[crossExit] AND BarIndex - TradeIndex > (minimumBarKeepOpen - 1)
    exitSell = longonmarket and MM1 > MM1[crossExit] AND BarIndex - TradeIndex > (minimumBarKeepOpen - 1)
     
     
    IF not onmarket and entryBuy THEN
    SELLSHORT positionSize SHARES AT MARKET
    ENDIF
    IF not onmarket and entrySell THEN
    BUY positionSize SHARES AT MARKET
    ENDIF
    
    IF exitBuy THEN
    exitshort at market
    ENDIF
    IF exitSell THEN
    SELL AT MARKET
    ENDIF
    
    IF SL > 0 THEN
    SET STOP %LOSS SL
    ENDIF
    IF TP > 0 THEN
    SET TARGET %PROFIT TP
    ENDIF
    DAX.jpg DAX.jpg EURUSD.jpg EURUSD.jpg FTSE.jpg FTSE.jpg US500.jpg US500.jpg
    #104443 quote
    jeremyben
    Participant
    Average

    Oops, wrong section, anybody can move my post to “ProOrder support” please?

    #104445 quote
    robertogozzi
    Moderator
    Master

    Done.

    #104472 quote
    Magifina
    Participant
    Master

    Hi Jeremyben,

    Thanks for sharing this strategy. It proves that a simple strategy can be performant.
    I have tries to tweak the different variables but I couldn’t lower the drawdown. In fact the drawdown is due to the fact that we are keeping our position for one day.
    To improve the performance MM3 can be removed. It allows to double the number of trades.

    #104475 quote
    jeremyben
    Participant
    Average

    By removing MM3, I get nearly the same number of trades. How did you get the double?

     

    The effect I see without MM3 are:

    • longer time spent in market (x1.5, an it reaches 100% time in market if we remove MM2 and MM3)
    • a slight improvement of GL

     

    And yes the main problem of this strategy is its potential huge DD because of no stop. How can we solve it?

    We are loosing performance by using any StopLoss. I’ve tried the trailing stop, but it doesn’t help. This strategy bet on a return of the market for the loosing trades so that make sense any Stoploss will go against the strategy.

    #104480 quote
    Magifina
    Participant
    Master

    I got the double with dax that works very well with this strategy.
    Maybe with a volatility filter you can improve drawdown but I don’t think significantly.

    On dax I had these conclusions:
    – The biggest lost are always with trades lasting more than 2 days
    –  A trade with a mfe of 0 will always end with a lost and one with a mae of 0 a win

    This strategy can be profitable if you have the necessary capital to handle the drawdown.
    It can be a good manual strategy but is too risky to be automated.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Trend following strategy, multi market, 30min to 4h


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
jeremyben @jeremyben Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by Magifina
6 years, 6 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/08/2019
Status: Active
Attachments: 4 files
Logo Logo
Loading...