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

Custom Share Size For EntryLong

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

    #16
    Hello dorony,

    You have two EnterLong statements in the image you provided, there is one in the Print and one above it. You would need to remove the Print and that should remove the duplicate order.

    If you are trying to Print the orders information, you should print before the EnterLong statement with only the information you need but without EnterLong() like the following:
    Code:
    Print("My Entry Quanity: " + myQuantity);
    EnterLong(myQuantity, @"");
    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #17
      This happened even prior to me adding the print code in there.

      if thats the case, then what else could it be?

      Comment


        #18
        Hello,

        I wouldn't be certain without seeing the code you had previously.

        If you remove the print and then remove and re-add/re-enable the strategy do you still see the same?

        If so, is the entry in the same direction in the same bar? that could be caused by the condition becoming true again if you are using Tick by Tick processing. This would generally require that the position is closed to re-enter unless you have EntriesPerDirection higher than 1.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #19
          Thanks.

          I only have it per 1 direction.

          Whats funny is that during live it shows multiple orders. However, if I restart it to take the trade in the historical sense, it then turns into 1 trade and with different share amounts.

          Comment


            #20
            Hello,

            Yes, this likely relates to using OnEachTick or that your logic is becoming true again. You can add Prints to the condition to confirm that.

            Instead of printing an Entry method, try just printing some debug information like the following and then run it in real-time.
            Code:
            if(....)
            { 
                EnterLong(...);
                Print("CurrentBar: " + CurrentBar + " Condition true");
            }
            What is the output you get when the double entry occurs? you should be able to compare this against the historical entry that works to see how the logic was executed. If it was different, you should see a difference in the prints.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #21
              Hey,

              Thanks for your help.

              Is this normal when you get 2 fills for 1 long order during live triggers?

              Also it seems that ninja trader first puts out an order and then a few moments later in time it fills.

              Could it be possible that it first calculates when the order is out and then readjusts when it gets filled (that is if the values change for the calculation for share size in between order out and order filled)?
              Attached Files
              Last edited by dorony; 02-09-2018, 01:43 PM.

              Comment


                #22
                Hello,

                Thank you for the reply.

                It looks like in the image that is perhaps a partial fill, can you tell me was the quantity for this order 555? You should also be able to review the orders to see if it was partially filled as well.

                Regarding fills, can you explain further what you are seeing regarding the script waiting?

                I look forward to being of further assistance.
                JesseNinjaTrader Customer Service

                Comment


                  #23
                  How do I know if it was partially filled?

                  Comment


                    #24
                    Hello,

                    You would need to look at what the entry quantity was for your entry and see if that was filled partially.

                    If your entries per direction is not set to more than 1, and your entry had not been called more than once, it would very likely be a partial fill based on the quantity displayed. If the quantity between the two fills equals what you submitted that would be a partial fill.

                    You can further confirm this in your code by using OnOrderUpdate or OnExecution and checking the Order's OrderState to see if it was OrderState.PartFilled. You can also compare the Filled amount of the order against the total you had submitted to know if it was partially filled.

                    Please let me know if I may be of further assistance.
                    JesseNinjaTrader Customer Service

                    Comment


                      #25
                      I have my strategy set to only one entry per direction.

                      Here is an order that just happened. It seems that it is one order getting filled. But would like you to confirm that.
                      Attached Files

                      Comment


                        #26
                        Hello,

                        Yes that looks to potentially be a partial fill based on what you provided but I cannot confirm this for you, this is a step you need to do on your own. I had provided the ways that you can check this in the prior post.

                        I would suggest using the OnOrderUpdate or OnExecutionUpdate overrides to check what the OrderStatus was for the orders in question. I can only assume that the order was partially filled based on the information you are giving me, you can confirm if this was or was not partially filled by using Prints from OnOrderUpdate or OnExecution.

                        There is a specific part filled example in the help guide for OnOrderUpdate here: https://ninjatrader.com/support/help...=onorderupdate


                        Please let me know if I may be of further assistance.
                        JesseNinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by BarzTrading, Today, 07:25 AM
                        2 responses
                        14 views
                        1 like
                        Last Post BarzTrading  
                        Started by devatechnologies, 04-14-2024, 02:58 PM
                        3 responses
                        19 views
                        0 likes
                        Last Post NinjaTrader_BrandonH  
                        Started by tkaboris, Today, 08:01 AM
                        0 responses
                        3 views
                        0 likes
                        Last Post tkaboris  
                        Started by EB Worx, 04-04-2023, 02:34 AM
                        7 responses
                        162 views
                        0 likes
                        Last Post VFI26
                        by VFI26
                         
                        Started by Mizzouman1, Today, 07:35 AM
                        1 response
                        10 views
                        0 likes
                        Last Post NinjaTrader_Gaby  
                        Working...
                        X