My automatic scalp system for dax

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #18062 quote
    Alco
    Participant
    Senior

    Hello guys,

    Im new here and trying for the first time to build my automatic system for 10 min charts. But it shows good results for 15 min charts aswell.

    I have no knowledge about programming at all, but at the first backtests of this system… it seems to work pretty well! With some help it could be a very profitable system.

    The code you see below.

    You also need to use the ”’turtle indicator” what I found somewhere on the internet.
    I’ve also used the momentum indicator ”30” and the directional movement indicator ”14”

    Buy when momentum is in green and directional movement d+ is above 25
    Sell when momentum is in red and directional movement d- is above 25

     

    Turtle Indicator
    
    EMA3 = ExponentialAverage[3](close)
    EMA5 = ExponentialAverage[5](close)
    EMA8 = ExponentialAverage[8](close)
    EMA10 = ExponentialAverage[10](close)
    EMA12 = ExponentialAverage[12](close)
    EMA15 = ExponentialAverage[15](close)
    EMA30 = ExponentialAverage[30](close)
    EMA35 = ExponentialAverage[35](close)
    EMA40 = ExponentialAverage[40](close)
    EMA45 = ExponentialAverage[45](close)
    EMA50 = ExponentialAverage[50](close)
    EMA60 = ExponentialAverage[60](close)
    
    
    //Scalp system
    RETURN EMA3 COLOURED(0,0,255), EMA5 COLOURED(0,0,255) ,EMA8 COLOURED(0,0,255) , EMA10 COLOURED(0,0,255) ,EMA12 COLOURED(0,0,255) , EMA15 COLOURED(255,0,0) ,EMA30 COLOURED(255,0,0), EMA35 COLOURED(255,0,0),EMA40 COLOURED(255,0,0), EMA45 COLOURED(255,0,0),EMA50 COLOURED(255,0,0), EMA60 COLOURED(255,0,0)
    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    
    // Conditions to enter long positions
    ignored, ignored, ignored, ignored, ignored, indicator1, ignored, ignored, ignored, ignored, ignored, ignored = CALL "turtle indicator"
    ignored, ignored, ignored, ignored, ignored, ignored, ignored, ignored, ignored, ignored, ignored, indicator2 = CALL "turtle indicator"
    c1 = (indicator1 >= indicator2)
    
    indicator3 = DIplus[14](close)
    c2 = (indicator3 > 25)
    
    indicator4 = Momentum[30](close)
    c3 = (indicator4 > 0)
    
    IF c1 AND c2 AND c3 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    // Conditions to exit long positions
    indicator5, ignored, ignored, ignored, ignored, ignored, ignored, ignored, ignored, ignored, ignored, ignored = CALL "turtle indicator"
    ignored, ignored, ignored, ignored, ignored, ignored, ignored, ignored, ignored, ignored, ignored, indicator6 = CALL "turtle indicator"
    c4 = (indicator5 CROSSES UNDER indicator6)
    
    indicator7 = Momentum[30](close)
    c5 = (indicator7 > 0)
    
    indicator8 = DI[14](close)
    c6 = (indicator8 >= 25)
    
    IF c4 AND c5 AND c6 THEN
    SELL  AT MARKET
    ENDIF
    
    // Conditions to enter short positions
    ignored, ignored, ignored, ignored, ignored, indicator9, ignored, ignored, ignored, ignored, ignored, ignored = CALL "turtle indicator"
    ignored, ignored, ignored, ignored, ignored, ignored, ignored, ignored, ignored, ignored, ignored, indicator10 = CALL "turtle indicator"
    c7 = (indicator9 CROSSES UNDER indicator10)
    
    indicator11 = Momentum[30](close)
    c8 = (indicator11 < 0)
    
    indicator12 = DIminus[14](close)
    c9 = (indicator12 > 25)
    
    IF c7 AND c8 AND c9 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    
    // Conditions to exit short positions
    indicator13, ignored, ignored, ignored, ignored, ignored, ignored, ignored, ignored, ignored, ignored, ignored = CALL "turtle indicator"
    ignored, ignored, ignored, ignored, ignored, ignored, indicator14, ignored, ignored, ignored, ignored, ignored = CALL "turtle indicator"
    c10 = (indicator13 CROSSES OVER indicator14)
    
    IF c10 THEN
    EXITSHORT  AT MARKET
    ENDIF
    
    // Stops and targets
    SET STOP pLOSS 10
    SET TARGET pPROFIT 5
    
    
    

    It has a very low drawdown as you can see in the picture

    scalp-system.pdf
    #18065 quote
    Nicolas
    Keymaster
    Master

    Hi Alco, and thank you a lot for sharing your code, much appreciated.

    Haven’t test your strategy myself, but I think it could suffer from the “0 bar” behaviour of probacktest. How much trade last 0 bar in the probacktest results? Does it have much trades that open and close on the same candlestick? Seems to have some, because of “Avg time in the market” of 0.29 bars.

    #18068 quote
    Alco
    Participant
    Senior
    #18071 quote
    Alco
    Participant
    Senior

    Hello Nicolas,

    I see a lot of  ”0” bars in the results. This is my first time i’m trying to program a code so all help I do very appreciate.
    What do I need to change in the code to avoid the 0 bars?

    Regards,

    Alco

    #18072 quote
    Alco
    Participant
    Senior

    In my momentum indicator  set to 30, I added the wilders ‘smoothing average ”19”.  For a buy, the momentum needs to be above the wilders average. For short traders the momentum needs to be below the wilders smoothing average. I don’t know how to adapt it in the code.

    Trading hours are 08:00-22:00

    dax-trading-system-1.png dax-trading-system-1.png
    #18075 quote
    Nicolas
    Keymaster
    Master

    Ok so obvisouly you are not aware of the 0 bar problem. Please have a look at the video of this post which expose the problem and the new backtest engine to come with the PRT 10.3 version: http://www.prorealcode.com/blog/video-tutorials/tick-tick-backtest-engine-probacktest/

    Because there must be a lot of takeprofit and stoploss price levels contained in the orders’entries bars, and because takeprofit are always tested before the stoploss, the backtest result you get here is not good. Unless you have the new PRT version, there’s not much to do to avoid the problem.

    #18077 quote
    Alco
    Participant
    Senior

    Hi Nicolas,

    I was not up to date with the ”0” bars problem. Im running PRT with IG so it isn’t possible yet.

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

My automatic scalp system for dax


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Alco @alco_aarts Participant
Summary

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

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