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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
67 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
36 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
61 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
62 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
53 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment