Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy not running live

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

    Strategy not running live

    My strategy is not running live. The strategy works when backtesting, but when I set it to live, it does not execute any orders. The strategy is enabled (colored green) and I don't have this issue with other strategy that are running.

    #2
    Hello samish18,

    If the strategy is green that means it is running live, if no trades were placed that is due to the conditions to trade. At this point you would need to use prints to identify what part of your conditions are not becoming true to get a better idea of what is happening.

    You can read about using prints in the following link: https://support.ninjatrader.com/s/ar...language=en_US

    Comment


      #3
      Hello samish18,

      In the attached strategy I don't see that you have added any prints to confirm your conditions are becoming true. That would be the first step in addressing this type of question. Each instrument has different prices which will result in different indicator values. If you applied the strategy and it is green that means its working in realtime and its OnBarUpdate will be called in realtime. We won't be able to tell by the chart or just the code if the conditions are true while its running, you would need to have some kind of output to know it was true or not.

      As an example this would be one way to print for the fist condition you have.


      Code:
      Print(Time[0] + " ema1 " + ema1[0] + " > ema2 " + ema2[0] + " && ema3 " + ema3[0] + " < ema4 " + ema4[0]);
      if (ema1[0] > ema2[0] && ema3[0] < ema4[0]) {EnterLong();}

      When you run the script you should see output for each bar in the output window. you can then see on any specific bar what the values were to know why it was or was not true.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      111 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      60 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      38 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      43 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      79 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X