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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
46 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
22 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
31 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
50 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
42 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment