No announcement yet.

Partner 728x90


enter order with conditions

  • Filter
  • Time
  • Show
Clear All
new posts

    enter order with conditions

    is it possible to enter an order with conditions?
    future is a 105, and I wanna enter an buy order at 100, but only if future first go to 99 or less,
    so my buy order will be "pending" at 100, order will be sent only when stock go under 99. not at 100 itself
    on interactivebrokers is possible with "conditions" but on NT8 I didn't find anything similar.
    any idea?

    Hello hellboy78,

    Thanks for your question.

    Conditional order entry is possible through NinjaScript strategies. The logic is managed on the platform and is not baked into an order.

    The three basic order types are Stop Market, Limit, and Market.

    You could create a NinjaScript strategy that checks if the current market price (Close[0]) is at or below 99, and then submits a Stop Market order (EnterLongStopMarket) to buy at 100. (A Buy Limit order submitted to 100 would automatically fill if the current market price is 99, because 99 is a better price to buy at.)

    I am including some educational information on NinjaScript strategies below.

    NinjaScript Strategy educational information

    Simple NinjaScript strategies can be built using the Strategy Builder and more complex and robust strategies can be written by hand.

    Please see the Strategy Builder 301 and NinjaScript Editor 401 courses to get acquainted with NinjaScript strategies. These videos are publicly available.

    Strategy Builder 301 —
    NinjaScript Editor 401 —

    The Managed Approach documentation explains how Strategy Builder and Managed NinjaScript strategies can be written.

    Managed Approach —
    NinjaScript strategy tutorials —

    NinjaScript strategies are then deployed against one account. The strategy processes historical data to identify past trade signals and to develop the strategy position. This is separate from the Account's Position. The calculated orders from historical data and the strategy position are then used by the Start Behavior to configure how the strategy should handle this position when the strategy is first enabled.
    • WaitUntilFlat waits until the calculated position is closed so the strategy only starts trading when it sees itself in a flat position.
    • ImmediatelySubmit will allow the strategy to submit historically calculated orders immediately when the strategy is enabled. This would be used when we know where the strategy position is when we enable the strategy, and is used particularly for re-enabling strategies so they can resume positions and orders.
    • Sync Account is additional option that has the strategy submit an additional order to sync the strategy position to the account position. This should not be confused with syncing the strategy position to the account position.
    It is important to understand the Start Behaviors and their relation to the Strategy and Account Position. Please see below for more details.

    Strategy vs. Account Position —
    Start Behaviors —

    When writing more robust strategies in the NinjaScript Editor, please refer to our Educational materials and Reference Samples.

    Educational Materials —
    Reference Samples —

    Please let us know if you have any additional questions.
    JimNinjaTrader Customer Service


      why I should make an entire strategy???
      it's just an order with condition.
      I don't understand how I can use a strategy on live trading, manually.
      looks like strategy can be used only for automatic trading, and I gave you an example, doen't mean that gonna be the same everyday for every order.
      so I don't really understand your suggestion of making a strategy


        Hello hellboy78,

        If you do not need functionality to cancel the order when a bar closes and the condition is no longer true, you can use a Chart Alert.

        The Chart Alert could check if Data Series > Price type > Close (BarsAgo 0) is less than 99, and if the condition is true, submit a Buy Stop Market order with a stop price of 100.

        Chart Alerts -

        Using Alerts -
        Attached Files
        JimNinjaTrader Customer Service


        Latest Posts


        Topics Statistics Last Post
        Started by mattdowns1234, Today, 06:57 PM
        0 responses
        Last Post mattdowns1234  
        Started by dgee949, Today, 06:26 PM
        0 responses
        Last Post dgee949
        by dgee949
        Started by dgee949, Today, 05:58 PM
        0 responses
        Last Post dgee949
        by dgee949
        Started by thepcmd, Today, 05:14 PM
        0 responses
        Last Post thepcmd
        by thepcmd
        Started by xmess777, Today, 04:58 PM
        0 responses
        Last Post xmess777