I have a strategy that sometimes (not always) fails to execute some commands in case it runs more than on 2-3 stocks at the same time .
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
best practice - considering multiple strategy instances
Collapse
X
-
best practice - considering multiple strategy instances
is there a best practice rules in writing the strategy with consideration that it will be running simultaneously with different stock ?
I have a strategy that sometimes (not always) fails to execute some commands in case it runs more than on 2-3 stocks at the same time .
Tags: None
-
Hi dadarara, thanks for posting.
Strategy instances are independent of each other. The best way to find out what a strategy is doing is to use Prints throughout OnBarUpdate to see if its reaching its conditions or not e.g.
if(<condition to trade>)
{
Print("Condition Reached " + Time[0]);
}
More documentation here:
Kind regards,
-ChrisL
-
Thanks Chris
I have multitude of Print commands , this doesn't help.
because for example I see the print that notify me that the order was sent ( the code has submit the order) but I dont see any order active. the OnOrderUpdate is not triggered at all.
what I mean is that I dont experience a particular problem in logic of the strategy. if I run it as one instance on one stock, it works great no issues.
but if I run it on two different stocks than the problems start .
I am not very experienced programmer, so I was thinking in the direction of variables declaration , private public functions etc..
and thats why I asked if there are some specific rules that I need to follow in case that I want to run the same strategy several times simultaneously.
Comment
-
Hi dadarara,
First, turn on TraceOrders = true; within State.SetDefaults and monitor the output window for any ignored orders. Running the strategy on two different instruments at the same time should not cause any issue, and a position on one instrument would not cause an order on a different instrument to be ignored. Please send me your log and trace files to scriptingsupport at ninjatrader.com as well:
You can do this by going to the Control Center-> Help-> Email Support
Ensuring 'Log and Trace Files' is checked will include these files. This is checked by default.
Please reference the following ticket number in the body of the email: 3219584 Attn ChrisL
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
93 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
138 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
68 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
123 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
73 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment