I use stop limit order in strategy builder. But I encounter order reject and strategy will be disabled.
I have added condition to ensure current bid/ask is above stop order value to avoid the error.
Is there any solution to avoid?
// Set 1
if ((Open[1] < Close[1])
&& (Close[1] >= POCofBar1[1])
&& (GetCurrentBid(0) >= (POCofBar1[1] + (1 * TickSize)) ))
{
Draw.Diamond(this, @"POCtest Diamond_1", false, 0, (POCofBar2[1] + (-1 * TickSize)) , Brushes.LightCoral);
EnterShortStopMarket(Convert.ToInt32(DefaultQuantity), (POCofBar1[1] + (-1 * TickSize)) , @"psell");
}
// Set 2
if ((Open[1] > Close[1])
&& (Close[1] <= POCofBar1[1])
&& (GetCurrentAsk(0) <= (POCofBar1[1] + (1 * TickSize)) ))
{
Draw.Diamond(this, @"POCtest Diamond_1", true, 0, (POCofBar2[1] + (1 * TickSize)) , Brushes.LawnGreen);
EnterLongStopMarket(Convert.ToInt32(DefaultQuantity), (POCofBar1[1] + (1 * TickSize)) , @"pbuy");
}

Comment