DAX trading strategy micro trend follower 1 minute

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #26544 quote
    Ianwalton04
    Participant
    New

    hi all here is my first attempt at a micro trend following algo for the dax developed for 1min chart but works better on the 2min chart .

    i would love to see if any of you clever guys can improve on it at all ??

    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    
    // Prevents the system from creating new orders to enter the market or increase position size before the specified time
    timeEnterBefore = time >= 070000
    
    // Prevents the system from placing new orders to enter the market or increase position size after the specified time
    timeEnterAfter = time < 161500
    
    // Prevents the system from placing new orders on specified days of the week
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    // Conditions to enter long positions
    indicator1 = Average[5](close)
    indicator2 = Average[21](close)
    c1 = (indicator1 CROSSES OVER indicator2)
    
    IF c1 AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
    BUY 2 CONTRACT AT MARKET
    ENDIF
    
    // Conditions to exit long positions
    indicator3 = Average[5](close)
    indicator4 = Average[21](close)
    c2 = (indicator3 CROSSES UNDER indicator4)
    
    IF c2 THEN
    SELL AT MARKET
    ENDIF
    
    // Conditions to enter short positions
    indicator5 = Average[5](close)
    indicator6 = Average[21](close)
    c3 = (indicator5 CROSSES UNDER indicator6)
    
    IF c3 AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
    SELLSHORT 2 CONTRACT AT MARKET
    ENDIF
    
    // Conditions to exit short positions
    indicator7 = Average[5](close)
    indicator8 = Average[21](close)
    c4 = (indicator7 CROSSES OVER indicator8)
    
    IF c4 THEN
    EXITSHORT AT MARKET
    ENDIF
    
    // Stops and targets
    SET STOP pTRAILING 90
    SET TARGET pPROFIT 500
    
    screenshot-1488117895p8l4c1.png screenshot-1488117895p8l4c1.png
    #26587 quote
    GraHal
    Participant
    Master

    Hi Ian

    Attached is what I get with 1 point spread over 100,000 bars on a 2 min timeframe.

    Have you got any spread on your results?

    Cheers
    Graham

    2017-02-27_18-36-54.jpg 2017-02-27_18-36-54.jpg
    #26629 quote
    Ianwalton04
    Participant
    New

    Hi graham thanks for taking a look ! And no I did not include spread an oversight on my part sorry about that !

    Back to the drawing board we go !!😢

    #26664 quote
    GraHal
    Participant
    Master

    Ian just set the spread in the backtest module … tick the box and enter 1 (GMT daytime) … but you know that I’m sure.

    #26676 quote
    Ianwalton04
    Participant
    New

    Hey Garhal thanks for the pointer no but I do now and I will add it to all my back tests on the dax now .

    Thanks again 🖒

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

DAX trading strategy micro trend follower 1 minute


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by Ianwalton04
9 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 02/27/2017
Status: Active
Attachments: No files
Logo Logo
Loading...