-----
if (Position.MarketPosition == MarketPosition.Flat)
{
currentStop = 0;
trail = false;
SetStopLoss(CalculationMode.Ticks, stoplossticks);
}
else if (Position.MarketPosition == MarketPosition.Long && trail == false)
{
// After 10 ticks set stop loss to BE-10
if (Close[0] >= Position.AvgPrice + 10 * TickSize && Close[0] < Position.AvgPrice + 15 * TickSize && currentStop < Position.AvgPrice - 10 * TickSize)
{
currentStop = Position.AvgPrice - 10 * TickSize;
SetStopLoss(CalculationMode.Price, currentStop);
}
-----
Now when I try to reverse it for shorts, it ignores the short stop:
-----
if (Position.MarketPosition == MarketPosition.Flat)
{
currentStop = 0;
trail = false;
SetStopLoss(CalculationMode.Ticks, stoplossticks);
}
else if (Position.MarketPosition == MarketPosition.Short && trail == false)
{
// After 10 ticks set stop loss to BE-10
if (Close[0] <= Position.AvgPrice - 10 * TickSize && Close[0] > Position.AvgPrice - 15 * TickSize && currentStop > Position.AvgPrice + 10 * TickSize)
{
currentStop = Position.AvgPrice + 10 * TickSize;
SetStopLoss(CalculationMode.Price, currentStop);
}
-----
I changed the MarketPosition.Long to MarketPosition.Short and changed greater to less than, switched + for -'s and such and it does not work. This should work correct? An example is it shorts at 1546, drops to 1540 (more than 10 ticks) and it doesnt update? I have TraceOrders = true; and checked the logs and it tells me nothing.
Thanks for any help on this.
Shawn
Comment