Let's say I have a set of conditions that trigger an entry. Then say some bars later the trade is still open, but a new setup occurs in the opposite direction. I'd like to close the open position and then possibly open one in the opposite direction, a reversal if you will.
Here's how I've coded it. However, i'm getting some mixed results with Market Replay. sometimes it works, sometimes it doesn't. what it seems to do is close the open position but doesn't open the new position
// Condition set 1 short
if (Falling(MACD()
{
DrawDot("" + CurrentBar, false, 0, High[0] + 2 * TickSize, Color.Red);
ExitLong(); //close open long position
EnterShortLimit(Contracts, Close[0] + Retrace * TickSize, "BGS");
SetProfitTarget("BGS", CalculationMode.Ticks, Ttarget);
SetStopLoss("BGS", CalculationMode.Ticks, Sstop, false);
also, i put the Target and Stop Loss with the order so i can use different target and or stop loss for other conditions... is that correct also?
thank you for any help to a novice
Comment