SP500 M1 curve follower

Viewing 15 posts - 1 through 15 (of 35 total)
  • Author
    Posts
  • #185089 quote
    phoentzs
    Participant
    Master

    I came across this little system from Juanj here and am falling a little bit off the beaten track. I optimized it to M1 200000bars for the SP500 and added an emergency stop. And then something comes out. Has anyone tried that? Sure, it’s almost always on the market. Do the over-night fees eat up the profit or can you trade something like that live? What do the old hands say?

    @juanj
    : What do you think about it yourself?

    ///Spread set to 0.9 points
    defparam preloadbars = 10000
    
    possize = 1
    pointsp = 15 //points where profit is to be locked in //20 SP500
    pointsb = 43 //points where stop is to be taken       //36 SP500
     
    fast = average[11,4](close) //11
    medium = average[14,4](close) //13
     
    If countofposition = 0 then
    If fast > medium then
    BUY possize CONTRACT AT open + averagetruerange[3](close)*2 stop
    EndIf
    EndIf
     
    If longonmarket and close >= positionprice + pointsp then
    If close < close[1] then
    SELL AT MARKET
    EndIf
    ElsIf longonmarket and close <= positionprice - pointsb then
    SELLSHORT possize*2 CONTRACT AT MARKET
    EndIf
     
    If shortonmarket and close <= positionprice - pointsp then
    If close > close[1] then
    EXITSHORT AT MARKET
    EndIf
    ElsIf shortonmarket and close >= positionprice + pointsb then
    BUY possize*2 CONTRACT AT MARKET
    EndIf
     
    SET TARGET pPROFIT 16 //50
    SET STOP %LOSS 1.1
    #185112 quote
    phoentzs
    Participant
    Master

    Ok, the system will stop. Of course, a stop order in the M1 does not work. So the input must also be a market order. At least in the M1.

    #185120 quote

    Most likely the system will stop and every time you have to reactivate it as mentioned in the previous post, but it works well only in the optimized period
    Hello

    Mauro T.

    #185125 quote
    phoentzs
    Participant
    Master

    It’s optimized for M1 SP500, a try. Does this kind of mechanics even make sense? Since I’m not a great programmer, I’ll ask the experts.

    #185127 quote
    phoentzs
    Participant
    Master

    Quickly rewritten to a fixed 5 * pip size … that should actually be enough. The picture is similar, only less time on the market.

    ///Spread set to 0.9 points
    defparam preloadbars = 10000
    
    possize = 5
    pointsp = 25 //points where profit is to be locked in //20 SP500
    pointsb = 45 //points where stop is to be taken       //36 SP500
     
    fast = average[11,4](close) //11
    medium = average[14,4](close) //13
     
    //If countofposition = 0 then
    //If fast > medium then
    //BUY possize CONTRACT AT open + averagetruerange[3](close)*2 stop
    //EndIf
    //EndIf
    
    If countofposition = 0 then
    If fast > medium then
    BUY possize CONTRACT AT open + 5*pipsize stop
    EndIf
    EndIf
     
    If longonmarket and close >= positionprice + pointsp then
    If close < close[1] then
    SELL AT MARKET
    EndIf
    ElsIf longonmarket and close <= positionprice - pointsb then
    SELLSHORT possize*2 CONTRACT AT MARKET
    EndIf
     
    If shortonmarket and close <= positionprice - pointsp then
    If close > close[1] then
    EXITSHORT AT MARKET
    EndIf
    ElsIf shortonmarket and close >= positionprice + pointsb then
    BUY possize*2 CONTRACT AT MARKET
    EndIf
     
    SET TARGET pPROFIT 25 //50
    SET STOP %LOSS 1.2
    
    #185166 quote
    SnorreDK
    Participant
    Junior

    Thanks for sharing phoentzs

    Here is 1M Backtest. Big drawdowns at long.

    #185175 quote
    phoentzs
    Participant
    Master

    The strategy didn’t come from me. The strategy is certainly not robust, rather something that you optimize every month. It cannot manage 1000000bars for the reason that it is calculated in pips. But a nice gimmick that maybe only needs a frame.

    #185203 quote
    snucke
    Participant
    Veteran

    SnorreDK  could you do a 1M Backtest on this one?

     

    ///Spread set to 0.9 points
    defparam preloadbars = 10000
     
    possize = 5
    pointsp = 25 //points where profit is to be locked in //20 SP500
    pointsb = 45 //points where stop is to be taken       //36 SP500
     
    fast = average[11,4](close) //11
    medium = average[14,4](close) //13
    TIMEFRAME (10 MINUTES, updateonclose)
    A = 26
    B = 8
    S = 1.3
    A1 = Average[A,B](low)
    A2 = Average[A*s,B](low)
    c3 = a1 > a2
    TIMEFRAME (default, UPDATEONCLOSE)
    //If countofposition = 0 then
    //If fast > medium then
    //BUY possize CONTRACT AT open + averagetruerange[3](close)*2 stop
    //EndIf
    //EndIf
     
    If countofposition = 0 then
    If fast > medium and c3 then
    BUY possize CONTRACT AT open + 5*pipsize stop
    EndIf
    EndIf
     
    If longonmarket and close >= positionprice + pointsp then
    If close < close[1] then
    SELL AT MARKET
    EndIf
    ElsIf longonmarket and close <= positionprice - pointsb then
    SELLSHORT possize*2 CONTRACT AT MARKET
    EndIf
     
    If shortonmarket and close <= positionprice - pointsp then
    If close > close[1] then
    EXITSHORT AT MARKET
    EndIf
    ElsIf shortonmarket and close >= positionprice + pointsb then
    BUY possize*2 CONTRACT AT MARKET
    EndIf
     
    SET TARGET pPROFIT 25 //50
    SET STOP %LOSS 1.2
    
    #185207 quote
    SnorreDK
    Participant
    Junior

    Yes.

    Not that good outside the optimized period.

    #185223 quote
    phoentzs
    Participant
    Master

    You then have to insert the conditions of the time frame M10 into the order instructions below…. But like I said, it’s pips … may not have worked that long ago. Then you would have to convert it to% profit.

    #185231 quote
    snucke
    Participant
    Veteran

    what do you mean phoentzs ? its an else if command? so i do not need to insert it else where?

    converted TP into % if SnorreDK could test to see if there is any diff in the performance this way

     

    ///Spread set to 0.9 points
    defparam preloadbars = 10000
     
    possize = 5
    pointsp = 25 //points where profit is to be locked in //20 SP500
    pointsb = 45 //points where stop is to be taken       //36 SP500
     
    fast = average[11,4](close) //11
    medium = average[14,4](close) //13
    TIMEFRAME (10 MINUTES, updateonclose)
    A = 26
    B = 8
    S = 1.3
    A1 = Average[A,B](low)
    A2 = Average[A*s,B](low)
    c3 = a1 > a2
    TIMEFRAME (default, UPDATEONCLOSE)
    //If countofposition = 0 then
    //If fast > medium then
    //BUY possize CONTRACT AT open + averagetruerange[3](close)*2 stop
    //EndIf
    //EndIf
     
    If countofposition = 0 then
    If fast > medium and c3 then
    BUY possize CONTRACT AT open + 5*pipsize stop
    EndIf
    EndIf
     
    If longonmarket and close >= positionprice + pointsp then
    If close < close[1] then
    SELL AT MARKET
    EndIf
    ElsIf longonmarket and close <= positionprice - pointsb then
    SELLSHORT possize*2 CONTRACT AT MARKET
    EndIf
     
    If shortonmarket and close <= positionprice - pointsp then
    If close > close[1] then
    EXITSHORT AT MARKET
    EndIf
    ElsIf shortonmarket and close >= positionprice + pointsb then
    BUY possize*2 CONTRACT AT MARKET
    EndIf
     
    SET TARGET %PROFIT 0.54
    SET STOP %LOSS 1.2
    
    #185234 quote
    phoentzs
    Participant
    Master

    I’m still testing myself. In any case, lines 4-6 and the corresponding instructions in the code must be given as a percentage in order to be able to test further back in a practicable manner. In my opinion, C3 must also be included in lines 33-44. So that people only buy and sell in the respective direction. I believe.

    #185236 quote
    SnorreDK
    Participant
    Junior

    Here u go Snucke

    #185242 quote
    phoentzs
    Participant
    Master

    @Robertogozzi: Could you please surround the values in%? Also those in the “IF” loop?

    #185243 quote
    robertogozzi
    Moderator
    Master

    Which code are you referring to?

    What do you mean by SURROUND?

    Which IF block?

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

SP500 M1 curve follower


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
phoentzs @phoentzs Participant
Summary

This topic contains 34 replies,
has 6 voices, and was last updated by phoentzs
4 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/11/2022
Status: Active
Attachments: 14 files
Logo Logo
Loading...