Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator plot

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

    Indicator plot

    I tried to build a simple indicator using current bar and 3 bars ago. However, I don't get any plot display in the Charts window. Compile was clean.

    The code snippet looks something like:

    Plot0.Set(SMA(34)[0]/SMA(34)[3]);

    It works if I remove "SMA(34)[3]".

    #2
    Hello,


    Please note that the value that will be plotted will be near 1 since SMA(34)[0] will likely be close to the value of SMA(34)[3]; therefore you will need to plot something like this on a lower panel (not on the price panel) as the price you have on the chart is not likely to be around the value of 1. To plot on the price chart you will want to keep your values very near the current price.

    To get the value to plot on the lower panel please change Overlay = true; to false in the Initialize() block of your code.

    This link will help with this:


    To get the value to plot on price you will need to come up with some other calculation that returns a value near the current price.

    Also, be sure that you have if(CurrentBar < 3) return; at the beginning of your OnBarUpdate() code block. This link will help:
    DenNinjaTrader Customer Service

    Comment


      #3
      Thank you, Ben.
      I will make these changes and give a try.
      In the plot parameter window, I did specify Panel3. Not sure if
      this makes the Overlay=false in the code.
      I will double check.

      Thanks,

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      593 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      343 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      556 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      554 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X