Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DawnTreader, Today, 05:58 PM
    0 responses
    4 views
    0 likes
    Last Post DawnTreader  
    Started by ntram, Today, 05:39 PM
    0 responses
    4 views
    0 likes
    Last Post ntram
    by ntram
     
    Started by giulyko00, Today, 11:49 AM
    2 responses
    11 views
    0 likes
    Last Post giulyko00  
    Started by Aviram Y, Today, 06:03 AM
    2 responses
    11 views
    0 likes
    Last Post Aviram Y  
    Started by FishTrade, Today, 03:42 PM
    0 responses
    1 view
    0 likes
    Last Post FishTrade  
    Working...
    X