• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Entries per direction: difference between all and unique

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

    Entries per direction: difference between all and unique

    Dear Support,

    I've been trying to figure what's the difference between "all entries" and "unique entries". I've read the manual, some post on the forum and did some testing but I still don't get it.

    My custom strategy is back-tested on 1 instrument list with 300 stocks and it produces similar results whether I choose "all entries" or "unique entries".

    e.g. if entries per direction is set to 2; it will always trigger 2 buys (long)/entries and 1 exit only. I guess this is what you called scaling in and if you want to scale out you'll have to do something different?

    My set order quantity is by account size so each entry is set to e.g. 10000$.

    Thank you for your advices,
    chris

    #2
    EntriesPerDirection and EntryHandling explanation

    ch9090,

    I am happy to assist you.

    From our help guide : http://www.ninjatrader.com/support/h...ryhandling.htm

    Entry Handling
    Definition
    Sets the manner in how entry orders are handled. If set to "EntryHandling.AllEntries", NinjaScript will process all order entry methods until the maximum allowable entries set by the EntriesPerDirection property has been reached while in an open position. If set to "EntryHandling.UniqueEntries", NinjaScript will process order entry methods until the maximum allowable entries set by the EntriesPerDirection property per each uniquely named entry.
    E.g.

    Suppose I have 2 unique signals for entering a trade, one called LONG1, one called LONG2
    Suppose EntriesPerDirection is set to 1

    If we have the entry method set to UniqueEntries, then you can get two entries total since you have 2 unique entry signals. I.e. you could have entered a trade from both the LONG1 signal, as well as the LONG2 signal. Its similar to inclusive OR, either one trade or the other will be executed, and possibly both.

    If we have the entry method set to AllEntries, then you will only get one entry total. I.e. if either the LONG1 or LONG2 signal entered a trade, then the other signal cannot enter a trade. Its similar to exclusive OR, either one trade or the other will be executed, but not both.

    Please let me know if I may assist further.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Many thanks for the quick and efficient reply Adam.

      Now I got it. It is useful it you have more than one entry signal. In my case I've only 1 and thus I could not see the difference.

      Is there something similar for exits?

      Comment


        #4
        ch9090,

        Thanks for your note.

        Unfortunately not. Essentially an exit signal will cancel a trade executed from whatever entrance signal you defined. The EntriesPerDirection and EntryHandling are there to help you control how many trades you are entering at a time, once you are in them you cancel the trades according to whatever logic you have be it stop-loss/take-profit, or an actual exit signal. If its an exit signal you just have an exit signal tied to cancel orders with a particular entrance signal. You can sort of see what I mean by looking at the following two links.

        EnterLong() : http://www.ninjatrader.com/support/h...?enterlong.htm

        ExitLong() : http://www.ninjatrader.com/support/h...l?exitlong.htm

        Please let me know if I can assist further.
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          Thank you Adam, it is much clearer now. Chris

          Comment


            #6
            Which parameter controls this?

            I have a strategy that initiates an entry using the ATMStrategy template--in code I modeled after your example in the code sample library.

            In my case, the strategy takes a long and a short entry price as input. When the last traded price reaches either of these prices the respective long or short entry is triggered as an order.

            However, if the price action is such that the order is not executed, the strategy will issue additional orders as the entry price is traded again. Is there a parameter on the strategy configuration that controls this?

            --it seems like these settings of entries per direction, etc do not override this unintended action because the position is still flat when these additional orders are issued.
            Jim-Boulder
            NinjaTrader Ecosystem Vendor - Elephant Tracks

            Comment


              #7
              Jim-Boulder,

              There is no built in functionality to limit the number of orders you submit, only orders that are allowed to be open at the same time. This is something that you would need to take care of in the code. You can use a method like : http://www.ninjatrader.com/support/h...ategyclose.htm
              Last edited by NinjaTrader_AdamP; 03-13-2012, 08:03 AM.
              Adam P.NinjaTrader Customer Service

              Comment


                #8
                Thanks to both of you, I'll take a closer look at your suggestions. Chris

                Comment


                  #9
                  Adam,
                  supposing I have two long positions open from two separate entries, and I wanted to exit with an average of 20 ticks profit or loss for my entire position, how do I do that?

                  Comment


                    #10
                    Hello a1982yusuf,
                    Thanks for writing in and I am replying for Adam.
                    The Position.AvgPrice will return the average price of the entries and you can use the below code to enter a stop 20 ticks below the average price.

                    Code:
                    SetStopLoss(CalculationMode.Price, Position.AvgPrice - 20 * TickSize);
                    SetProfitTarget(CalculationMode.Price, Position.AvgPrice + 20 * TickSize);
                    http://www.ninjatrader.com/support/h...etstoploss.htm
                    http://www.ninjatrader.com/support/h...ofittarget.htm
                    http://www.ninjatrader.com/support/h...l?avgprice.htm

                    Please let me know if I can assist you any further.
                    JoydeepNinjaTrader Customer Service

                    Comment


                      #11
                      Thanks Joydeep.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by cutzpr, 07-09-2020, 09:19 PM
                      2 responses
                      24 views
                      0 likes
                      Last Post kissandfly  
                      Started by Mirasol, 05-09-2018, 04:48 AM
                      22 responses
                      1,869 views
                      1 like
                      Last Post kissandfly  
                      Started by catinabag, Today, 07:31 AM
                      3 responses
                      10 views
                      0 likes
                      Last Post bltdavid  
                      Started by login_dejavu, Today, 07:28 AM
                      0 responses
                      8 views
                      0 likes
                      Last Post login_dejavu  
                      Started by catinabag, Today, 07:01 AM
                      1 response
                      7 views
                      0 likes
                      Last Post catinabag  
                      Working...
                      X