Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ATM how to get a pending order's price

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

    ATM how to get a pending order's price

    Hi,

    So the question is - how to get a pending order price -> STOP1 price? TARGET1 price, etc?
    GetAtmStrategyStopTargetOrderStatus returns:
    - filled price
    - filled amount
    - state
    But I need to see orderID (not the name like STOP1 - it is useless if I'm trading 10 ATM strategies on the same instrument), Stop and Limit prices, etc.

    #2
    Hello webus,

    Those type of details are not exposed with using ATM's in NinjaScript, the only available methods to use can be found here:



    The approach you would have to take would be to change the targets to a price used in your code and at that point you would also know the price which you changed them to. There is no way to get order ID's with atms, you instead use the order names like STOP1. The ATM ID is used in combination with the name of the order to get the correct targets which the strategy is managing for the ATM. string orderName, string atmStrategyId


    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi NinjaTrader_Jesse​,

      Originally posted by NinjaTrader_Jesse View Post
      Hello webus,

      Those type of details are not exposed with using ATM's in NinjaScript, the only available methods to use can be found here:



      The approach you would have to take would be to change the targets to a price used in your code and at that point you would also know the price which you changed them to. There is no way to get order ID's with atms, you instead use the order names like STOP1. The ATM ID is used in combination with the name of the order to get the correct targets which the strategy is managing for the ATM. string orderName, string atmStrategyId
      If I want to move all ATM StopLoss levels into breakeven price - how can I do this (how to identify the average filling price at the moment)? For instance, my ATM position is 5 quantity, 5 TP and 5 SL levels with 1 quantity for each of the level. The initial average price is not the same for each of these 5 quantities (1 quantity is filled on 5000.00, 1 on 5010.00, 1 on 5008.00, etc). For insthace, 3 TP levels are closed and I want to move SL orders to the Breakeven point. How can I check the current average filling price? As far as I can see - I cannot do this, am I right?

      If yes - is this a big deal to provide more details about the ATM orders? At least the real order ID in orders[i, 3] field.

      Comment


        #4
        Hello webus,
        You would have to call AtmStrategyChangeStopTarget for each order. If you had 5 orders, you would use AtmStrategyChangeStopTarget 5 times in a row with each order name and the associated ATM ID. To get the positions average price, you can use GetAtmStrategyPositionAveragePrice.


        JesseNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Jesse View Post
          Hello webus,
          To get the positions average price, you can use GetAtmStrategyPositionAveragePrice.
          Wow, thank you. Probably I was blind.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by yubo27, 12-01-2023, 09:32 AM
          10 responses
          260 views
          0 likes
          Last Post judysamnt7  
          Started by thehammer, 12-18-2023, 08:51 PM
          10 responses
          250 views
          0 likes
          Last Post judysamnt7  
          Started by Rosa Riley, Today, 05:44 AM
          0 responses
          10 views
          0 likes
          Last Post Rosa Riley  
          Started by giogio1, 12-01-2024, 08:49 PM
          4 responses
          20 views
          0 likes
          Last Post giogio1
          by giogio1
           
          Started by rokups, 12-01-2024, 05:44 AM
          2 responses
          25 views
          0 likes
          Last Post rokups
          by rokups
           
          Working...
          X