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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      161 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      311 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      245 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      350 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      179 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X