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

Get new price of moved ATM Strategy?

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

    Get new price of moved ATM Strategy?

    I have a strategy that places ATM orders. Once the order is on the chart, it can be moved with the mouse. How, once moved that way, can I programmatically get the ATM strategy's new entry price? "Orders" doesn't seem to know about the move, no new order is created when you move it, and the price in the existing order doesn't change. So the OrderId does me no good. All the methods to get information from an ATM seem to be designed for after the ATM is executed. But I need the information before it is executed. Thanks.

    #2
    Hello gbourque,

    Thanks for your post.

    If you are referring to monitoring the entry order status of an order submitted with AtmStrategyCreate then you could use GetAtmStrategyEntryOrderStatus().

    Another option would be to use GetAtmStrategyPositionAveragePrice() to get the current position's average price of the specified ATM Strategy.

    To monitor the stop/target order status, you could use GetAtmStrategyStopTargetOrderStatus().

    See the help guide documentation below for more information.

    GetAtmStrategyEntryOrderStatus(): https://ninjatrader.com/support/help...rderstatus.htm
    GetAtmStrategyPositionAveragePrice(): https://ninjatrader.com/support/help...onaveragep.htm
    GetAtmStrategyStopTargetOrderStatus(): https://ninjatrader.com/support/help...rgetorders.htm
    Atm Strategy Methods: https://ninjatrader.com/support/help...gy_methods.htm
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      I tried these. GetAtmStrategyEntryOrderStatus() only returns information that is known after the order is executed, as do the other methods you cited.

      Note: I'm not using a market order to enter the ATM. I'm using either a StopMarket order or an MIT order. The ATM order is placed and appears on the chart and can be canceled or moved with the mouse, but is not executed until after its price is touched, at which point the stop and target orders are created.

      None of the methods you cited return the entry price assigned to an ATM order. You can use AtmStrategyCancelEntryOrder() and AtmStrategyChangeEntryOrder(), but there is no way to get the current entry price of the ATM from it, that I can see.

      The point is I want to add buttons to move an ATM order a certain number of ticks, up or down. But if the strategy script doesn't know the existing price of the ATM, it doesn't know where to move it. Especially if the order has already been moved with the mouse. It seems there must be some way to ask the ATM what its entry price is. Note: Not its execution price, its StopMarket/MIT entry price.

      Comment


        #4
        Since an existing waiting ATM strategy (one with a stop market or MIT entry order) can be moved with the mouse in ChartTrader, ChartTrader must be able to find out where the order is, so I assume I should be able to also. The question is, how does it do it?

        Comment


          #5
          Now that I look closer, I don't see a way to get much information from any order, ATM or otherwise, that has not executed.

          Here's the problem in a nutshell:

          1) In a strategy script, place a stop market buy order comfortably above the current price.
          2) In CharterTrader, move the order with the mouse.
          3) Find a way for the script to ask the order what its new price is.

          Extra credit: Do the same with an ATM order.

          Comment


            #6
            Hello gbourque,

            Thanks for your notes.

            If an entry order submitted by AtmStrategyCreate() is manually moved on the chart then you would not be able to get the price of that order prior to it being filled.

            Manual movements would not be reflected since the strategy cannot see this movement of the order.

            You would need to keep track of the prices you wanted to have the order moved to within the strategy and move the order in the code of the strategy by using AtmStrategyChangeEntryOrder().

            AtmStrategyChangeEntryOrder(): https://ninjatrader.com/support/help...entryorder.htm

            The same concept would apply to stop/target orders. The AtmStrategyChangeStopTarget() method would be used to change the stop or target order to a different price.

            AtmStrategyChangeStopTarget(): https://ninjatrader.com/support/help...stoptarget.htm
            Brandon H.NinjaTrader Customer Service

            Comment


              #7
              I can keep track of where I placed the order. I just can't keep track of where it might have been moved with the mouse or other means. It seems logical that this information should be available.

              So I'm formally requesting an enhancement to make what I'm asking for possible. Obviously, there is something in NinjaTrader that knows where the order is. You just need to expose it in the API. Please pass this thread along to development. Thank you.

              Comment


                #8
                Hello gbourque,

                Thanks for your notes.

                As stated in post # 6, you would not be able to get the price of an order that was manually moved on the chart since the strategy cannot see the manual movement of the order.

                If you want to change an order's price then this would need to be done through code by using the AtmStrategyChangeEntryOrder() and AtmStrategyChangeStopTarget() methods, not by manually moving the order on the chart.

                I have submitted your feature request to the Development team. This request is being tracked under the number SFT-6117.

                As with all feature requests, interest is tracked before implementation is considered, so we cannot offer an ETA or promise of fulfillment. If implemented, it will be noted on the Release Notes page of the Help Guide.

                Release Notes — https://ninjatrader.com/support/help...ease_notes.htm
                Last edited by NinjaTrader_BrandonH; 11-06-2023, 10:22 AM.
                Brandon H.NinjaTrader Customer Service

                Comment


                  #9
                  That's just the point, I want the user to be able to move the order with the mouse and yet still have the script know where the order is so it can be moved by other means if needed. This is an enhancement request. Please pass it along. Thanks.

                  Comment


                    #10
                    Hello gbourque,

                    Thanks for your notes.

                    The feature request was submitted to the Development team so they may take it into consideration for future versions of the platform.

                    As with all feature requests, interest is tracked before implementation is considered, so we cannot offer an ETA or promise of fulfillment. If implemented, it will be noted on the Release Notes page of the Help Guide.

                    Release Notes — https://ninjatrader.com/support/help...ease_notes.htm
                    Brandon H.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by llanqui, Today, 03:53 AM
                    0 responses
                    4 views
                    0 likes
                    Last Post llanqui
                    by llanqui
                     
                    Started by burtoninlondon, Today, 12:38 AM
                    0 responses
                    10 views
                    0 likes
                    Last Post burtoninlondon  
                    Started by AaronKoRn, Yesterday, 09:49 PM
                    0 responses
                    14 views
                    0 likes
                    Last Post AaronKoRn  
                    Started by carnitron, Yesterday, 08:42 PM
                    0 responses
                    11 views
                    0 likes
                    Last Post carnitron  
                    Started by strategist007, Yesterday, 07:51 PM
                    0 responses
                    14 views
                    0 likes
                    Last Post strategist007  
                    Working...
                    X