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 NullPointStrategies, Today, 05:17 AM
    0 responses
    50 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    126 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    69 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    42 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X