Back Testing Anomaly using an EMA crossover strategy

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #116762 quote
    Steveaw
    Participant
    Average

    Hi All

    I’ve been working on a code using an EMA crossover strategy on the 1 hour Wall St  Index to enter long.

    The code has produced good results on optimising, but then I noticed it didn’t enter where I would have expected on some trades on back tested results.

    I then did a comparison with a very simple crossover entry built from the wizard & stripped back my code to match it.  On back testing I found that the two codes had different results and different entry positions.

    I’ve loaded up the two test codes:c(my striped down original code). & SAW DOW 1Hr Long Test 02 (My comparison code built in the wizard).
    I’ve also loaded up the equity curve and market entry screens and the results for both codes.

    Can anybody explain this as if it is a backtesting anomaly I am wary of the results produced!

    Thanks in advance

    Steve

    PS Please note the codes below are the entry only section of the overall codes, but all the backtesting and results are from running these two same codes

    //-------------------------------------------------------------------------
    // Code Name: SAW DOW 1Hr Long Test 01 - Striped Original Code
    //-------------------------------------------------------------------------
    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    
    // 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 = ExponentialAverage[28](open)//x1//28
    indicator2 = ExponentialAverage[44](open)//x2//44
    c1 = (indicator1 CROSSES OVER indicator2)
    
    IF c1 AND not daysForbiddenEntry THEN
    BUY 1 PERPOINT AT MARKET
    ENDIF
    
    
    //set stops & Targets
    SET STOP pLOSS 185//x//185
    SET TARGET pPROFIT 125//y//300
    //-------------------------------------------------------------------------
    // Code Name: SAW DOW 1Hr Long Test 02 - Wizard Generated Code
    //-------------------------------------------------------------------------
    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    
    // 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 = ExponentialAverage[28](open)
    indicator2 = Average[44](open)
    c1 = (indicator1 CROSSES OVER indicator2)
    
    IF c1 AND not daysForbiddenEntry THEN
    BUY 1 PERPOINT AT MARKET
    ENDIF
    
    // Stops and targets
    SET STOP pLOSS 185
    SET TARGET pPROFIT 125
    Screenshot-2020-01-14-at-10.33.22.png Screenshot-2020-01-14-at-10.33.22.png
    #116777 quote
    Nicolas
    Keymaster
    Master

    The second one uses a simple moving average (not exponential) for “indicator2”, while the first code uses EMA.

    #116789 quote
    Vonasi
    Moderator
    Master

    Topic moved to ProOrder forum which is for strategy topics. You posted in the ProBuilder forum which is for indicators. I think that is a better place for it as although your question is about an indicator it is about an indicator in a strategy!

    Steveaw thanked this post
    #117177 quote
    Steveaw
    Participant
    Average

    Hi Nicolas – thanks for that, I must have been going code blind!!!

    Steve

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

Back Testing Anomaly using an EMA crossover strategy


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Steveaw @steveaw Participant
Summary

This topic contains 3 replies,
has 3 voices, and was last updated by Steveaw
6 years, 1 month ago.

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