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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    79 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    63 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    63 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X