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

Number of ticks per Day

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

    Number of ticks per Day

    Hi,

    I'd like to create an simple indicator that 'counts the ticks' for a given bar (daily bar).
    It could like look like a volume histogram, but instead of counting the number of contracts trades, it counts the ticks.

    By 'tick' i mean the 'tick that is used to create a tick bar (which is essentially 1 trade).

    Can someone point me in the right direction with NT8?
    (I found an old example, but it was for NT7)

    Thanks
    AK

    #2
    Hello aavevo,

    Thanks for your post.

    Rather than reinventing the wheel so to speak why not convert the NT7 example? The NT8 helpguide provides a great code breaking change section where you can search by the NT7 method/property and then see what the NT8 replacement would be.

    I've converted a few indicators and the process I follow is to use the NinjaTrader8 Indicator wizard to create the basic structure which contains the added dataseries, plot outputs and any other user inputs. Once I have that set I usually copy what's in the OnBarUpDate() entirely and paste it in the same OnbarUpdate() in NT8. Then it is a matter of going through the code. If you have already worked with NT8 code you already know some basic differences such as using brushes instead of colors, not using .Set() but using [0] instead, etc.

    Of course, you have to not worry about all the compile errors and simply fix the top one first before going on. This is where the code breaking changes come in very handy. At least that is one approach.

    Here are links to get you started:

    http://ninjatrader.com/support/helpG...?ns_wizard.htm
    http://ninjatrader.com/support/helpG...ng_changes.htm

    Alternatively, perhaps a forum member will step up and assist in conversion.

    If you would like it created/converted for you, we can always provide references to 3rd party coders who would be able to meet your needs.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Although Iam familiar with NT8, I am only now delving into the world of Ninja Scripting, so any additional pointers would be great. Ive attached the code I came across, altough I'll been giving this a go myself
      Attached Files

      Comment


        #4
        If you remove the exception from State.Configure - the one I gave you should do the same as that one I think as its not getting historical ticks just new ones as they come in - so that should work for daily...

        Remove this line:
        if (BarsPeriod.BarsPeriodType != BarsPeriodType.Minute) throw new ArgumentException("Indicator is only valid on Minute Data");

        Comment


          #5
          Thank you mate, thats very cool, I am taking a look.

          Why do you want the number of Ticks for a daily bar? Seems like a very low-level metric for such a long period - sort of like counting grains of sand in a bucket.
          I agree is pretty low level, but I think it's a descent high up overview of how active a product is. I can I see that CL has 200,000 ticks per day (on average), and Corn has 50,000 per day.. that tells that me that a 1000 tick bar chart of CL will develop about 4 times faster than the same chart for Corn, this provide a input for normalisation, altleast thats my thought

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by DJ888, 04-16-2024, 06:09 PM
          4 responses
          12 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by terofs, Today, 04:18 PM
          0 responses
          6 views
          0 likes
          Last Post terofs
          by terofs
           
          Started by nandhumca, Today, 03:41 PM
          0 responses
          5 views
          0 likes
          Last Post nandhumca  
          Started by The_Sec, Today, 03:37 PM
          0 responses
          3 views
          0 likes
          Last Post The_Sec
          by The_Sec
           
          Started by GwFutures1988, Today, 02:48 PM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Working...
          X