ADX+EMAS Strategy – Appreciate comments!

Viewing 2 posts - 16 through 17 (of 17 total)
  • Author
    Posts
  • #84098 quote
    CA
    Participant
    New

    Hello! So, as I promised, here is the initial code (before de trailing stop optimization). If you have any comments, I will be glad to read them!

     

    Additionally, I am also posting a screenshot of the backtest (by tick) with 100000 units. This time I used the CAD/JPY pair.

    SHORT = 14
    LONG = 40
    PERIODOADX = 24
    PERIODOSDECRUCE =20
    PERIODODECRUCE2 = 50
    
    Condition1 = ADX[PERIODOADX] CROSSES OVER PERIODOSDECRUCE
    Condition2 = ExponentialAverage[SHORT](Close) > ExponentialAverage[LONG](Close) AND LOW[1] > ExponentialAverage[SHORT](Close)
    Condition3 = ExponentialAverage[SHORT](Close) < ExponentialAverage[LONG](Close) AND HIGH[1] < ExponentialAverage[SHORT](Close)
    
    //Long
    
    IF NOT LongOnMarket AND Condition1 AND Condition2 THEN
    BUY 1 CONTRACTS AT MARKET
    ENDIF
    
    // Exit long
    If LongOnMarket AND ADX[PERIODOADX] >= PERIODODECRUCE2 OR ExponentialAverage[SHORT](Close) CROSSES UNDER ExponentialAverage[LONG](Close)OR ADX[PERIODOADX] < PERIODOSDECRUCE THEN
    SELL AT MARKET
    ENDIF
    
    // Short
    IF NOT ShortOnMarket AND Condition1 AND Condition3 THEN
    SELLSHORT 1 CONTRACTS AT MARKET
    ENDIF
    
    // Exit short
    IF ShortOnMarket AND ADX[PERIODOADX] >= PERIODODECRUCE2 OR ExponentialAverage[SHORT](Close) CROSSES OVER ExponentialAverage[LONG](Close) OR ADX[PERIODOADX] < PERIODOSDECRUCE THEN
    EXITSHORT AT MARKET
    ENDIF
    
    SET STOP LOSS 150// Stops
    CADJPY.jpg CADJPY.jpg
    #84100 quote
    CA
    Participant
    New

    Nicolas, why the trailing won’t work? Could you explain us a little bit.

     

    Thanks!

Viewing 2 posts - 16 through 17 (of 17 total)
  • You must be logged in to reply to this topic.

ADX+EMAS Strategy – Appreciate comments!


General Trading: Market Analysis & Manual Trading

New Reply
Author
author-avatar
CA @camilo_acevedo Participant
Summary

This topic contains 16 replies,
has 4 voices, and was last updated by CA
7 years, 4 months ago.

Topic Details
Forum: General Trading: Market Analysis & Manual Trading
Language: English
Started: 10/30/2018
Status: Active
Attachments: 8 files
Logo Logo
Loading...