Again, this is way beyond what we provide support for. At this point we will stop contributing to this thread. May be the community wanted to step in?!?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Multiple OnBarUpdate active
Collapse
X
-
This depends on your code in OnBarUpdate. In case it would return control to the windows event loop (not possible through any of the documented NinjaScript methods) then you could experience OnBarUpdate being called before the prior call return control.
Again, this is way beyond what we provide support for. At this point we will stop contributing to this thread. May be the community wanted to step in?!?
-
Hallo Andreas,
had a look at your OnBarUpdate code example with the thread. Wouldn't it be better to start the tread conditionally, i.e. once per minute?
Imagine, OnBarUpdate is called several times per second under real time conditions and every invocation would run at least 5 seconds (caused by the sleep). That would build up a huge queue of pending OnBarUpdate events very rapidely.
Regards
Ralph
Comment
-
Hello Ralph,
actually the code presented by me in this thread was never meant to be used in a real strategy. I just wrote this code snipped to find out how OnBarUpDate() behaves and especially if it might happen that more than one OnBarUpdate() could be active (for a given strategy only).
seems though that NT waits for OnBarUpdate() to return before it is called again.
My real problem is in this thread where I suspect
abnormal behaviour of SetProfitTarget, as during my trading I got errors with invalid orders.
I do not understand yet what happens there.
Using Sim01 Account these errors do not show up.
More tomorrow when I can log real trades.
andreas
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
558 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
324 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 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
545 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
547 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment