I searched across the manuals and forum, but do not catch: why to remove bar, if we can update all it's prices and volume instead?
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
RemoveLastBar() vs UpdateBar()
Collapse
X
-
RemoveLastBar() vs UpdateBar()
Hello.
I searched across the manuals and forum, but do not catch: why to remove bar, if we can update all it's prices and volume instead?
Tags: None
-
Thanks a lot, Chris!
One of the most clear answers ever!
I
Am I clearly understand, that AddBar() impact all all scripts, using this bars series:
1. Triggers OnBarUpdate() for scripts Calculated.OrBarClose.
2. Increment CurrentBar index.
3. Set IsFirstTickOfBar to true.
4. Something else....
?
Comment
-
Hi fx.practic, thanks for the follow-up.
1. Yes, AddBar will trigger the OnBarUpdate method for all scripts running on the bar series.
2. Yes, AddBar will increment CurrentBar.
3. AddBar will set IsFirstTickOfBar to true in a Calculate.OnEachTick or Calculate.OnPriceChange script only.
Kind regards,
ChrisLChris L.NinjaTrader Customer Service
Comment
-
And what if to RemoveLastBar() without adding new one - does it triggers any events?
Comment
-
Hi fx.practic, thanks for your reply.
If one calls RemoveLastBar they are mostly always going to call AddBar right after to update the bar with new values. One would need to make a test script and see exactly what events trigger.
Please let me know if I can assist any further.Chris L.NinjaTrader Customer Service
Comment
-
Thank you, Chris.
Once more question: why RemoveLastBar(), why not UpdateBar() with ability updating Open price?
Is there any reason for current design?
Comment
-
Hi fx.practic, thanks for your patience.
UpdateBar() is intended to change values of a bar that change over time and the open price obviously doesn't do this normally. The Renko and LineBreak bars are the only defaults that would need to change their open price. I can submit a feature request to request the ability to change the open price of a bar through UpdateBar.
Please let me know if I can assist any further.
Chris L.NinjaTrader Customer Service
Comment
-
Please, don't.
I've just asked to be familiar with general logic.
I'd wish to save development resource for something really useful.
Thanks again, Chris.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by PaulMohn, Today, 12:36 PM
|
2 responses
16 views
0 likes
|
Last Post
by PaulMohn
Today, 01:48 PM
|
||
Started by Conceptzx, 10-11-2022, 06:38 AM
|
2 responses
53 views
0 likes
|
Last Post
by PhillT
Today, 01:47 PM
|
||
Started by Kaledus, Today, 01:29 PM
|
0 responses
4 views
0 likes
|
Last Post
by Kaledus
Today, 01:29 PM
|
||
Started by yertle, Yesterday, 08:38 AM
|
8 responses
37 views
0 likes
|
Last Post
by ryjoga
Today, 01:22 PM
|
||
Started by rdtdale, Today, 01:02 PM
|
1 response
6 views
0 likes
|
Last Post Today, 01:13 PM |
Comment