Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

error [redacted]

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

    error [redacted]

    Hello,

    I get this error (attached) every time I place StopMarket close to the current price. This happens only on a real money account. The order still gets placed though.

    Here is my code:
    PHP Code:
            private void OnMyButtonClick(object sender, RoutedEventArgs rea)
            {
                var button = sender as Button;
                if (button == null || account == null) return;
    
                var bc = button.Content.ToString();
                var dir = bc == "Buy Indy" ? 1 : bc == "Sell Indy" ? -1 : 0;
                if (dir == 0) return;
    
                TriggerCustomEvent(o =>
                {
                    var ct = ChartControl.OwnerChart.ChartTrader;
                    if (ct == null) return;
    
                    OnAttach();
                    if (Attached == null) return;
                    isAttach = true;
                    initDir = IndieValue > Close[0] ? -1 : 1;
                    var v = IndieValue;
    
                    var oType =
                        v > Close[0]
                            ? dir > 0
                                ? OrderType.StopMarket
                                : OrderType.Limit
                            : dir > 0
                                ? OrderType.Limit
                                : OrderType.StopMarket;
    
                    var entryOrder =
                        account.CreateOrder(
                            Instrument
                            , dir > 0 ? OrderAction.Buy : OrderAction.Sell
                            , oType
                            , TimeInForce.Day
                            , ct.Quantity
                            , v , v
                            , null, "Entry", null);
    
                    if (ct.AtmStrategy != null)
                        AtmStrategy.StartAtmStrategy(ct.AtmStrategy, entryOrder);
                    else
                        account.Submit(new[] { entryOrder });
    
                    myOrders.Add(entryOrder);
    
                }, null);
            }​ 
    
    Last edited by NinjaTrader_Emily; 11-11-2022, 11:37 AM. Reason: editing screenshot that shows personal information

    #2
    Hello frslvr,

    Thank you for your post.

    If your inquiry involves live orders, please always reach out to your broker's Orders Desk immediately to confirm and manage your live orders and positions.
    If your trade(s) are with NinjaTrader Brokerage, you can contact NinjaTrader Brokerage Order Desk by emailing [email protected].

    For security purposes, I have redacted the number in the title of this forum thread and covered it up in the screenshot of the error message. I believe it was your trading account number; in the future, please refrain from sharing personal information in the support forums.

    I am curious to know if there are additional details regarding this error in your diagnostic files. Please follow the steps below to manually send your log and trace files to create a private support ticket so I may investigate this matter further.
    • Open your NinjaTrader folder under My Documents.
    • Right-click on the 'log' and 'trace' folders and select Send To> Compressed (zipped) Folder.
    • Send the 2 compressed folders as attachments to your email to support[AT]ninjatrader[DOT]com
      • Please include "ATTN Emily C" in the subject line of your email and a link to this forum thread in the body
    • Once complete, you can delete these compressed folders.
    Additionally, please answer the following questions in the body of your email:
    • What Order ID was assigned to this order? You can check in the Executions or Orders tab of the Control Center.
    • Do you receive an error on the screen? Are there errors on the Log tab of the Control Center? If so, what do these errors report?

    Thanks in advance; I look forward to your response and helping to resolve this item.

    Comment


      #3
      Thank you, Emily.
      I found the actual cause of the error is when nothing was changed in Order o but o was submitted: account.Change(new[] { o });

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      576 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      334 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      553 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X