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

Limit orders not executed NT8

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

    Limit orders not executed NT8

    Hello,

    I would like to know how NT8 manages limit orders not executed when a strategy is running.

    Is there any way of sending a market order after N seconds when a limit order has been touched but has not been filled?

    I know that this was not possible with NT7, perhaps is different with NT8?

    If the answer is negative, what is easiest way of solving this thru NinjaScript?

    Thank you.

    #2
    Hello Plaket,

    Thanks for opening the thread.

    Orders that are not submitted through a strategy and are submitted manually will only follow the simple order placement rules and will be filled by the broker.

    In the circumstance that a limit order is touched and not filled, this is very possible under the considering slippage. The price could be met but by the time the order with the broker gets processed, the price may have already changed.

    There is not any way within NinjaTrader 8 to place a market order a certain number of seconds after a limit order has been touched but not filled. This is more of a customized behavior that belongs in a NinjaScript strategy.

    This strategy would be possible by...

    a) Defining logic to use a 1 second primary data series to enter into the market. The primary data series is the data series that the strategy gets attached to. A strategy can then be written to detect when the price has met the limit order, and if so many bars occur after the limit price is met, you can call ExitShort() or ExitLong() to place a market order to exit the position.

    b) Creating a strategy with intrabar granularity to utilize a 1 second data series so the strategy can take action on each second even if the primary data series is not a 1 second data series. You could then also use OnOrderUpdate() to detect when the order has become accepted and working. When this status is reached, you know the order is working with the broker. With the limit order working, you can then start checking if the limit price is ever reached in OnBarUpdate() for the iteration of the 1 second data series. You can then submit a market order similarly to a)

    Scenario a) is a more simplistic approach that can be loosely defined in the Strategy Builder to make a simple strategy.

    Scenario b) would be a more advanced approach and would require some programming background to accomplish or might be best left to a NinjaScript Consultant to write for you. If you would like, I can have our business development follow up with you with a list of professional NinjaScript Consultants who would be happy to create this script or any others at your request. If that is the case, please write in to platformsupport[at]ninjatrader[dot]com with the thread URL and the text "Attention Jim."

    Resources for Scenario a)

    Please see the video here: https://www.screencast.com/t/GbQyCz2SGvG

    Resources for Scenario b)

    Please see the documentation for Multi Series strategies and utilizing OnOrderUpdate()

    Multi Series NinjaScripts - http://ninjatrader.com/support/helpG...nstruments.htm

    OnOrderUpdate() - http://www.ninjatrader.com/support/h...=OnOrderUpdate

    Using OnOrderUpdate() and OnExecution() for Protective Orders sample — http://ninjatrader.com/support/forum...ead.php?t=7499

    Using additional data series, Intrabar backtesting example - http://ninjatrader.com/support/forum...ead.php?t=6652

    Please let me know if I may be of further assistance.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by gravdigaz6, Today, 11:40 PM
    0 responses
    4 views
    0 likes
    Last Post gravdigaz6  
    Started by MarianApalaghiei, Today, 10:49 PM
    3 responses
    9 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by XXtrader, Today, 11:30 PM
    0 responses
    3 views
    0 likes
    Last Post XXtrader  
    Started by love2code2trade, Yesterday, 01:45 PM
    4 responses
    28 views
    0 likes
    Last Post love2code2trade  
    Started by funk10101, Today, 09:43 PM
    0 responses
    9 views
    0 likes
    Last Post funk10101  
    Working...
    X