I'm trying to have my strat enter upon a simple EMA cross and want it to enter whenever it does so, including midbar. So, I've set CalculateOnBarClose to false but when I try using "if (CrossAbove(EMA(20), EMA(50), 0))", it just doesn't enter. Using "if (CrossAbove(EMA(20), EMA(50), 1))" actually does work midbar (which I don't understand) but raises another issue. I'm using a breakeven stop in my code which moves to entry price once I'm +2 points in profit. The problem is if I'm long, hit +2 (raising my stop to even), then turn around and take out my stop in the same or next bar, my strat enters again because it's set to go long upon a cross 1 bar back.
I would prefer to code the cross to current bar and just add EntriesPerDirection = 1 but it doesn't seem to want to cooperate. Have I missed something or is there a work around?
Thanks,
Dave

Comment