Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Access target and stop when using AtmStrategyCreate

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

    Access target and stop when using AtmStrategyCreate

    Since the ATM strategy on the DOM may have arbitrary targets and stops,
    how do I access what ever are the current values?

    While the order is in play
    string [,] orders = GetAtmStrategyStopTargetOrderStatus("TARGET1", atmStrategyId);
    just returns zeroes for fill and quantity and a status of "working"
    When the order goes flat, GetAtmStrategyStopTargetOrderStatus() gets an error.
    so I am unable to find out the fill.

    What am I missing about the architecture design here?

    Same questions for stops.
    Thanks in advance.

    #2
    Hi Roland, what you see here would be unfortunately expected - the current values could not be checked, only their state, fill price and qty. You can provide your own values though through the AtmStrategyChangestopTarget() method and then keeping track of values you used.

    If your strategy has only one target and you would nullify the atmStrategyId on the fill, you cannot check later the fill price, as the strategy reference would not exist anymore.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      cant' get fill from GetAtmStrategyStopTargetOrderStatus()

      Bertrand:
      Thanks for answering..
      OK I can deal with not knowing current value.(although it would be nice in the future, particularly when the ATM DOM custom stops are complex)

      However, as I explained, I cannot seem to get ultimate fill price on target or stop after ATM strategy goes flat. I just get an error message when it try to access GetAtmStrategyStopTargetOrderStatus().

      What am I doing incorrectly?

      Comment


        #4
        You nullify / reset the atmStrategyId then likely too early, as then when you try to access it's already in reset state and you cannot access the needed values anymore. Before doing that I would suggest to store a reference to those, then you could do the needed reset in your code.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          error getting fill price using GetAtmStrategyStopTargetOrderStatus

          Bertrand:
          Here is the code snippet which first tests for Flat and the tries to get the fill price:
          :
          else if (atmStrategyIdn[lim].Length > 0 &&
          GetAtmStrategyMarketPosition(atmStrategyIdn[lim]) ==
          Cbi.MarketPosition.Flat)
          {
          Print(CurrentBar + " upOrdS Closing ATM ID # " + lim.ToString() +
          " tnum " + posAtmIdXRef[lim] + " entry fiiled at " +
          posAvgFillPrice[lim] + " approx exit at " + Close[0]);
          string[,] orders = GetAtmStrategyStopTargetOrderStatus("TARGET1", atmStrategyIdn[lim]);

          if (orders.Length > 0)
          {
          for (int i = 0; i < orders.GetLength(0); i++)
          {
          if (dbg("ATM")) Print(CurrentBar + " upOrdS Target Status" + lim.ToString() +
          " targ fill price is " + orders[i, 0].ToString() +
          " Qty " + orders[i, 1].ToString() +
          " state is " + orders[i, 2].ToString());
          }
          }

          atmStrategyIdn[lim] = string.Empty;

          As you can see, I am trying to acquire fill BEFORE I close the strategy ID
          Here is the output Window:
          41420 upOrdS Closing ATM ID # 1 tnum 1 entry fiiled at 82.54 approx exit at 82.61
          **NT** GetAtmStrategyStopTargetStatus() method error: AtmStrategyId 'f0ff19bfe86644a4ae6b7f34e77b66d7' does not exist or is already in terminated state

          Comment


            #6
            Thanks Roland, I can reproduce this outcome here and will check into.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Hi Roland, thanks for the patience here - I've looked into your report and what you see is unfortunately expected, to clarify our info: the reset is not the key, once the atm is in terminated state, so last target / stop is filled you could not access the fill info anymore.

              I've logged this is limitation / enhancement request into our product management tracking system under id 1843 and surely added your vote in as well.

              Thanks and all the best for you,
              BertrandNinjaTrader Customer Service

              Comment


                #8
                access fill with GetAtmStrategyStopTargetOrderStatus fails

                Bertrand:
                Thanks for getting to the bottom of this.
                Hope the fix happens soon as the help file instructions are quite clear that this should work.
                Roland

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by judysamnt7, 03-13-2023, 09:11 AM
                4 responses
                59 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
                21 views
                0 likes
                Last Post helpwanted  
                Started by cre8able, Today, 07:24 PM
                0 responses
                10 views
                0 likes
                Last Post cre8able  
                Working...
                X