I am developing a strategy which will place two separate orders given a set of entry conditions, the orders will be:
- Order 1: Enter long with 1 contract, a 10 tick stop loss and a 20 tick profit target
- Order 2: Enter long with 1 contract, a 30 tick stop loss and a 100 tick profit target
I am coding this in NinjaScript but I am not able to get the code to execute two orders, the first is placed but the second is ignored.
In OnStateChange() I have...
[INDENT]else if (State == State.Configure)[/INDENT][INDENT=2]{[/INDENT][INDENT=3]SetStopLoss(@"First", CalculationMode.Ticks, 10, false);[/INDENT][INDENT=3]SetProfitTarget(@"First", CalculationMode.Ticks, 20);[/INDENT][INDENT=3]SetStopLoss(@"Second", CalculationMode.Ticks, 30, false);[/INDENT][INDENT=3]SetProfitTarget(@"Second", CalculationMode.Ticks, 100);[/INDENT][INDENT=2]}[/INDENT]
[INDENT]if (entry conditions == true)[/INDENT][INDENT=2]{[/INDENT][INDENT=3]EnterLong(1, @"First");
EnterLong(1, @"Second");[/INDENT][INDENT=2]}[/INDENT]
Many thanks,
Neil

Comment