At this time, I am writing duplicate methods, one for each time frame. Do I need to do that?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Multiple time frames and methods.
Collapse
X
-
Multiple time frames and methods.
When a generic class level method is called from OnBarUpdate, with BarsInProgress = 2, for example, does the method also need to identify the BarsInProgress or does it just take that which was active when called?
At this time, I am writing duplicate methods, one for each time frame. Do I need to do that?Tags: None
-
Hello JGRtrader,
Thank you for your reply.
Unless the method contains things that specifically refer to one data series, for example Close[0] would use the close price of whatever data series is currently processing whereas Closes[1][0] would specifically refer to the latest close price of the first added series, then no, you don't need to write duplicates for each time frame as the currently processing data series when the method is called would be the one used in the method.
Please let us know if we may be of further assistance to you.
-
Kate,
Thank you for your clarification
After thinking a about this a bit, it seems I would have to pass the variables, and constants as parameters of the method. This could get messy so it might be better to just go with the separate methods.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
45 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
21 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
31 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
50 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
42 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment