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

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 cutzpr, Today, 08:54 AM
                    0 responses
                    6 views
                    0 likes
                    Last Post cutzpr
                    by cutzpr
                     
                    Started by benmarkal, Today, 08:44 AM
                    0 responses
                    8 views
                    0 likes
                    Last Post benmarkal  
                    Started by Tin34, Today, 03:30 AM
                    2 responses
                    26 views
                    0 likes
                    Last Post Tin34
                    by Tin34
                     
                    Started by sastrades, Yesterday, 09:59 AM
                    2 responses
                    41 views
                    0 likes
                    Last Post brucerobinson  
                    Started by ETFVoyageur, Today, 12:52 AM
                    1 response
                    24 views
                    0 likes
                    Last Post Leeroy_Jenkins  
                    Working...
                    X