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

Breakout Automatic Entry

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

    Breakout Automatic Entry

    Hi there,

    I wanted to ask if there is a way to automatically place an order one tick beyond the close of the current bar before it closes. Some type of automatic breakout or trailing entry that gets triggered once the bar closes.I place Stop Limit Orders (SLO) and with volatility, sometimes the SLO has missed the desired entry price then I get the default error message that the SLO cannot be placed there and by the time I get that message out of the way and try to put a Limit Order, the price is too far gone. I scalp for very tight profit targets with tight stop losses so accuracy on my entries is crucial for my trading style and a few ticks can screw up my day, either by missing entries or for having to adjust my profit targets and stop losses to fit a late entry. Some other platform out there let you lock an entry price and if the SLO misses it, that order automatically converts into a limit order in case the price retests before it gets away. Is there any way to work around this issue?

    Sorry if that has been answered before on another thread but I haven't found any article about it. Any help would be greatly appreciated.

    Thanks!

    #2
    Hello PatrickM,

    You can use OnEachTick calculation to make sure you have the most granular logic execution and use that in combination with IsFirstTickOfBar to know when bars Elapse. If you wanted to place an order before the close of the bar you would need to use OnEachTick calculation or a more granular secondary series so you can do that intrabar. calculating a price that is 1 tick above the close is also possible, if you just mean for the last price that would be Close[0] + 1 * TickSize.




    I look forward to being of further assistance.

    JesseNinjaTrader Customer Service

    Comment


      #3
      Thank you Jesse for your reply.

      Sorry but I am a bit overwhelmed with that info. I don't even understand what you mean by "most granular logic execution" Could you please walk me through how to make those changes and explain how it would improve the issues I have with my entries?

      Thanks in advance for your help and patience.

      Comment


        #4
        Hello PatrickM,

        Thanks for the reply.

        More granular in this context means to have more datapoints which allows for the logic to execute more times. If you are seeing that OnBarClose processing is too slow you could try OnEachTick to see if that helps with your existing logic.

        Using these items will depend on your goals and what you coded already but the general concepts would be that using OnEachTick allows the OnBarUpdate method to be called for each tick. That is more granular than the frequency of the bar which may allow your order to be submitted at a valid price. If you still need to know when bars closes then IsFirstTIckOfBar can be used to know that call to OnBarUpdate is a new bar.

        Both of these items have small examples in the help guide to help describe there use and shows where they could potentially go in your script. I would suggest to look at what you are doing now and see if that could be used OnEachTick and if so that may be able to be used to submit the order faster at the price you calculated rather than on the bar close.


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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by RookieTrader, Today, 09:37 AM
        3 responses
        15 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by kulwinder73, Today, 10:31 AM
        0 responses
        5 views
        0 likes
        Last Post kulwinder73  
        Started by terofs, Yesterday, 04:18 PM
        1 response
        23 views
        0 likes
        Last Post terofs
        by terofs
         
        Started by CommonWhale, Today, 09:55 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by Gerik, Today, 09:40 AM
        2 responses
        7 views
        0 likes
        Last Post Gerik
        by Gerik
         
        Working...
        X