Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaTrader Not Sending Orders

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

    NinjaTrader Not Sending Orders

    Hello NinjaTrader Support,

    This is the issue that I facing.

    Account Type: SIM
    Trading: Forex
    NinjaTrader: 7.0.1000.30, 64-bit

    Issue:
    I have notice that Orders are simply not being send\Executed during testing of my automated strategy. This is not observed during the historical testing, only when the Strategy is running in live mode
    To make sure that I am not gone Mad, I decided to verify that.

    This is the code that I using

    string tempPostionDirection;
    int tempSize;

    if (Position.MarketPosition == MarketPosition.Long)
    {
    tempPostionDirection =
    "Long";
    }
    else
    {
    tempPostionDirection =
    "Short";
    }
    int Position_Multiplier = 1;
    if (Position.MarketPosition == MarketPosition.Short)
    Position_Multiplier = -
    1;
    if (globalPositionSize > 0 && (Position.Quantity != Math.Abs(globalPositionSize) || Position.MarketPosition != MarketPosition.Long) )
    {
    tempSize = Convert.ToInt32(globalPositionSize - Position.Quantity*Position_Multiplier);
    WriteToLog(path_folder+path_temp_file,
    "SIZE CORRECTION. globalPositionSize: " + globalPositionSize + ". Position.Quantity: " + Position.Quantity + ".Position.MarketPosition: " + Position.MarketPosition + ".TempSize: " + tempSize);
    if (tempSize > 0)
    EnterLong(tempSize);
    else
    ExitLong(-tempSize);
    return;
    }


    WriteToLog - is a simple function that I wrote that outputs some messages.

    Sure enough -> I got constantly messages from the WriteToLog function:
    20160211 72516,SIZE CORRECTION. globalPositionSize: 10. Position.Quantity: 30.Position.MarketPosition: Long. TempSize: -20
    But EnterLong/ExitLong Order did not work.

    Can you let me know if there any additional debugging do I need to turn on to figure out why it is not sending any Orders?

    #2
    Hello,
    To find out more information on why the orders are not submitting I would recommend to use TraceOrders.
    Please see the following link on using TraceOrders for debugging: http://ninjatrader.com/support/forum...ead.php?t=3627
    Cody B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_CodyB View Post
      Hello,
      To find out more information on why the orders are not submitting I would recommend to use TraceOrders.
      Please see the following link on using TraceOrders for debugging: http://ninjatrader.com/support/forum...ead.php?t=3627
      That did not do anything

      I added the following:
      //Tracing orders
      TraceOrders = true;
      into Initialize()

      Compiled the code, restart the strategy.

      This morning the Order again did not executed. I don't see anything in the traces either.

      Comment


        #4
        Hello,
        Can you verify nothing printed to the output window with TraceOrder set to true?
        You can access the Output Window by going to Tools> Output Window.
        Cody B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_CodyB View Post
          Hello,
          Can you verify nothing printed to the output window with TraceOrder set to true?
          You can access the Output Window by going to Tools> Output Window.
          Yes, I confirm:
          for the time that the order was send -> nothing is recorded in the Trace/Logs even when TraceOrder is set to true

          I opened the Tools -> Output Window, right now it is blank. Will wait if anything pops up.

          Comment


            #6
            Hello,
            TraceOrders does not print out to the log and trace file. TraceOrders will print out to the Output Window. Please have the Output Window open and reload your strategy.
            Cody B.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_CodyB View Post
              Hello,
              TraceOrders does not print out to the log and trace file. TraceOrders will print out to the Output Window. Please have the Output Window open and reload your strategy.
              ok thanks
              It was not clear

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              74 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              45 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              26 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              32 views
              0 likes
              Last Post TheRealMorford  
              Started by Mindset, 02-28-2026, 06:16 AM
              0 responses
              62 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X