Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

plotting a histogram

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

    plotting a histogram

    Hi, in my indicator I plot a historgram. I need to set the values of prior bars on the historgram. I currently set the value of the current bar using 'set' .. how do I reference prior bars using 'set'? thanks

    #2
    Try:
    Set(1, myValue);//previous plot segment
    Set(2, myOtherValue);//Two bars back
    eDanny
    NinjaTrader Ecosystem Vendor - Integrity Traders

    Comment


      #3
      Hello FCatan,
      Code:
       
      [LEFT][FONT=Courier New][SIZE=2]MyValue[[/SIZE]Thank you for your post.
      eDanny has provided an excellent answer.
      I would like to expand on that and include that you could reference prior bars by also using 
      
      
      [FONT=Courier New][SIZE=2][COLOR=#800080]1[/SIZE][/FONT][FONT=Courier New][SIZE=2]] = Close[[/SIZE][/FONT] [FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]] - Open[[/SIZE][/FONT] [FONT=Courier New][SIZE=2][COLOR=#800080]3[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]];[/SIZE][/FONT]
      [FONT=Courier New]MyOtherValue[/FONT][FONT=Courier New][SIZE=2][[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]2[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]] = Close[[/SIZE][/FONT] [FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]] - Open[[/SIZE][/FONT] [FONT=Courier New][SIZE=2][COLOR=#800080]3[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]];[/SIZE][/FONT][/LEFT]

      Also, this example is how this would be implemented using NT8.
      [/FONT][/COLOR]

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      156 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      90 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      140 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      130 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      107 views
      0 likes
      Last Post CarlTrading  
      Working...
      X