Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 senderRoutedEventArgs rea)
            {
                var 
    button sender as Button;
                if (
    button == null || account == null) return;

                var 
    bc button.Content.ToString();
                var 
    dir bc == "Buy Indy" bc == "Sell Indy" ? -0;
                if (
    dir == 0) return;

                
    TriggerCustomEvent(=>
                {
                    var 
    ct ChartControl.OwnerChart.ChartTrader;
                    if (
    ct == null) return;

                    
    OnAttach();
                    if (
    Attached == null) return;
                    
    isAttach true;
                    
    initDir IndieValue Close[0] ? -1;
                    var 
    IndieValue;

                    var 
    oType =
                        
    Close[0]
                            ? 
    dir 0
                                
    OrderType.StopMarket
                                
    OrderType.Limit
                            
    dir 0
                                
    OrderType.Limit
                                
    OrderType.StopMarket;

                    var 
    entryOrder =
                        
    account.CreateOrder(
                            
    Instrument
                            
    dir OrderAction.Buy OrderAction.Sell
                            
    oType
                            
    TimeInForce.Day
                            
    ct.Quantity
                            
    v
                            
    null"Entry"null);

                    if (
    ct.AtmStrategy != null)
                        
    AtmStrategy.StartAtmStrategy(ct.AtmStrategyentryOrder);
                    else
                        
    account.Submit(new[] { entryOrder });

                    
    myOrders.Add(entryOrder);

                }, 
    null);
            }&
    #8203; 
    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.
    Emily C.NinjaTrader Customer Service

    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 xiinteractive, 04-09-2024, 08:08 AM
      5 responses
      13 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by swestendorf, Today, 11:14 AM
      2 responses
      5 views
      0 likes
      Last Post NinjaTrader_Kimberly  
      Started by Mupulen, Today, 11:26 AM
      0 responses
      2 views
      0 likes
      Last Post Mupulen
      by Mupulen
       
      Started by Sparkyboy, Today, 10:57 AM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by TheMarlin801, 10-13-2020, 01:40 AM
      21 responses
      3,918 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Working...
      X