I'm having trouble exiting my breakeven position once it has reached a certain price level.
Usage:
Calculate = Calculate.OnEachTick;
EntryHandling = EntryHandling.UniqueEntries;
EntriesPerDirect = 1;
SetStopLoss("SALE", CalculationMode.Price, stopSales, false);
EnterShortLimit(Closes[303][0],"SALE");
...to enter the market. And once I have the position entered, I use the breakeven to enter:
if(Position.MarketPosition == MarketPosition.Short)
{
if(Closes[0][0] <= (Position.AveragePrice - 15*TickSize))
{
SetStopLoss("SALE",CalculationMode.Price(Position. AveragePrice - TickSize), false);
}
}
I use two different SetStopLoss() commands.
The problem is that when I run the program, it positions itself correctly, but when it exits the position, it immediately places another short position without fulfilling the entry requirement.
Why is this?
If you find the brakeven programming incorrect, could you tell me how to do it correctly?
Thank you very much in advance;

Comment