![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Jul 2012
Posts: 158
Thanks: 28
Thanked 4 times in 4 posts
|
Historical returns true when using Zen-Fire demo connection in real-time. Why is that?
Until now, I have managed to get a false out of it only by using the Market Replay and deleting data history prior to the stream. |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,415
Thanks: 252
Thanked 978 times in 961 posts
|
Do you test from an indicator or strategy?
Single series or MultiSeries setup? Thanks,
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Jul 2012
Posts: 158
Thanks: 28
Thanked 4 times in 4 posts
|
Single series indicator.
I put the if (Historical) return; at the OBU so when I load the indicator it won't have to iterate all existing bars and instead it will call OBU at each close of a present bar. |
|
|
|
|
|
#4 | |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,415
Thanks: 252
Thanked 978 times in 961 posts
|
Quote:
How do you check for the historical condition in your code?
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Jul 2012
Posts: 158
Thanks: 28
Thanked 4 times in 4 posts
|
OnBarUpdate()
{ if (Historical) { ClearOutputWindow(); Print("Historical data found."); return; } *rest of the code* } |
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,415
Thanks: 252
Thanked 978 times in 961 posts
|
You will see then prints for Historical data of course with this setup. As the OnBarUpdate() runs through the historical chart portion as well before hitting live data.
Try something like - if (Historical) return; Print(Historical);
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Jul 2012
Posts: 158
Thanks: 28
Thanked 4 times in 4 posts
|
Of course. The thing is that when reaching the real-time bar, it keeps printing and it doesn't executes the code. I waited more for than 3 new bars to be created.
|
|
|
|
|
|
#8 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,415
Thanks: 252
Thanked 978 times in 961 posts
|
So what does it print then? True or false?
Bertrand
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Bertrand for this post: |
|
|
|
#9 |
|
Senior Member
Join Date: Jul 2012
Posts: 158
Thanks: 28
Thanked 4 times in 4 posts
|
Damn...
Never mind, you were right. It's working now. |
|
|
|
|
The following user says thank you to savekad for this post: |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Historical data persists after deleting from historical data manager? | llstelle | Miscellaneous Support | 1 | 03-25-2012 06:35 PM |
| Differences in data: GAIN live, GAIN historical, NT historical | terenyi | Connecting | 2 | 01-12-2010 06:15 PM |