EMA cross Reversal

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10323 quote
    wolf
    Participant
    Junior

    Hi, I have a trading system that depends on different length EMAs. I would like any tips on how I can make it so after the EMAs cross, when it would normally go short it will go long. I would like it if this only  happens once, therefore It’s not going backwards and forwards in future crosses.

    I have a picture of the scenario I’m talking about here: https://gyazo.com/7ed5bc84341c790d0fb7834b1d7aecfa

    I also would like too know if there is a way through coding, to stop the system from trading when a take profit is hit, so if you have any ideas, any help would be greatly appreciated.

    Thanks

    Wolf

    defparam preloadbars = 15
    defparam CUMULATEORDERS = false
    
    
    indicator1 = ExponentialAverage[20](close)
    indicator2 = ExponentialAverage[100](close)
    
    
    //buy condition
    cBuy = (high CROSSES OVER indicator1)
    
    //sell condition
    cSell = (indicator2 CROSSES Over indicator1) or (indicator1 Crosses Over Indicator2)
    
    
    
    set target $profit 500
    
    If cbuy then
    sellshort 33 perpoint at market
    endif
    
    If csell then
    exitshort at market
    endif
    
    if csell then
    buy 33 perpoint at market
    endif
    
    if cbuy then
    sell at market
    endif
    
    
    7ed5bc84341c790d0fb7834b1d7aecfa.png 7ed5bc84341c790d0fb7834b1d7aecfa.png
    #11617 quote
    Nicolas
    Keymaster
    Master

    Hi wolf, sorry for delay about answer to your question. I don’t understand well what is your request here? Do you want to go Long after a bad Short trade directly?

    #11623 quote
    Derek
    Participant
    Veteran

    Hi Wolf!

    Concerning your second question, you can use the “strategyprofit”.

    Something like this should do the job:

    IF STRATEGYPROFIT < -500 THEN
     QUIT
    ENDIF
    
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

EMA cross Reversal


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
wolf @wolf Participant
Summary

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

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