When running the strategy analyzer and printing the date to the output window at every entry to onbarupdate, I expected dates to appear for every day and only once and then the run would cease ... sequentially from time frame start to end date. However the start to end date cycle is repeated, accompanied by a few other additional confusing aspects. I can live with it but would like to know why.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Strategy Analyzer appears to recycle from start to end date?
Collapse
X
-
Strategy Analyzer appears to recycle from start to end date?
Why does the following happen?
When running the strategy analyzer and printing the date to the output window at every entry to onbarupdate, I expected dates to appear for every day and only once and then the run would cease ... sequentially from time frame start to end date. However the start to end date cycle is repeated, accompanied by a few other additional confusing aspects. I can live with it but would like to know why.
Tags: None
-
for the indicator---
public string format1="MM/dd/yyyy HH:mm";
public string format2="HH:mm";
Print("entered LV3indicator OnBarUpdate"
+" "+Time[0].ToString(format1)
+"//"+Time[0].ToString(format2)
+" "+Time[0].DayOfWeek);
for the strategy---
public string format1="MM/dd/yyyy HH:mm";
public string format2="HH:mm";
Print("entered LV3strategy OnBarUpdate"
+" "+Time[0].ToString(format1)
+"//"+Time[0].ToString(format2)
+" "+Time[0].DayOfWeek);
Comment
-
Thanks. Which timeframe are you testing on? OnBarUpdate() is called for each bar, so each bar in the day will trigger this print then. To see the sequence better, add for example the CurrentBar processed info in -
Print("entered LV3strategy OnBarUpdate" +" Bar " + CurrentBar + " " +Time[0].ToString(format1) +"//"+Time[0].ToString(format2) +" "+Time[0].DayOfWeek);BertrandNinjaTrader Customer Service
Comment
-
the time frame is one day however the indicator [written for me by Lance] works with two time frames to make getdaybar work the way I want it to. I have no idea how or what he did. but it does not seem like that would cause the recycling thru the start/stop time frame window.
see attachments
Comment
-
Would the strategy use an additional timeframe internally? If it did then your print would be called for each series, thus duplicate calls could be expected for this print. You could filter that with BarsInProgress to only have the primary for example hit this condition.
BertrandNinjaTrader Customer Service
Comment
-
per post #1
"Why does the following happen?
When running the strategy analyzer and printing the date to the output window at every entry to onbarupdate, I expected dates to appear for every day and only once and then the run would cease ... sequentially from time frame start to end date. However the start to end date cycle is repeated, accompanied by a few other additional confusing aspects. I can live with it but would like to know why."
so I think I understand that duplicate calls should be expected as the analyzer run progresses. my question is ... why does the analyzer run from start date to end date, and then repeats that cycle?
Comment
-
duplicate calls make sense to me, no prob there. that is not my concern. I just still don't understand why the analyzer runs from start date to end date more than once? but no matter, I think the print to output window as it is will serve my debugging/checking/tracing purposes.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by andrewtrades, Today, 04:57 PM
|
1 response
5 views
0 likes
|
Last Post Today, 05:02 PM | ||
Started by chbruno, Today, 04:10 PM
|
0 responses
3 views
0 likes
|
Last Post
by chbruno
Today, 04:10 PM
|
||
Started by josh18955, 03-25-2023, 11:16 AM
|
6 responses
436 views
0 likes
|
Last Post
by Delerium
Today, 03:42 PM
|
||
Started by FAQtrader, Today, 03:35 PM
|
0 responses
6 views
0 likes
|
Last Post
by FAQtrader
Today, 03:35 PM
|
||
Started by rocketman7, Today, 09:41 AM
|
5 responses
19 views
0 likes
|
Last Post Today, 03:33 PM |
Comment