Am I a senior member now because I am subscribing to real time data?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
yesterday's OHLC when using one minute bars?
Collapse
X
-
yesterday's OHLC when using one minute bars?
Can I calculate yesterday's OHLC when using one minute bars with the intention of using those values for today's 24 hour calcs? If so, how?
Am I a senior member now because I am subscribing to real time data?Tags: None
-
Hello joemiller,
Thank you for your post.
You can use GetDayBar() to pull the previous session's OHLC. For information on GetDayBar() please visit the following link: http://www.ninjatrader.com/support/h.../getdaybar.htm
The Senior Member is not based on your data feed provider or License Key, it should be based on your Join Date and Posts count.
Please let me know if I may be of further assistance.
-
last bar of a session?
I want to write to the output window on the last bar of a session. I have found a FirstBarOfSession function in the user guide but cannot find a LastBarOfSession function.
such a capability must be out there somewhere...please advise.
Comment
-
LastBarOfSession??????
A search for LastBarOfSession in the Userguide results in 'No results found.' The same search on this Forum is productive! So for now I will use the Forum search hits as my reference resource if I have a problem trying to resolve my issue.
Comment
-
final day or bar of a strategy analysis?
I need a function that tells me when I am on the final day or bar of a strategy analysis.
I have discovered that I don't want LastBarOfSession. instead I need something like maybe OnTermination().
I will continue to experiment. In the meantime any suggestions/insights will be much appreciated.
Comment
-
Hello,
OnTermination will only be called when you turn off the strategy.
If you want to know if you're on the last bar of the strategy, you can use the Count function to count the number of bars on the chart/strategy:
Then you can compare your CurrentBar to your Count variable and that should let you know when you're on the final bar.
I'm including a link to our Alphabetical Reference list to help you find some functions you were not able to search for:
MatthewNinjaTrader Product Management
Comment
-
I have defined count in the variables region as: publicint count;
I have the following 'if' statement in the
OnBarUpdate region:
if (CurrentBar == Count) //jm count is total number of bars.
Print(" 'if (CurrentBar == Count)' TEST MSG");
nothing appears in the output window
maybe I need to initialize 'count' but I have not been able to?
the strategy code is attached.
please advise.
Attached Files
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
633 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
364 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
567 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
568 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment