Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to avoid order reject error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to avoid order reject error

    Hello.

    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?
    Code:
     // 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");
                }
                ​
    Marble

    #2
    Hello Marble,

    Thank you for your post.

    If you would like your strategy to ignore order rejection errors, you can change your strategy's RealtimeErrorHandling setting.



    RealtimeErrorHandling.StopCancelCloseIgnoreRejects will perform default behavior on all errors, except rejections.

    Please let us know if you have any further questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    57 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    39 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    45 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    35 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    153 views
    0 likes
    Last Post SalmaTrader  
    Working...
    X