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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      88 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      135 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X