Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to access tick-by-tick data in a historical data?
Collapse
X
-
How to access tick-by-tick data in a historical data?
Everyday I woke up and start an strategy I have in my NT7, it works fine and I got the data I need in a tick-by-tick basis for I am running on real time feed, problem is I need to access the tick-by-tick data of yesterday and once I stop my script I no longer have that info. I saw NinjaTrader have the data for I can see it in the Historical Data Manager Window, how can i do it in a Strategy script?Tags: None
-
Hello rstriquer,
Thank you for writing in.
If you wish for your script to access historical tick data, you will need to add a secondary tick series to your script.
More information about working with scripts with multiple series can be found here: https://ninjatrader.com/support/help...nstruments.htm
Please, let us know if we may be of further assistance.Zachary G.NinjaTrader Customer Service
-
It does not work, lets say I do this ...
If I am working on a real time data the Close[0] delivers me data every tick, but whenever I am working on Historical data it gets me only the last tick data of the bar. How can I get the "intra data" of the bar on a historical bar?Code:protected override void Initialize() { CalculateOnBarClose = false; } protected override void OnBarUpdate() { if (!Historical) { Print(Close[0]); } }
Comment
-
Hello,
Thank you for the reply.
As Zachary posted, you would need to add a 1 tick secondary series to see intrabar data historically.
There is a sample here: http://ninjatrader.com/support/forum...ead.php?t=6652
Additionally there is a sample strategy called SampleMultiTimeFrame that comes with the platform, this sample demonstrates adding a secondary series and limiting the logic to the BarsInProgress index.
Close[0] specifically will always return the last Closed bars value of the Primary series being processed. This would entail that if you were on a 5 minute series, this would either report the last 5 minute closed bar, or each Tick in realtime with COBC = false. Historically this would not make a difference, instead you could Add a secondary series and use the BarsInProgress index to delegate logic. using the secondary series you could see OnBarUpdate called for each tick of the 1 tick series to do logic.
I look forward to being of further assistance.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
104 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
52 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
34 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
38 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
74 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment