Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Script doesn't run with historical status
Collapse
X
-
Script doesn't run with historical status
This enclosed script and output windows shows that the historical status is True. But I'm running this script during the day the status can't be historical. Do I have a setting wrong somewhere ?Tags: None
-
This is because the print statement you have is placed just before the return;
Code:if (Historical) { Print("Yep, its this historical thing " ); return; }
This check you have is going to prevent further processing of your calculations but will not stop OnBarUpdate from being called initially.
All these prints you're seeing are on historical data. If you were to place the print after the return or you were to clear the output window and let it run in real time you would not see additional prints
Let me know if I can further assistLanceNinjaTrader Customer Service
-
OK, I changed the Prints and put one before and one after the 'if (historical)'.
The output window shows the first one but not the second, so this must mean that it first processes the historical bars that are on the chart( that's why there's multiple point 1 prints) then it catches up to the current time. But if that's true why doesn't it go on and print the point 2 print ? Hmmm.
Comment
-
This is because return is a programming keyword. It causes a method, OnBarUpdate() in this case, to be exited without further processing.
C# jump statements (break, continue, return, and goto) unconditionally transfer control from the current location to a different statement.
If you're interested getting up an running more quickly with NinjaScript I'd recommend looking into this class we offer: http://www.ninjatrader.com/PremiumEducation.php
Let me know if I can further assist.LanceNinjaTrader Customer Service
Comment
-
Opps, sorry you're right, this script is running. The prints are showing up OK now. Just didn't give it enough time before. Thank you.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by jeronymite, 04-12-2024, 04:26 PM
|
3 responses
39 views
0 likes
|
Last Post
by jeronymite
Today, 10:10 PM
|
||
Started by bill2023, Today, 08:51 AM
|
2 responses
15 views
0 likes
|
Last Post
by bill2023
Today, 10:10 PM
|
||
Started by sidlercom80, 10-28-2023, 08:49 AM
|
167 responses
2,260 views
0 likes
|
Last Post
by jeronymite
Today, 09:54 PM
|
||
Started by warreng86, 11-10-2020, 02:04 PM
|
7 responses
1,362 views
0 likes
|
Last Post Today, 09:41 PM | ||
Started by Perr0Grande, Today, 08:16 PM
|
0 responses
5 views
0 likes
|
Last Post
by Perr0Grande
Today, 08:16 PM
|
Comment