On both strategies, I have Start behavior set to "Immediately submit".
When enabling the strategies, the conditions are such that both strategies should enter their own short positions.
Both strategies have code that will print when the entry conditions are met.
I can see the entry conditions are met on both strategies, but only the first one that I Enable will trigger an order.
Psuedo code, similar in both strategies:
If (entry conditions are met)
{
Print("Enter Short " + Time[0].ToString());
EnterShort(Convert.ToInt32(PosSize), "");
}
Review the Output window for Strategy 1 (the first strategy I enable):
Enter Short 11:28:27
Enabling NinjaScript strategy 'Strat1/106813811' : On starting a real-time strategy - StartBehavior=ImmediatelySubmit EntryHandling=All entries EntriesPerDirection=2 StopTargetHandling=By strategy position ErrorHandling=Stop strategy, cancel orders, close positions ExitOnSessionClose=False SetOrderQuantityBy=Strategy ConnectionLossHandling=Recalculate DisconnectDelaySeconds=10 CancelEntriesOnStrategyDisable=False CancelExitsOnStrategyDisable=False Calculate=On each tick IsUnmanaged=False MaxRestarts=4 in 5 minutes
NinjaScript strategy 'Strat1/xxxxxxxxx' submitting order
When I enable strategy 2, I get the exact same text in the output window, except it does contain the "submitting order" output.
The result on the Strategies tab in the Control Center is:
Strategy 1: Position: 100s, Account Position, 100s
Strategy 2: Position: 300s, Account Position, 100s
The result I'm trying to achieve is Account Position 400s; both strategies submit their own orders.
I've read many threads on this and seems like the answers vary widely. Any suggestions are appreciated.
Comment