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

how exit happens on same bar?

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

    how exit happens on same bar?

    i.e. I have EnterLongStop order, which fills at X price.



    in OnOrderUpdate, I set ExitLongLimit Order to make a protective stop.
    However, it exits on same bar, and what's the main thing here - it exits on the previous price (which havent been hit after entry).

    After that,i've found that I should have used ExitLongStopMarket, and it will work well.


    but, now i face another problem. I tested 2 variations with same chart:



    if 1st , i use:
    ExitLongStopMarket(0, true, 1, order.AverageFillPrice - TickSize, ...)
    in 2nd , i use:
    ExitLongStopMarket(0, true, 1, order.AverageFillPrice, ...)

    and as you see, 2nd chart doesnt trigger exit. Why? the only difference is `-TickSize`
    Last edited by ttodua; 09-10-2018, 02:26 PM.

    #2
    Hello TazoTodua,

    Thank you for your note.

    You could expect an exit on the same bar if worked close enough to the entry price and that stop price was within the entry candle. Without a more granular series Ninjatrader would not know the order in which prices traded for that candle. To avoid situations where the stop price wasn’t traded but Ninjatrader is showing your stop as filled you should add a secondary tick series to the script, see the following,
    You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by


    Regarding the 2nd chart not showing a fill, are you seeing errors on the log tab of the control center?

    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the information
      Last edited by Michelle151; 12-21-2018, 10:27 PM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Barry Milan, Today, 10:35 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by WeyldFalcon, 12-10-2020, 06:48 PM
      14 responses
      1,428 views
      0 likes
      Last Post Handclap0241  
      Started by DJ888, Yesterday, 06:09 PM
      2 responses
      9 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by jeronymite, 04-12-2024, 04:26 PM
      3 responses
      40 views
      0 likes
      Last Post jeronymite  
      Started by bill2023, Today, 08:51 AM
      2 responses
      16 views
      0 likes
      Last Post bill2023  
      Working...
      X