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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    43 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    30 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    47 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    38 views
    0 likes
    Last Post CarlTrading  
    Working...
    X