wolfParticipant
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
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?
Hi Wolf!
Concerning your second question, you can use the “strategyprofit”.
Something like this should do the job:
IF STRATEGYPROFIT < -500 THEN
QUIT
ENDIF