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

Stop Order isn't triggering on Entry Bar

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

    Stop Order isn't triggering on Entry Bar

    Hi NT

    Thank you for the awesome Software. I am on NT8 and tried to add the logic to my strategy but I am finding issues with Stoploss order.


    I tried both the StopMarket and Limit variation but seems like they aren't working on Live/Playback Real-time data.




    In backtest, it is working fine.



    Now when I try the same on real-time :

    1st : Order Triggered on the candle


    2nd: Now the trade should have stopped out but it remains open until the next candle.
    I am getting this error.

    The stop loss order isn't triggering on the entry bar! While the profit target order is working fine and triggering on the same candle. After the Entry candle it is punching the stoploss but then it is failing.


    Here is the TraceOrder output:
    22/05/2020 10:06:04 Strategy 'RJ/201627762': Entered internal SubmitOrderManaged() method at 22/05/2020 10:06:04: BarsInProgress=0 Action=SellShort OrderType=StopMarket Quantity=1 LimitPrice=0 StopPrice=2920.25 SignalName='Short' FromEntrySignal='' 22/05/2020 10:06:04 Strategy 'RJ/201627762': Amended matching order at 22/05/2020 10:06:04: BarsInProgress=0 Action=SellShort OrderType=StopMarket Quantity=1 LimitPrice=0 StopPrice=2920.25 SignalName='Short' FromEntrySignal='' 22/05/2020 10:06:14 Strategy 'RJ/201627762': Entered internal SubmitOrderManaged() method at 22/05/2020 10:06:14: BarsInProgress=0 Action=BuyToCover OrderType=StopLimit Quantity=0 LimitPrice=2923.75 StopPrice=2921.25 SignalName='ShortStop' FromEntrySignal='Short' 22/05/2020 10:06:14 Strategy 'RJ/201627762': Ignored SubmitOrderManaged() method at 22/05/2020 10:06:14: BarsInProgress=0 Action=BuyToCover OrderType=StopLimit Quantity=0 LimitPrice=2923.75 StopPrice=2921.25 SignalName='ShortStop' FromEntrySignal='Short' Reason='This was an exit order but no position exists to exit'

    It is showing that there isn't any position open at the time but there certainly is an open position named "Short" open at the time.

    I request expert opinion on this.
    Last edited by dastaan; 05-29-2020, 06:36 AM.

    #2
    Hello dastaan,

    Thank you for the post.

    Where are you triggering the stop logic from, was this OnExecutionUpdate? The position may not exist yet if this was happening from OnOrderUpdate so that could be accurate in that use case, OnExecutionUpdate would be used for any logic driven by order fills.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cmtjoancolmenero, Yesterday, 03:58 PM
    1 response
    17 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by benmarkal, Yesterday, 12:52 PM
    3 responses
    23 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by helpwanted, Today, 03:06 AM
    1 response
    20 views
    0 likes
    Last Post sarafuenonly123  
    Started by Brevo, Today, 01:45 AM
    0 responses
    12 views
    0 likes
    Last Post Brevo
    by Brevo
     
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    244 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Working...
    X