Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

How do you access the end of the last Bar data when using Calculate.OnEachTick?

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

    How do you access the end of the last Bar data when using Calculate.OnEachTick?

    If I'm using Calculate.OnEachTick, Close[1] references the close of the last tick, right?

    If so, do I need to create a custom data series to track what would be the normal "OnBarClose" Closes?


    #2
    Hello torch2k,

    Thank you for your post.

    If you are using a 1 tick data series, Close[1] would be the close of the tick previous to the current tick.

    If you are using, say, a 1 minute data series, Close[1] would refer to the close of the previous 1 minute bar to the one currently forming if you are using Calculate.OnEachTick. Close[0] would be the current price of the forming bar, based on the tick it's calculating on.

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Kate View Post
      Hello torch2k,

      Thank you for your post.

      If you are using a 1 tick data series, Close[1] would be the close of the tick previous to the current tick.

      If you are using, say, a 1 minute data series, Close[1] would refer to the close of the previous 1 minute bar to the one currently forming if you are using Calculate.OnEachTick. Close[0] would be the current price of the forming bar, based on the tick it's calculating on.

      Please let us know if we may be of further assistance to you.

      Oh, thanks! Glad I asked because I had that totally backwards in my head.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by aligator, 01-06-2022, 12:14 PM
      4 responses
      237 views
      0 likes
      Last Post john_44573  
      Started by reynoldsn, Today, 05:56 PM
      0 responses
      8 views
      0 likes
      Last Post reynoldsn  
      Started by bortz, 11-06-2023, 08:04 AM
      51 responses
      1,990 views
      0 likes
      Last Post aligator  
      Started by dmking, 11-12-2019, 12:31 PM
      4 responses
      4,152 views
      0 likes
      Last Post jasonw
      by jasonw
       
      Started by roblogic, Today, 04:31 PM
      0 responses
      11 views
      0 likes
      Last Post roblogic  
      Working...
      X