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?
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!
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
NinjaTrader
Issues Related to Calculate.OnEachTick
Collapse
X
-
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?Tags: None
-
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
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by lucasmelo152, 06-28-2021, 12:51 PM
|
8 responses
2,123 views
0 likes
|
Last Post
by Ymcapital
Today, 04:31 PM
|
||
Started by Creamers, 04-27-2024, 05:32 AM
|
11 responses
68 views
0 likes
|
Last Post
by Creamers
Today, 04:30 PM
|
||
Started by NM_eFe, 04-30-2024, 06:14 AM
|
5 responses
30 views
0 likes
|
Last Post
by NM_eFe
Today, 04:28 PM
|
||
Started by Jonker, 04-27-2024, 01:19 PM
|
2 responses
20 views
0 likes
|
Last Post
by Jonker
Today, 04:25 PM
|
||
Started by Max Baxter, 03-07-2019, 09:20 PM
|
8 responses
266 views
0 likes
|
Last Post
by Ymcapital
Today, 04:17 PM
|
Comment