Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

atm orderid does not exist

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

    #16
    MrTicks, I'm not sure I follow you, did you follow Josh's prior advise to only check this only after the Atm strategy template is working and managing the NS strategy exits? Otherwise it would not make sense to check for this...
    BertrandNinjaTrader Customer Service

    Comment


      #17
      Originally posted by NinjaTrader_Bertrand View Post
      MrTicks, I'm not sure I follow you, did you follow Josh's prior advise to only check this only after the Atm strategy template is working and managing the NS strategy exits? Otherwise it would not make sense to check for this...
      Hi Bertrand,

      Even when I run the SampleATMStrategy I get errors in my log file. The errors appear when I start the strat and then repeat every minute.

      Here is an example of the errors:

      GetAtmStrategyMarketPosition() method error: AtmStrategyId '5b7ae731ae74427cb3619d916e7ee0d1' does not exist GetAtmStrategyEntryOrderStatus() method error: orderId '17e5b3d0813043f2be4f85735246c1b1' does not exist
      What code should be present in order to prevent those errors?

      Comment


        #18
        If you run our SampleAtm one for testing, do you have the needed 'AtmStrategyTemplate' created beforehand in the DOM so this could be called?

        If I run the sample here on my end on a ES 1 min chart I do not get the issues you mentioned, please recheck with the correct template to call available.
        BertrandNinjaTrader Customer Service

        Comment


          #19
          Originally posted by NinjaTrader_Bertrand View Post
          If you run our SampleAtm one for testing, do you have the needed 'AtmStrategyTemplate' created beforehand in the DOM so this could be called?

          If I run the sample here on my end on a ES 1 min chart I do not get the issues you mentioned, please recheck with the correct template to call available.
          #

          I do have an ATM template that I created to match the name of the one in the SampleATMStrategy. I think I know why I get those errors, I was running the same strat on multiple instruments all calling the same ATM template with CalculateOnBar close set to false.

          When I just run one strat I don't get the errors.

          Comment


            #20
            Originally posted by NinjaTrader_Bertrand View Post
            If you run our SampleAtm one for testing, do you have the needed 'AtmStrategyTemplate' created beforehand in the DOM so this could be called?

            If I run the sample here on my end on a ES 1 min chart I do not get the issues you mentioned, please recheck with the correct template to call available.
            I have a definite answer now. The errors were caused buy having an entry condition looking at the past 4 bars, 0 - 3. In the SampleATM strat it just has one entry condition looking at the past bar whereas I was keeping my entry condition valid for 4 bars, by repeating the entry condition and looking back by up to 4 bars.

            As opposed to the SampleATM strat that only has one entry condition called against the last bar.

            Comment


              #21
              MrTicks,

              If you have 4 ATMs then I suggest ensuring you only try to access ones that are actually active. You could try using separate variables to track each one individually too.
              Josh P.NinjaTrader Customer Service

              Comment


                #22
                Originally posted by NinjaTrader_Josh View Post
                MrTicks,

                If you have 4 ATMs then I suggest ensuring you only try to access ones that are actually active. You could try using separate variables to track each one individually too.
                Had labelled the orders sequentially but not the ID calls.

                I had this:
                Code:
                // Condition set 1
                            if (orderId.Length == 0 && atmStrategyId.Length == 0 && (blah(blah)[0] > 0))
                            {
                                atmStrategyId = GetAtmStrategyUniqueId();
                                orderId = GetAtmStrategyUniqueId();
                                AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.StopLimit, High[0] + PrevBarPlusTicks * TickSize, 0, TimeInForce.Day, orderId, "ATM1", atmStrategyId);
                            }
                            
                            // Condition set 2
                            if (orderId.Length == 0 && atmStrategyId.Length == 0 && (blah(blah)[1] > 0))
                                
                            {
                                atmStrategyId = GetAtmStrategyUniqueId();
                                orderId = GetAtmStrategyUniqueId();
                                AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.StopLimit, High[1] + PrevBarPlusTicks * TickSize, 0, TimeInForce.Day, orderId, "ATM2", atmStrategyId);
                            }
                Should I start to sequentially increase the associated ID tags too?

                Code:
                {
                                atmStrategyId2 = GetAtmStrategyUniqueId();
                                orderId2 = GetAtmStrategyUniqueId();
                                AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.StopLimit, High[1] + PrevBarPlusTicks * TickSize, 0, TimeInForce.Day, orderId2, "ATM2", atmStrategyId);
                            }

                Comment


                  #23
                  Yes, that would be desired so you can actually track all of them separately.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #24
                    Should the sample ATM strat be able to run on tick charts without any errors? When I run it on tick charts I get the same "does not exist errors".

                    e.g.,

                    **NT** GetAtmStrategyEntryOrderStatus() method error: orderId '0f3f39377edd4e3bb4ddafcf6808de86' does not exist
                    **NT** GetAtmStrategyMarketPosition() method error: AtmStrategyId '09776050a0884200b69f5090437f6e10' does not exist
                    **NT** GetAtmStrategyMarketPosition() method error: AtmStrategyId '09776050a0884200b69f5090437f6e10' does not exist
                    The current ATM Strategy market position is: Flat
                    **NT** GetAtmStrategyPositionQuantity() method error: AtmStrategyId '09776050a0884200b69f5090437f6e10' does not exist
                    The current ATM Strategy position quantity is: 0
                    **NT** GetAtmStrategyPositionAveragePrice() method error: AtmStrategyId '09776050a0884200b69f5090437f6e10' does not exist
                    The current ATM Strategy average price is: 0
                    **NT** GetAtmStrategyUnrealizedProfitLoss() method error: AtmStrategyId '09776050a0884200b69f5090437f6e10' does not exist
                    The current ATM Strategy Unrealized PnL is: 0
                    **NT** GetAtmStrategyEntryOrderStatus() method error: orderId 'd2ffd88494194c0f81172c6c7bdd734a' does not exist
                    **NT** GetAtmStrategyEntryOrderStatus() method error: orderId 'f85d453ef084466eb05160778f1a4530' does not exist
                    **NT** GetAtmStrategyEntryOrderStatus() method error: orderId '1ca9a73135714f9e8db6245ab89096e6' does not exist
                    **NT** GetAtmStrategyEntryOrderStatus() method error: orderId '0f3f39377edd4e3bb4ddafcf6808de86' does not exist

                    Comment


                      #25
                      MrTicks, yes it should work - what NinjaTrader version and market are you running it on? I tried on my end here on ES 50 tick and did not run into issues.

                      Thanks
                      BertrandNinjaTrader Customer Service

                      Comment


                        #26
                        Have version 7.0.0.17 .

                        I went into the sampleATM strat and then right clicked and went save as. Then renamed it to a different one and replaced the original entry signals with my own. Then I renamed the ATM template it calls to one of my own.

                        Could it be because I have calculate on bar close set to false? In my strats that's the only difference?

                        PHP Code:
                        protected override void Initialize()
                                {
                                    
                        CalculateOnBarClose false;
                                } 

                        Comment


                          #27
                          There is one more difference and it's my ATM strategy create order when the signal is met.

                          The sample has a limit order but I have a stop limit order attached.

                          PHP Code:

                          //AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.Limit, Low{0], 0, TimeInForce.Day, orderId, "TFL3BR230610ATM200T", atmStrategyId);
                                      
                                          
                          AtmStrategyCreate(Cbi.OrderAction.BuyOrderType.StopLimitHigh[0] + PrevBarsPlusTicks TickSize0TimeInForce.DayorderId"TFL3BR230610ATM200T"atmStrategyId);
                                      } 

                          Comment


                            #28
                            Unfortunately could not reproduce with a StopLimit entry on COBC false eitiher here, what custom template are you calling? Could you perhaps email me the strategy / template setup used to support at ninjatrader dot com Attn Bertrand?

                            Thanks
                            BertrandNinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by geddyisodin, 04-25-2024, 05:20 AM
                            8 responses
                            58 views
                            0 likes
                            Last Post NinjaTrader_Gaby  
                            Started by jxs_xrj, 01-12-2020, 09:49 AM
                            4 responses
                            3,285 views
                            1 like
                            Last Post jgualdronc  
                            Started by Option Whisperer, Today, 09:55 AM
                            0 responses
                            5 views
                            0 likes
                            Last Post Option Whisperer  
                            Started by halgo_boulder, 04-20-2024, 08:44 AM
                            2 responses
                            22 views
                            0 likes
                            Last Post halgo_boulder  
                            Started by mishhh, 05-25-2010, 08:54 AM
                            19 responses
                            6,189 views
                            0 likes
                            Last Post rene69851  
                            Working...
                            X