I had tried to combine them with "&&", but Ninjatrader rejected this saying it was impossible. Is there a way to get this under control?
if (Position.MarketPosition == MarketPosition.Long);
//if flat do nothing, nested statement below
{
if (GetCurrentBid(0) >= (Position.AveragePrice + 0.05))
{
ExitLong(Convert.ToInt32(SellHalf), "", "");
Print(Instrument.FullName + " Sold half at " + Close[0]);
}
//set3.25
if (GetCurrentBid(0) >= (Position.AveragePrice + 0.10))
{
ExitLong(Convert.ToInt32(Sell3of4), "", "");
Print(Instrument.FullName + " Sold 3/4 at " + Close[0]);
}
//set 4; stop
if (GetCurrentAsk(0) < (Low[1]))
{
ExitLong(Convert.ToInt32(ShareSize), "", "");
Print(Instrument.FullName + " Exited by Previous Bar Low Violation. Previous Bar Low was " + Low[1]);
}
}
Comment