Why is this entering all the positions at once?
Here are some of the entries and exits - I have a total of 8:
//----------------------SHORT ENTRIES----------------------------------------
// SE1 ENTRY
if ((Position.MarketPosition == MarketPosition.Flat)
&& (RSI1.Default[0] > RSIOnHigherTF)
&& (RSI2.Default[0] > RSIOnLowerTF)
&& (Close[0] > High[1])
&& (Close[0] > Swing1.SwingHigh[0])
&& (MACD1.Diff[0] > 0))
{
EnterShort(Convert.ToInt32(100), @"SE1");
}
// SE1 EXIT
if ((Position.MarketPosition == MarketPosition.Short)
&& (Position.Quantity == 100)
&& (Close[0] < Swing1.SwingLow[0]))
{
Print("LE1 Entry time is:");
Print(Time[0]);
ExitShort(Convert.ToInt32(100), @"SExit1", @"SE1");
}
// SE2 ENTRY
if ((Position.Quantity == 100)
&& (Close[0] > High[1])
&& (Close[0] > Swing1.SwingHigh[0])
&& (Close[0] > Position.AveragePrice - .002)
&& (Close[0] > MAX1[1])
&& (MACD1.Diff[0] > 0))
{
Print("LE2 Entry time is:");
Print(Time[0]);
EnterShort(Convert.ToInt32(200), @"SE2");
}
// SE2 EXIT
if ((Position.Quantity == 300)
&& (Close[0] < Swing1.SwingLow[0]))
{
ExitShort(Convert.ToInt32(200), @"SExit2", @"SE2");
}

Comment