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 kaywai, Today, 06:26 AM
      1 response
      3 views
      0 likes
      Last Post kaywai
      by kaywai
       
      Started by ct, 05-07-2023, 12:31 PM
      6 responses
      202 views
      0 likes
      Last Post wisconsinpat  
      Started by kevinenergy, 02-17-2023, 12:42 PM
      118 responses
      2,779 views
      1 like
      Last Post kevinenergy  
      Started by briansaul, Today, 05:31 AM
      0 responses
      9 views
      0 likes
      Last Post briansaul  
      Started by traderqz, Yesterday, 12:06 AM
      11 responses
      28 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X