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

Accessing entry efficiency data by code

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

    Accessing entry efficiency data by code

    Is there a method to access entry efficiency calculations by code or can anyone suggested a good method to calculate entry efficiency in particular?



    Specifically, I'm trying to find all the instances my entry limit orders execute at the move extreme (to the tick) when 'liberal' fill processing is employed.

    #2
    Hello nrgtrader,

    I am unsure of anyway to gather this specific information from a script as the script is not directly associated with the Account Performance tab and its calculations. You could calculate this value with the script its self using the order information and execution information while it runs. You can see the calculation used by the account perfomance tab in the link you provided, this type of equation could be used in your script as well to calculate this value.


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

    Comment


      #3
      NinjaTrader_Jesse I am trying to find entries that hit to the tick and am having trouble with this code. Bellow is the code (and output) in onorderupdate and for some reason the matching print is not hitting. What am I doing wrong?

      1/26/2017 10:00:29 AM entryPrice = 53.64
      1/26/2017 10:00:29 AM minLow = 53.64
      1/26/2017 10:00:29 AM maxHigh = 54.06


      else if (order.OrderType == OrderType.Limit && order.OrderState == OrderState.Filled)
      {
      int tradeSpanL = 1 + BarsSinceEntry(bIPindex,"Long limit entry", 0);
      int tradeSpanS = 1 + BarsSinceEntry(bIPindex,"Short limit entry", 0);
      double minLow = MIN(Low, tradeSpanL)[0];
      double maxHigh = MAX(High, tradeSpanS)[0];

      Print(Time[0].ToString() + " entryPrice = " + entryPrice);
      Print(Time[0].ToString() + " minLow = " + minLow);
      Print(Time[0].ToString() + " maxHigh = " + maxHigh);

      if (entryPrice == minLow || entryPrice == maxHigh )
      {
      Print(Time[0].ToString() + " Position entered at move min/max");
      }

      Comment


        #4
        Hello,

        Are you saying that the condition below is not occurring?

        Code:
        if (entryPrice == minLow || entryPrice == maxHigh )
        {
        Print(Time[0].ToString() + " Position entered at move min/max");
        }
        If so you may be running into floating point comparison problems, we have a guide here on that subject: http://ninjatrader.com/support/forum...ead.php?t=3929

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

        Comment


          #5
          That's it -- thank you!

          Comment


            #6
            Hello nrgtrader,

            Thank you for your response.

            Are you indicating this item is resolved or that Jesse correctly identified the matter and you will need a follow up on his post?

            I look forward to your response.

            Comment


              #7
              NinjaTrader_PatrickH, I believe NinjaTrader_Jesse did resolve my question regarding my code with respect to floating point comparison problems and also my initial question regarding accessibility of entry efficiency data. Thanks.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by andrewtrades, Today, 04:57 PM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by chbruno, Today, 04:10 PM
              0 responses
              3 views
              0 likes
              Last Post chbruno
              by chbruno
               
              Started by josh18955, 03-25-2023, 11:16 AM
              6 responses
              436 views
              0 likes
              Last Post Delerium  
              Started by FAQtrader, Today, 03:35 PM
              0 responses
              7 views
              0 likes
              Last Post FAQtrader  
              Started by rocketman7, Today, 09:41 AM
              5 responses
              19 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X