Order '9f75883fde9b477689b3b11005of1883' can't be submitted; The OCO ID '9f75883fde9b477689b3b11005of1883' cannot be reused. Please use a new OCO ID.
I'm getting the above error in my strategy and once this error occurs the strategy stops working and this error message is in the log. It works fine for some time but then out of nowhere it throws that error and strategy just dies... What can I do to prevent this?
My Code is fairly simple:
if (......))
{
Print("+_+_+_+ ... :: " + DateTime.Now );
currentPtPrice = Close[0] + ProfitTargetDistance * TickSize;
currentSlPrice = mySAR[0] - 1;
if (UseProfitTarget)
{
SetProfitTarget(CalculationMode.Price, currentPtPrice);
Print("Setting Long ProfitTarget at: --> " + currentPtPrice);
}
if (UseStopLoss)
{
SetStopLoss(CalculationMode.Price, currentSlPrice);
Print("Setting Long StopLoss at: --> " + currentSlPrice);
}
EnterLong();
.
.
.
.
.
if (BarsInProgress == 1 && Position.MarketPosition == MarketPosition.Long)
{
if (....)
{
currentPtPrice = Close[0] + ProfitTargetDistance * TickSize;
SetProfitTarget(CalculationMode.Price, currentPtPrice);
Print("Adjusting Profit Target for Long to: --> " + currentPtPrice);
SetStopLoss(CalculationMode.Price, mySAR[0]);
Draw.Diamond(this, "LongStop", true, 0, mySAR[0], Brushes.Lime);
Print("Adjusting Stop Loss for Long to: --> " + currentSlPrice);
}else if (.....)
ExitLong();
Print("+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=");
}
Comment