I am having a very frustrating time getting more than one stoploss or profit target to be activated. I have created a a test strategy to try and solve this issue and it has come pretty close but with no consistency, I need to when working apply this to a real strategy which has the same issue..
I am creating 2 entry orders of 1 lot each, there then should be 2 stoploss entries with unique signal name and 2 profit target orders again with unique signal names.
I have observed that both entries are done correctly but when setting the SL and PT orders I have seen the following, from a PRINT statement:
B stopOrder = orderId='a6558f00d4684659b8dd529d2db716dd' account='Sim101' name='Stop' orderState=Submitted instrument='GBPUSD' orderAction=Sell orderType='Stop Market' limitPrice=0 stopPrice=1.29184 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=252 time='2017-05-11 12:42:26' gtd='2099-12-01' statementDate='2017-05-11'
B targetOrder = orderId='ccbd6b1e8ae7435493bc9b2169fc24cd' account='Sim101' name='Target' orderState=Submitted instrument='GBPUSD' orderAction=Sell orderType='Limit' limitPrice=1.29244 stopPrice=0 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=253 time='2017-05-11 12:42:26' gtd='2099-12-01' statementDate='2017-05-11'
B stopOrder2 =
B targetOrder2 =
*******************************
These all follow one after the other and as you can see the first orders are fine but the other 2 are not "actioned". I have then seen it on a different entry where it activates all stoploss and profit target orders, but never from the first entry order, as below....
B stopOrder = orderId='551f0ea2a0024ef8a1d6c0733b284440' account='Sim101' name='Stop' orderState=Submitted instrument='GBPUSD' orderAction=Sell orderType='Stop Market' limitPrice=0 stopPrice=1.29228 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=268 time='2017-05-11 12:54:47' gtd='2099-12-01' statementDate='2017-05-11'
B targetOrder = orderId='3085591385d3497cb54b4a5c81adcbcd' account='Sim101' name='Target' orderState=Submitted instrument='GBPUSD' orderAction=Sell orderType='Limit' limitPrice=1.29288 stopPrice=0 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=269 time='2017-05-11 12:54:47' gtd='2099-12-01' statementDate='2017-05-11'
B stopOrder2 =
B targetOrder2 =
B stopOrder = orderId='551f0ea2a0024ef8a1d6c0733b284440' account='Sim101' name='Stop' orderState=ChangeSubmitted instrument='GBPUSD' orderAction=Sell orderType='Stop Market' limitPrice=0 stopPrice=1.29245 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=268 time='2017-05-11 12:55:14' gtd='2099-12-01' statementDate='2017-05-11'
B targetOrder = orderId='3085591385d3497cb54b4a5c81adcbcd' account='Sim101' name='Target' orderState=ChangeSubmitted instrument='GBPUSD' orderAction=Sell orderType='Limit' limitPrice=1.29305 stopPrice=0 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=269 time='2017-05-11 12:55:14' gtd='2099-12-01' statementDate='2017-05-11'
B stopOrder2 = orderId='3fc2f1f6d3be48ad80f02f5fcb6caa03' account='Sim101' name='Stop2' orderState=Submitted instrument='GBPUSD' orderAction=Sell orderType='Stop Market' limitPrice=0 stopPrice=1.29245 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=272 time='2017-05-11 12:55:14' gtd='2099-12-01' statementDate='2017-05-11'
B targetOrder2 = orderId='b384424293474b4b956c93adb111b9d3' account='Sim101' name='Target2' orderState=Submitted instrument='GBPUSD' orderAction=Sell orderType='Limit' limitPrice=1.29325 stopPrice=0 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=273 time='2017-05-11 12:55:14' gtd='2099-12-01' statementDate='2017-05-11'
I have also set the entries per direction up to 6 and 10 with unique entries, option, because I am running out of ideas to solve it.
I have attached the test code strategy and any help will be greatly appreciated.
Thanks
Comment