SP500 M1 curve follower

Viewing 5 posts - 31 through 35 (of 35 total)
  • Author
    Posts
  • #186961 quote
    phoentzs
    Participant
    Master

    I won’t be able to do that until Monday.

    SnorreDK thanked this post
    #187190 quote
    phoentzs
    Participant
    Master

    Here is my code with SMA entry. Completely simple trend approach, nothing more. Totally simple. But the performance is amazing.
    Optimized over 200000bars
    Spread 0.6
    German time

    ///Spread set to 0.6 points
    
    defparam preloadbars = 10000
    defparam CUMULATEORDERS = false
    
    
    possize = 5
    pointsp = 35 //points where profit is to be locked in //20 SP500
    pointsb = 45 //points where stop is to be taken       //36 SP500
     
    fast   = average[20,0](close) //11,4  20,0
    medium = average[200,0](close) //13,4  200,0
    
    myRSI = RSI[2](close)
    RSIlong  = myRSI crosses over 90 //90...95
    RSIshort = myRSI crosses under 10 //5...10
    
    long   = fast > medium
    short  = fast < medium
    
     
    // trading window
    ONCE BuyTime  = 150000
    ONCE SellTime = 220000
     
    // position management
    IF Time >= buyTime AND Time <= SellTime THEN
    
    If countofposition = 0 then
    If long then
    BUY possize CONTRACT AT market
    EndIf
    EndIf
    If countofposition = 0 then
    If short then
    sellshort possize CONTRACT AT market
    EndIf
    EndIf
    endif
     
    //Umkehr
    If longonmarket and close >= positionprice + pointsp then
    If close < close[1] then
    SELL AT MARKET
    EndIf
    ElsIf longonmarket and close <= positionprice - pointsb then //and short
    SELLSHORT possize*2 CONTRACT AT MARKET  //*2
    EndIf
    
    If shortonmarket and close <= positionprice - pointsp then
    If close > close[1] then
    EXITSHORT AT MARKET
    EndIf
    ElsIf shortonmarket and close >= positionprice + pointsb then  //and long
    BUY possize*2 CONTRACT AT MARKET  //*2
    EndIf
    
     
    //SET STOP pLOSS b
    SET TARGET pPROFIT 45 //50
    SET STOP %LOSS 2.6
    
    IF Time >= 10000 AND Time <= 150000 THEN
    
    If longonmarket  and (PositionPerf * PositionPrice / PipSize) >= 30 then //35  and time=90000
    sell at market
    endif
    If shortonmarket  and (PositionPerf * PositionPrice / PipSize) >= 25 then  //5  and time=90000
    exitshort at market
    endif
    
    endif
    
    ////morgens
    //If longonmarket and time=90000 and (PositionPerf * PositionPrice / PipSize) >= 30 then //35
    //sell at market
    //endif
    //If shortonmarket and time=90000 and (PositionPerf * PositionPrice / PipSize) >= 15 then  //5  and dayofweek=x11
    //exitshort at market
    //endif
    //
    ////mittag
    //If longonmarket and time=120000 and (PositionPerf * PositionPrice / PipSize) >= 30 then //35
    //sell at market
    //endif
    //If shortonmarket and time=120000 and (PositionPerf * PositionPrice / PipSize) >= 25 then  //5  and dayofweek=x11
    //exitshort at market
    //endif
    
    //abends
    If longonmarket and time=220000 and (PositionPerf * PositionPrice / PipSize) >= 30 then //35
    sell at market
    endif
    If shortonmarket and time=220000 and (PositionPerf * PositionPrice / PipSize) >= 1 then  //5  and dayofweek=x11
    exitshort at market
    endif
    thanked this post
    #187193 quote
    SnorreDK
    Participant
    Junior

    ThankS!

    Do u run it on sp500 timeframe 1min?

    #187209 quote
    phoentzs
    Participant
    Master

    No, in M5.

    #187227 quote
    phoentzs
    Participant
    Master

    @snorreDK: have you tried it?

Viewing 5 posts - 31 through 35 (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...