string orderID = Instrument.FullName + " " + BarsPeriod.Value;
// Condition set 1
if (SMA(TrendFastMAperiod)[1] < SMA(TrendSlowMAperiod)[1]
&& SMA(ExitMAperiod)[1] > SMA(EntryMAperiod)[1]
&& Position.Quantity < TotalContracts)
{
EnterShortStop(NumContracts, SMA(EntryMAperiod)[1] - TicksFromMA * TickSize, "S1_short " + orderID);
//ExitShortStop(0, true, Position.Quantity, SMA(ExitMAperiod)[1], "S1_short " + orderID + " Stop", "S1_short " + orderID);
SetStopLoss("S1_Short " + orderID, CalculationMode.Ticks, Stop, false);
}
//Condition set 2
if (CrossAbove(DefaultInput[0], SMA(ExitMAperiod), 1)
&& Position.MarketPosition == MarketPosition.Short)
{
ExitShort("S1_Short " + orderID);
}
I can use ExitShort currently, shown in Condition 2, however it always takes me out in strange places (subsequent bars, open of current bar, strange), always later than I want.
Anyone able to show me some code using ExitShortStop to accomplish what I'm shooting for here?
Thanks in advance

Steve

Comment