I think something is wrong with my codes. It's not working the way I want. What I want it to do is to enter long when the EMA(fast) crosses above the EMA(Slow) by $1. And it will exit the trade if EMA(fast) cross above the EMA(slow) by $5 or exit when EMA(fast) == EMA(slow)...pretty much the same for short...If u see anything wrong..please advise. Thanks much!
//No Ninjatrader here...Codes have a lot of syntax error...it's just my idea
If(Crossabove EMA(fast), EMA(Slow)) {
If( EMA(fast) - EMA(slow) >1)
EnterLong();
If("Long"position == existed && EmA(fast) - EMA(slow) >5)
Exitlong();
}
If(EMA(fast)==EMA(slow))
Exitlong();
===============
//short
If(Crossabove EMA(Slow), EMA(fast)) {
If( EMA(slow) - EMA(fast) >1)
EnterShort();
If("Short"position == existed && EmA(slow) - EMA(fast) >5)
ExitShort();
}
If(EMA(fast)==EMA(slow))
ExitShort();
Comment