Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Series values from indicator as 0 in a Strategy.

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

    Series values from indicator as 0 in a Strategy.

    I have an indicator and a strategy that I am writing to call this indicator and use the values from the indicator. The indicator works as expected and plots on the chart etc. When this indicator is called inside a strategy, I was trying to print the indicator plot/series, but it prints correct values in Historial and always prints 0 in real-time. Not sure what is wrong. Unfortunately I can not export or upload the code.

    #2
    I have an indicator and a strategy that I am writing to call this indicator and use the values from it. The indicator works as expected and plots on the chart, etc. When this indicator is called inside a strategy, I was trying to print the indicator plot/series, but it prints correct values in historial and always prints 0 in real time. I'm not sure what is wrong. Unfortunately, I can not export or upload the code.

    Comment


      #3
      Hello naanku,

      Add debugging prints to understand the behavior. Below is a link to a support article on adding debugging prints to understand behavior.


      Print the time of the bar, the state property. If the plot series is assigned in a logic block, print all values compared in the condition with labels for each value and comparison operator.
      One line below where the plot series is assigned a value, print the time of the bar and the assigned value.

      To assist, I've made a very simple test script that calls an indicator in both historical and real-time and shows the plot value is being assigned (to the bar number) in the indicator in rea-time.
      TestPlotValueStrategy_NT8.zip
      Chelsea B.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      32 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      195 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      356 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      277 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X