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

Issues Related to Calculate.OnEachTick

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

    Issues Related to Calculate.OnEachTick

    I have developed an unmanaged Strategy that bases all trade entry orders and some trade exit orders on indications from a hosted Indicator that calculates once at the close of each bar. The Strategy currently uses AddDataSeries(BarsPeriodType.Tick, 1) to load a tick data series that is used for intrabar profit-target and stop-loss order management.

    All that seems to work correctly. However, the Indicator needs a large amount of historic data to be able to generate reliable trade indications and downloading a long parallel historic tick data series takes a ridiculous amount of time. Since tick data is only needed during new bars I want to eliminate the tick data series and change the Strategy to Calculate.OnEachTick. If that is done will it be necessary to also change the Indicator to Calculate.OnEachTick, and make suitable modifications to its OnBarUpdate() code to watch for IsFirstTickOfBar and then look back one trade to get bar closing prices, or will NT take of that if the Indicator is left set to Calculate.OnBarClose as it is now?

    #2
    Hello caveat_lector,

    Thank you for your note.

    An indicator hosted within a strategy will use the same calculation mode as the strategy, so without looking at your code for the indicator, it sounds likely that you'd want to modify it to use IsFirstTickOfBar, yes.

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

    Comment


      #3
      Ok, Thanks.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by love2code2trade, 04-17-2024, 01:45 PM
      4 responses
      31 views
      0 likes
      Last Post love2code2trade  
      Started by cls71, Today, 04:45 AM
      2 responses
      10 views
      0 likes
      Last Post eDanny
      by eDanny
       
      Started by proptrade13, Today, 11:06 AM
      0 responses
      2 views
      0 likes
      Last Post proptrade13  
      Started by kulwinder73, Today, 10:31 AM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by RookieTrader, Today, 09:37 AM
      3 responses
      15 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X