Sharing Idea and feedback –> Ibex / Dax / Cac / EU / SP / Nasdaq / WS

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #105090 quote
    Manuel Aboy
    Participant
    Average

    Hi all,

    Would like to share my strategy, very simple, nothing too complicated . Wanted to ask for feedback and any ideas of improvement.

    Regards

    Note: standard takeprofit and stoploss =100 points

    For WS

    takeprofit = 200 //takeprofit in points

    stoploss = 200 //stoploss in points

    For EU

    takeprofit = 50 //takeprofit in points

    stoploss = 50 //stoploss in points

    DEFPARAM CumulateOrders = false // Acumulación de posiciones desactivada
    
    units=10              //units to buy or sell
    takeprofit = 100     //takeprofit in points
    stoploss = 100       //stoploss in points
    BreakevenAt = 25     //percent achieved of target to move stop to entry (breakeven)
    PointsToKeep = 1     //how much points to keep in profit above of below our entry price when the breakeven is activated (beware of spread)
    
    
    // Condiciones para entrada de posiciones largas
    indicator1 = ExponentialAverage[30](close)
    indicator2 = ExponentialAverage[60](close)
    c1 = (indicator1 > indicator2)
    indicator3 = ExponentialAverage[60](close)
    c2 = (close < indicator3)
    
    IF c1 AND c2 THEN
    BUY units CONTRACT AT MARKET
    SET STOP pTRAILING stoploss
    ENDIF
    
    // Condiciones de entrada de posiciones cortas
    indicator6 = ExponentialAverage[30](close)
    indicator7 = ExponentialAverage[60](close)
    c4 = (indicator6 < indicator7)
    indicator8 = ExponentialAverage[60](close)
    c5 = (close > indicator8)
    
    IF c4 AND c5 THEN
    SELLSHORT units CONTRACT AT MARKET
    SET STOP pTRAILING stoploss
    ENDIF
    
    //reset the breakevenLevel when no trade are on market
    IF NOT ONMARKET THEN
    breakevenLevel=0
    ENDIF
    
    startBreakeven = (BreakevenAt/100)*takeprofit      //how much points in gain to activate the breakeven function
    
    // --- BUY SIDE ---
    //test if the price have moved favourably of "startBreakeven" points already
    IF LONGONMARKET AND close-tradeprice(1)>=startBreakeven*pipsize THEN
    //calculate the breakevenLevel
    breakevenLevel = tradeprice(1)+PointsToKeep*pipsize
    ENDIF
    
    //place the new stop orders on market at breakevenLevel
    IF LONGONMARKET AND breakevenLevel>0 THEN
    SELL AT breakevenLevel STOP
    ENDIF
    
    
    // --- SELL SIDE ---
    //test if the price have moved favourably of "startBreakeven" points already
    IF SHORTONMARKET AND tradeprice(1)-close>=startBreakeven*pipsize THEN
    //calculate the breakevenLevel
    breakevenLevel = tradeprice(1)-PointsToKeep*pipsize
    ENDIF
    
    //place the new stop orders on market at breakevenLevel
    IF SHORTONMARKET AND breakevenLevel>0 THEN
    EXITSHORT AT breakevenLevel STOP
    ENDIF
    General.itf 2019-08-19.png 2019-08-19.png
    #105315 quote
    Nicolas
    Keymaster
    Master

    Thanks a lot! So that’s for the daily timeframe? Did you include spread, fees and backtested with tick-by-tick mode enable?

    #105381 quote
    Manuel Aboy
    Participant
    Average

    Hi, it works for 1 hour time frame, spread is NOT included, tick by tick YES. Check the difference in the attached picture.

    I dont know why but today it didnt respect the stoploss at breakeven when I was long in Crude.

    On simulation, no problem, the stoploss worked fine but not in real market. Any idea why?

    Thanks

    Manuel

    Capture.jpg Capture.jpg
    #105395 quote
    Nicolas
    Keymaster
    Master

    The SET STOP pTRAILING might be the cause of the differences.

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

Sharing Idea and feedback –> Ibex / Dax / Cac / EU / SP / Nasdaq / WS


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

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

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