Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

enter order with conditions

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

    enter order with conditions

    is it possible to enter an order with conditions?
    example
    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?

    #2
    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 — https://www.youtube.com/watch?v=HCyt90GAs9k
    NinjaScript Editor 401 — https://www.youtube.com/watch?v=BA0W4ECyVdc

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

    Managed Approach — https://ninjatrader.com/support/help...d_approach.htm
    NinjaScript strategy tutorials — https://ninjatrader.com/support/help...strategies.htm

    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 — https://ninjatrader.com/support/help..._account_p.htm
    Start Behaviors — https://ninjatrader.com/support/help..._positions.htm

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

    Educational Materials — https://ninjatrader.com/support/help..._resources.htm
    Reference Samples — https://ninjatrader.com/support/help...ce_samples.htm


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

    Comment


      #3
      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

      Comment


        #4
        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 - https://ninjatrader.com/support/help...tml?alerts.htm

        Using Alerts - https://ninjatrader.com/support/help...ing_alerts.htm
        Attached Files
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rtwave, 04-12-2024, 09:30 AM
        4 responses
        30 views
        0 likes
        Last Post rtwave
        by rtwave
         
        Started by yertle, Yesterday, 08:38 AM
        7 responses
        29 views
        0 likes
        Last Post yertle
        by yertle
         
        Started by bmartz, 03-12-2024, 06:12 AM
        2 responses
        22 views
        0 likes
        Last Post bmartz
        by bmartz
         
        Started by funk10101, Today, 12:02 AM
        0 responses
        6 views
        0 likes
        Last Post funk10101  
        Started by gravdigaz6, Yesterday, 11:40 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X