Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Defect with onBarUpdate
Collapse
X
-
Defect with onBarUpdate
Title is bit misleading. The issue appears to be design related. When two strategies have same interval such as 1 tick, one gets called after another one completes like maybe in a loop inside a single thread. This poses an issue as in now they both move in lockstep so the faster strategy is stuck with the lowest common denominator and its onbarupdate falls behind waiting for other to complete. This should have never occurred. Correct design would have been to launch separate thread for each strategy and have no dependency whatsoever. Instead NT says whenever that interval such as 1 tick elapsed, let me call onBarUpdate of these two strategies one after another.Tags: None
-
To sledge, this occurs in both live and replay. Former can be few minutes right off the bat and latter can be in hours if speed is increased.
Jess, here is what I would do if I were you.
1. Create a slow strategy A with say some pseudo code like this inside onBarUpdate or put sleep on it
Print(Time[0]+Close[0]);
Try
{
Task run (async =>
{
Var t = sendtoslowmsgqueasync(tickdata);
Await t;
}
Task.wait();
}
Catch (objectdisposed)
{
}
2. Create fast strategy B with following pseudo code in onBarUpdate
Print(Time[0]+Close[0]);
Sendtoadifferentfastmsgque(tickdata)
3. Goto strategies tab and add these two strategies for 1 tick. Start and see both slow down but remain in lock step. B is now hobbled despite no delays. For instance if u are doing
For (interval i= 1 tick)
Call strategy A
Call strategy B
4. Now remove strategy A and add it back in for 1 second but keep B at 1 tick. You will see strategy B look alive and A as well since it wont have trouble completing in 1 sec. So the logic may look something like
For 1 tick call B
For 1 sec call A or all those that have same interval.
5. I would talk to Josh and loop in Ray and Dierk. If Ray has a chat with developer, report back on the details.Last edited by tradejockey; 04-06-2016, 07:16 PM.
Comment
-
Hello,
Thank you for the details.
I could try to piece the strategies together by what is provided, but if you could just provide the actual samples that would be better to ensure I test exactly what you are to see the same result. For bug reports accuracy is key in finding the answer.
I will attempt to test what is provided today, if I am unable to see the same result I will reply back. In the meantime if you could upload an exported sample from the platform that demonstrates this that would be much better.
I look forward to being of further assistance.JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by GussJ, 03-04-2020, 03:11 PM
|
16 responses
3,281 views
0 likes
|
Last Post
by Leafcutter
Today, 04:14 PM
|
||
Started by WHICKED, Today, 12:45 PM
|
2 responses
19 views
0 likes
|
Last Post
by WHICKED
Today, 03:36 PM
|
||
Started by Tim-c, Today, 02:10 PM
|
1 response
9 views
0 likes
|
Last Post Today, 02:52 PM | ||
Started by Taddypole, Today, 02:47 PM
|
0 responses
5 views
0 likes
|
Last Post
by Taddypole
Today, 02:47 PM
|
||
Started by chbruno, 04-24-2024, 04:10 PM
|
4 responses
53 views
0 likes
|
Last Post
by chbruno
Today, 02:38 PM
|
Comment