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

Entry Handling Questions

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

    Entry Handling Questions

    I'm not sure how entry handling is done in the strategy analyzer. I set Entries per direction to 2 and Entry Handling to Unique Entries. I got one Long1 Signal and one Long2 Signal.

    First question: If entry condition is met, Long1 will enter the first order, is the second order for Long1 entered in the subsequent bar only if the entry condition is still true, otherwise the second order won't execute?

    Second question: From the attached chart, you can see prior to Mar 08, there was two Long1 orders and one Long2 orders entered. However, they all have the same exit condition. Why is only one Long1 and Long2 order exited but the other Long1 order didn't exit?

    Third question: If I want to buy 2 contracts per trade instead of 1, where do I set this?
    Last edited by tjendra; 06-04-2020, 12:18 PM.

    #2
    Hello tjendra,

    Looking at the chart it looks like you got a first Long1 entry, then a second Long 1 entry, and then the third entry is Long 2. This would imply the Entry Handling is allowing 2 entries per direct for each signal name.

    Use TraceOrders and the output window to see if orders are being ignored and why.


    With the exit Long1Exit, my guess is that the order was supplied a 1 as the DefaultQuantity and not supplied with a quantity of 2 for the two contracts in the position.

    You can set the 'Set order quantity' to 'Default Quantity' and set the Value to 2, or you can supply a 2 as the Quantity to an order method.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      For the first question: So if u allow Entries per direction to 2, it will enter the one order for Long1 first, and the second order for Long1 will be entered on the next bar if the entry condition are met? It won't enter two Long1 orders at the same bar right?

      For the second question: I attached the trace output from the strategy. If you refer to the 3 March to 10 March part from my chart, I can't reconcile it to the orders in the trace output.

      For the third question, you can only 'Set order quantity' to 'Default Quantity' and set the Value to 2 only in the Order properties setting in the Strategy Analyzer right? You can't set this in the Strategy Builder right?

      Attached Files

      Comment


        #4
        Also, I set Entries per direction to 2 and Entry Handling to Unique Entries. But from the chart below, you can see 5 lines which means there are 5 open orders. Shouldn't the maximum open orders be only 4?

        Comment


          #5
          Hello tjendra,

          With EntriesPerDirection set to 2 with UniqueEntries and two unique signal names, you are able to place all 4 orders on the same bar.

          EntriesPerDirection is based on the position (and not tied directly to the bar information). Once there are two entries that make up a position, the third entry will be ignored and a message that the order was ignored will appear from TraceOrders in the NinjaScript Output window. This is how you would know an order was ignored due to the EntriesPerDirection.

          As a heads up, it is possible place more entries before the position changes. This would be something to actively avoid. (Such as attempting to place more orders than the EntriesPerDirection allows before the orders fill and change the position)


          Are you certain this output was created at the same time this screenshot was taken?
          I might suspect that the code may have been changed, or we may not be looking at 2015. You have not specified a year and the data in the file starts in 2015.
          What is the date of the bar on the chart?
          (You can enable Show date range option in the Chart Properties window.
          https://ninjatrader.com/support/help...AndDefinitions)
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            The order handling was done by NT automatically, that's why I am asking what's the logic behind it. With EntriesPerDirection set to 2, why doesn't it execute the two Long1 orders on the same bar and instead was placed over two bars. See attached for how I set my entry condition.

            Yes, the trace was from the same chart. I think you can't find it coz you were looking at 2015. The chart is actually referencing March 2016.

            And I didn't have any other separate entries so the maximum opened orders should only be 4. The code was build by strategy builder, and I only got two entry signal, Long1 and Long2. So how could there be 5 open orders in the backtest when EntriesPerDirection is set to 2? From the attached chart, you can see there was only Long1 and Long2 entry signal and no other signal. There was 3 open Long1 orders and 2 open Long2 orders in the circled area.

            Comment


              #7
              I remove the Long2 entry signal, with only Long1 entry so maybe it can illustrate the problems better. I set Entries per direction to 2 and Entry Handling to All Entries, u can see from the pic below, there was 4 exit of the Long1 signal. I thought the maximum possible should only be two orders, why does it allow four concurrent orders?

              Comment


                #8
                Hi tjendra, thanks for your reply.

                I could test your strategy so I can more easily see the problem. Please send it to platformsupport at ninjatrader.com and reference "Attn ChrisL 2589419" in the body of the email. See below for instructions on exporting a strategy:


                I look forward to hearing from you.
                Chris L.NinjaTrader Customer Service

                Comment


                  #9
                  Ok, already emailed.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Perr0Grande, Today, 08:16 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post Perr0Grande  
                  Started by elderan, Today, 08:03 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post elderan
                  by elderan
                   
                  Started by algospoke, Today, 06:40 PM
                  0 responses
                  10 views
                  0 likes
                  Last Post algospoke  
                  Started by maybeimnotrader, Today, 05:46 PM
                  0 responses
                  9 views
                  0 likes
                  Last Post maybeimnotrader  
                  Started by quantismo, Today, 05:13 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post quantismo  
                  Working...
                  X