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

Enter market with limit orders, multiple instruments

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

    Enter market with limit orders, multiple instruments

    Hi I have a strategy for multiple instruments. Currently I am entering the market with market orders. The strategy buys one instrument at ask and sells the other instrument at bid.

    How can I ensure that once my condition to enter the market becomes true, my order that buys at ask is filled and my order to sell at bid is also filled.

    I was thinking in order to ensure both orders are filled, maybe I should enter with limit orders. But the problem with limit orders is that, my orders on one of the instrument might get filled and the other might not, since it is a limit order.

    Is there a way to either ensure that both orders are filled once my condition becomes true, after all I am buying at ask and selling at bid. In theory that should work. Or is there a way to enter limit orders on both instruments that only executes if both limit orders will be executed? In essence it would be a limit order for the strategy that only executes if both limit orders are filled. Getting my orders filled exactly when my condition becomes true is extremely important.

    #2
    Hello calhawk01,
    Thanks for posting today.
    Originally posted by calhawk01 View Post
    ...Or is there a way to enter limit orders on both instruments that only executes if both limit orders will be executed?...
    This strategy behavior is not possible to achieve. It is impossible to tell if both limit orders WILL be executed. Since they are limit orders and the market can slip past them before filling it won't be possible to determine this.

    If they were market orders then you would be guaranteed they would fill but you would have to have the potential slippage.

    Originally posted by calhawk01 View Post
    ...In essence it would be a limit order for the strategy that only executes if both limit orders are filled.
    This can be done by checking the OrderState and seeing if it is filled.

    Originally posted by calhawk01 View Post
    ...Getting my orders filled exactly when my condition becomes true is extremely important.
    This can not be guaranteed as with any order it will have to be placed and then work at the exchanged before being filled. The exact time they are filled or price they are filled at can not be guaranteed.
    Alex G.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by calhawk01 View Post
      Hi I have a strategy for multiple instruments. Currently I am entering the market with market orders. The strategy buys one instrument at ask and sells the other instrument at bid.

      How can I ensure that once my condition to enter the market becomes true, my order that buys at ask is filled and my order to sell at bid is also filled.

      I was thinking in order to ensure both orders are filled, maybe I should enter with limit orders. But the problem with limit orders is that, my orders on one of the instrument might get filled and the other might not, since it is a limit order.

      Is there a way to either ensure that both orders are filled once my condition becomes true, after all I am buying at ask and selling at bid. In theory that should work. Or is there a way to enter limit orders on both instruments that only executes if both limit orders will be executed? In essence it would be a limit order for the strategy that only executes if both limit orders are filled. Getting my orders filled exactly when my condition becomes true is extremely important.
      Generally speaking, in most cases, yes, buying the ask, and selling the bid will fill immediately. The problem is that this is only true if the bid/ask has not moved by the time that the order reaches the exchange. On liquid instruments in a fast market, the bid/ask can actually change while your orders are in transit.

      The net is that "buy the ask; sell the bid" still does not always guarantee fills: the only guaranteed fills are market orders, which means that you must be prepared to take the slippage.

      This is one instance where one can sometimes get better fills on illiquid instruments.
      Last edited by koganam; 04-04-2015, 07:24 AM. Reason: Corrected punctuation.

      Comment


        #4
        Originally posted by calhawk01 View Post
        Hi I have a strategy for multiple instruments. Currently I am entering the market with market orders. The strategy buys one instrument at ask and sells the other instrument at bid.

        How can I ensure that once my condition to enter the market becomes true, my order that buys at ask is filled and my order to sell at bid is also filled.

        I was thinking in order to ensure both orders are filled, maybe I should enter with limit orders. But the problem with limit orders is that, my orders on one of the instrument might get filled and the other might not, since it is a limit order.

        Is there a way to either ensure that both orders are filled once my condition becomes true, after all I am buying at ask and selling at bid. In theory that should work. Or is there a way to enter limit orders on both instruments that only executes if both limit orders will be executed? In essence it would be a limit order for the strategy that only executes if both limit orders are filled. Getting my orders filled exactly when my condition becomes true is extremely important.
        As koganam said, the only approach that guarantees the execution is to use market orders. Instead of putting limit orders, you monitor the markets and trigger market orders immediately when the entry condition is met. There will be slippage though.

        Pi
        ninZa
        NinjaTrader Ecosystem Vendor - ninZa.co

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by JoMoon2024, Today, 06:56 AM
        0 responses
        6 views
        0 likes
        Last Post JoMoon2024  
        Started by Haiasi, 04-25-2024, 06:53 PM
        2 responses
        17 views
        0 likes
        Last Post Massinisa  
        Started by Creamers, Today, 05:32 AM
        0 responses
        6 views
        0 likes
        Last Post Creamers  
        Started by Segwin, 05-07-2018, 02:15 PM
        12 responses
        1,786 views
        0 likes
        Last Post Leafcutter  
        Started by poplagelu, Today, 05:00 AM
        0 responses
        3 views
        0 likes
        Last Post poplagelu  
        Working...
        X