Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order Change Other Order with ATM?

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

    Order Change Other Order with ATM?

    Hello Everyone. I am a newbie here. I have done some researched and played with numerous configs of the ATM Strategy section, yet I am unable to set this up. Here is what I am trying to accomplish.

    Here is the ATM I am using for the following scenario:


    Say the market is at 2495 points and trending up. I have a buy stop limit at 2500 to go with the long for a point scalp. My order kicks in, and the ATM above buys 4 contracts. Right now, I have the following orders:
    - Limit Sell 3 Contracts @ 2501 (1 point scalp target)
    - Limit Sell 3 Contracts @ 2498 (protected stop for the scalp)
    - Limit Sell 1 Contracts @ 2498 (protected stop for the runner)
    - Limit Sell 1 Contract @ 2510 (my runner reserve in case market shoots up)

    Now. What I want to do is that, if the market hits to 2501 and my order to sell 3 contract executes at 2501, then I wish to move the protected stop order for the runner to breakeven point. So as soon as my order to limit sell 3 contract @ 2501 executes, i wish to have following orders:
    - Limit Sell 1 Contract @ 2510 (still the same order for the runner. no changes)
    - Limit Sell 1 Contracts @ 2500 (protected stop for the runner increased to break even point)

    Now, how do I do that using the ATM Strategy option?

    #2
    Hello ray3455,

    Thank you for your post.

    How this ATM Strategy works is as follows:
    - Order kicks in and the ATM Strategy buys 4 contracts.
    - If the market moves 4 ticks in your favor 3 contracts execute to sell and the Stop Loss moves to breakeven.
    - After 40 ticks in your favor, the remaining contract will execute to sell.

    Attached are screenshots of your desired parameters.

    Additionally, you may find more information about ATM Strategies in the NinjaTrader Help Guide links below.



    Please let me know if I may be of further assistance.
    Attached Files
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      I have tried that exact configuration before I posted my question. Unfortunately, it won't work. The issue with that config is that Auto Break Even - Profit Target config does not care about the profit target order being executed or not. Sometimes the price hits the breakeven point, but there are not enough bids to get all pending orders executed so the price goes down again. It basically touches the breakeven line (4 pts above bought price) but it does not execute the 3 contract order. However, the auto break even immediately moves the stop up. What I need is basically auto break even to wait for the 3 contract limit sell to execute first and if it does, then move the stop to breakeven point. I hope this makes sense.

      Comment


        #4
        Hello ray3455,

        You could set the profit trigger of the Stop to match the profit trigger of the Target, but this isn't exactly the same. If you want to adjust the breakeven on the execution of your targets, this may be possible through NinjaScript by using OnExecutionUpdate. To learn more about Automated NinjaScript Strategies and how a breakeven can be triggered on the execution of a target, the NinjaScript team could give further insight.

        Please let me know if I may be of further assistance.
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          Hello ray3455,

          ATM strategies will only offer profit triggers based on ticks of favorable gain.

          To trigger a modification of your stop loss to move to breakeven on the execution of one of your targets, a NinjaScript strategy could be used instead of an ATM strategy. The NinjaScript strategy will need to manage separate targets and stops with Exit methods and would then need to use OnExecutionUpdate to check if one of those targets has filled so it can move the stop loss.

          I have an example that demonstrates using OnOrderUpdate and OnExecutionUpdate for submitting stop/target orders, and also demonstrates how the stop loss can be moved. The strategy has code in OnBarUpdate that will move the stop loss, and this functionality could be implemented in OnExecutionUpdate for when one of the targets fills.

          SampleOnOrderUpdate - https://ninjatrader.com/support/help...and_onexec.htm

          We look forward to assisting.
          JimNinjaTrader Customer Service

          Comment


            #6
            Thank you for assistance. I see the zip file on that link. I downloaded and have no clue how to make this work. I guess I need to learn to script: (

            Comment


              #7
              Hello ray3455,

              I've included some educational information on NinjaScript strategies which can help get you started. I would suggest starting with the Strategy Builder and learning the basics to get acquainted, and then I recommend working with unlocked code. Once you are more comfortable with the unlocked code it will be easier to work with the Advanced Order Handling methods like OnExecutionUpdate.

              If you have questions about NinjaScript, you can always ask specific questions in a new thread in our Strategy Development forums, or you can email our NinjaScript team at platformsuppport [at] ninjatrader [dot] com.

              General NinjaScript Strategy 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.
              The Managed Approach documentation explains how Strategy Builder and Managed NinjaScript strategies can be written.
              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.
              When writing more robust strategies in the NinjaScript Editor, please refer to our Educational materials and Reference Samples.We look forward to assisting.
              JimNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by judysamnt7, 03-13-2023, 09:11 AM
              4 responses
              57 views
              0 likes
              Last Post DynamicTest  
              Started by ScottWalsh, Today, 06:52 PM
              4 responses
              36 views
              0 likes
              Last Post ScottWalsh  
              Started by olisav57, Today, 07:39 PM
              0 responses
              7 views
              0 likes
              Last Post olisav57  
              Started by trilliantrader, Today, 03:01 PM
              2 responses
              20 views
              0 likes
              Last Post helpwanted  
              Started by cre8able, Today, 07:24 PM
              0 responses
              9 views
              0 likes
              Last Post cre8able  
              Working...
              X