Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ATM Strategy question

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

    #31
    I have another question about orderID and atmStrategyId. If they are checked, additional orders should not be executed? The sample strategy just keeps entering orders.
    eDanny
    NinjaTrader Ecosystem Vendor - Integrity Traders

    Comment


      #32
      eDanny,

      That does not happen on my end. On the sample strategy it will enter once and then in the Output Window as long as that strategy is active it will keep printing things like this:

      The current ATM Strategy market position is: Flat
      The current ATM Strategy position quantity is: 0
      The current ATM Strategy average price is: 0
      The current ATM Strategy Unrealized PnL is: 0
      The entry order average fill price is: 0
      The entry order filled amount is: 0
      The entry order order state is: Working
      The current ATM Strategy market position is: Flat
      The current ATM Strategy position quantity is: 0
      The current ATM Strategy average price is: 0
      The current ATM Strategy Unrealized PnL is: 0

      If it prints that it will never enter continuously.
      Josh P.NinjaTrader Customer Service

      Comment


        #33
        Grrr, every time I tried it, multiple entries have occured, starting with those tests yesterday.

        Ok, quit my other strategy so output window isn't cluttered and trying again.
        Last edited by eDanny; 01-28-2009, 12:20 PM.
        eDanny
        NinjaTrader Ecosystem Vendor - Integrity Traders

        Comment


          #34
          I see the constant output whereas my strategy only prints that type of status when in a position.
          eDanny
          NinjaTrader Ecosystem Vendor - Integrity Traders

          Comment


            #35
            The constant output should occur as you are in a position. As you are in a position the sample should never enter a new entry.
            Josh P.NinjaTrader Customer Service

            Comment


              #36
              If my strategy is running on two charts with the same instruments, how can I check to see if there is an open position on one chart to prevent another entry? Got a feeling there is no way to tell.
              eDanny
              NinjaTrader Ecosystem Vendor - Integrity Traders

              Comment


                #37
                No way to tell.
                Josh P.NinjaTrader Customer Service

                Comment


                  #38
                  Originally posted by eDanny View Post
                  If my strategy is running on two charts with the same instruments, how can I check to see if there is an open position on one chart to prevent another entry? Got a feeling there is no way to tell.
                  I would suggest you break your code into states for example so in your code it deals with multi signals happening at once and you are not falling back on anything other than your code

                  Code:
                  //method 1
                  if(XXX || YY && openorder == false)
                  {
                  method1 = (true);
                  }
                  Then do something like this
                  Code:
                      if (method1 == true && openorder == false) 
                  {
                  atmStrategyId = GetAtmStrategyUniqueId();
                  orderId = GetAtmStrategyUniqueId();
                  AtmStrategyCreate(Action.Sell, OrderType.Limit, Close[0], 0, TimeInForce.Day, orderId, "ATMTemplate", atmStrategyId);
                  openorder = (true);
                  }
                  Remember to set your variables back to a reset state once your account is flat again.

                  Side note this is an example ONLY.

                  Hope that helps.
                  CiRioN

                  Comment


                    #39
                    Don't believe that would do anything since the strategy on another chart would not know openorder=true.
                    eDanny
                    NinjaTrader Ecosystem Vendor - Integrity Traders

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by charlesugo_1, 05-26-2026, 05:03 PM
                    0 responses
                    60 views
                    0 likes
                    Last Post charlesugo_1  
                    Started by DannyP96, 05-18-2026, 02:38 PM
                    1 response
                    147 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by CarlTrading, 05-11-2026, 05:56 AM
                    0 responses
                    161 views
                    0 likes
                    Last Post CarlTrading  
                    Started by CarlTrading, 05-10-2026, 08:12 PM
                    0 responses
                    97 views
                    0 likes
                    Last Post CarlTrading  
                    Started by Hwop38, 05-04-2026, 07:02 PM
                    0 responses
                    284 views
                    0 likes
                    Last Post Hwop38
                    by Hwop38
                     
                    Working...
                    X