• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Plotting in "future" ...

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

    Plotting in "future" ...

    Hello,
    In my indicator, when executing OnBarUpdate(), I catch some values for plotting. However I don’t want to plot these value at Value[0] (or something like at Value[0+k]). The location (bar index) of the bar where I want to plot the values, hasn’t yet been reach in OnBarUpdate() at that point.

    1. Do I have to wait for CurrentBar to reach the bar index I’m waiting for, and then do Value[0] = … or
    2. .. can I do something like Value(myOwnBarIndex) = …

    Thank you/Anders

    #2
    Hello AndBro,

    Thank you for your post.

    You would use a negative index, for example:
    • Plot0[-5] = Close[0]; // this would set the Close value to the plot 5 bars later.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Hello Patrick, I tried to use a negative “barsago”, it did compile but I got a runtime error. Anyway, I found out a very simple solution and just wait for CurrentBar to reach a certain value, and then I do the plotting.
      My problem is solved, and we can drop this issue now. Thank you. /Anders

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by RB104, Today, 06:06 PM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_ShawnB  
      Started by jtrading82, 05-25-2018, 09:59 AM
      9 responses
      978 views
      0 likes
      Last Post NinjaTrader_ShawnB  
      Started by syxforex, Today, 12:11 AM
      2 responses
      15 views
      0 likes
      Last Post syxforex  
      Started by aslane, Today, 02:31 PM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_Kate  
      Started by stoner, 10-16-2019, 01:38 PM
      5 responses
      53 views
      0 likes
      Last Post sledge
      by sledge
       
      Working...
      X