Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Limits on Entry Signal name? (blank FromEntrySignal)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Limits on Entry Signal name? (blank FromEntrySignal)

    I'm having an issue with an order object's FromEntrySignal always being empty. I use the EnterFoo(int barsInProgressIndex, int quantity, string signalName) methods to enter trades, and my signalName looks like "2018-01-16_13:14:54.113_RSTOC_S0" When a stop loss exit is triggered, the order's fromEntrySignal is always blank. I also can't set SetStopLoss() for a trade by signal name, only for all trades. I don't see any errors, but the call to SetStopLoss with signalName looks to be ignored.

    Additionally, I've been trying to match executions using other parameters and have noticed the Oco parameter after an exit on session close contains the exit on session close orderId, rather than the orderId for the order that opened the position.

    Dump of consecutive execution.Order objects from OnExecutionUpdate()

    Code:
    YM-Range4,2018-01-16,13:14:54.113,17,Execution,orderId='NT-00314-646' account='Sim101' name='2018-01-16_13:14:54.113_RSTOC_S0' orderState=Filled instrument='YM 03-20' orderAction=SellShort orderType='Market' limitPrice=0 stopPrice=0 quantity=1 tif=Gtc oco='' filled=1 averageFillPrice=25908 onBehalfOf='' id=-1 time='2018-01-16 13:14:54' gtd='2099-12-01' statementDate='2019-12-17'
    YM-Range4,2018-01-16,13:30:00.003,17,Execution,orderId='NT-00315-646' account='Sim101' name='Stop loss' orderState=Filled instrument='YM 03-20' orderAction=BuyToCover orderType='Stop Market' limitPrice=0 stopPrice=25917 quantity=1 tif=Gtc oco='NT-00314-646' filled=1 averageFillPrice=25917 onBehalfOf='' id=-1 time='2018-01-16 13:14:54' gtd='2099-12-01' statementDate='2019-12-17'
    
    YM-Range4,2018-01-16,13:48:43.128,17,Execution,orderId='NT-00316-646' account='Sim101' name='2018-01-16_13:48:43.128_RSTOC_S0' orderState=Filled instrument='YM 03-20' orderAction=SellShort orderType='Market' limitPrice=0 stopPrice=0 quantity=1 tif=Gtc oco='' filled=1 averageFillPrice=25932 onBehalfOf='' id=-1 time='2018-01-16 13:48:43' gtd='2099-12-01' statementDate='2019-12-17'
    YM-Range4,2018-01-16,13:59:59.640,17,Execution,orderId='NT-00318-646' account='Sim101' name='Exit on session close' orderState=Filled instrument='YM 03-20' orderAction=BuyToCover orderType='Market' limitPrice=0 stopPrice=0 quantity=1 tif=Gtc oco='' filled=1 averageFillPrice=25926 onBehalfOf='' id=-1 time='2018-01-16 13:59:59' gtd='2099-12-01' statementDate='2019-12-17'
    
    YM-Range4,2018-01-16,16:08:51.792,17,Execution,orderId='NT-00319-646' account='Sim101' name='2018-01-16_16:08:51.792_RSTOC_S0' orderState=Filled instrument='YM 03-20' orderAction=SellShort orderType='Market' limitPrice=0 stopPrice=0 quantity=1 tif=Gtc oco='' filled=1 averageFillPrice=25929 onBehalfOf='' id=-1 time='2018-01-16 16:08:51' gtd='2099-12-01' statementDate='2019-12-17'
    YM-Range4,2018-01-16,16:16:35.789,17,Execution,orderId='NT-00320-646' account='Sim101' name='Stop loss' orderState=Filled instrument='YM 03-20' orderAction=BuyToCover orderType='Stop Market' limitPrice=0 stopPrice=25931 quantity=1 tif=Gtc oco='NT-00318-646' filled=1 averageFillPrice=25933 onBehalfOf='' id=-1 time='2018-01-16 16:08:51' gtd='2099-12-01' statementDate='2019-12-17'
    Notice the Oco field for the last order contains the orderId from the previous "Exit on session close" signal, and not the entry orderId (the line above)

    #2
    Hello pat9rb,

    Thank you for the post.

    When a stop loss exit is triggered, the order's fromEntrySignal is always blank
    Do you have a sample of the logic being used when you see this? I would like to try this on my end to observe this.

    I also can't set SetStopLoss() for a trade by signal name, only for all trades. I don't see any errors, but the call to SetStopLoss with signalName looks to be ignored.
    This would also be an item I would likely need to see a sample of the logic to better understand what is happening.

    As you are reporting a few items I would suggest to try and make a simplified script like the SampleMACrossOver which can demonstrate the issue/s. We can then use that for testing or reporting if there is a problem.

    For the exit on close item I will look into this to see if I can reproduce that happening.



    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    87 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    118 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X