Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Data from previous bars

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

    Data from previous bars

    Hello everyone....I'm tinkering around with custom indicators, and I've been working in forex on 1 second charts....using the Level 1 tutorial concerning "Using Price Variables" the formula is shown:

    Plot0.Set(Open[0] == Close[0] ? 1 : 0);

    I want to set up something like this:

    Plot0.Set(Open[120] >= Close[55] ? 1 : 0)
    Plot1.Set(Open[120] < Close[55] ? 1 : 0)

    Works well, but when I change "Open[0]" to anything more than "Open[1]" it just doesn't work...The little popup mentions that the number in the brackets represents "bars ago", so why won't it work

    Thanks,

    Jeff

    #2
    You are running into the issue outlined in this tip: http://www.ninjatrader-support.com/v...ead.php?t=3170
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by Josh View Post
      You are running into the issue outlined in this tip: http://www.ninjatrader-support.com/v...ead.php?t=3170
      Thank you VERY much for your prompt reply...the math.min option worked very well!

      Thanks...NT is great!

      Jeff

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      40 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      20 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      26 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      44 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      37 views
      0 likes
      Last Post CarlTrading  
      Working...
      X