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

tick data access in indicator & P&F chart/data series

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

    tick data access in indicator & P&F chart/data series

    Hello my goal is the following -

    To have an indicator which has primary data series P&F based on say 150 ticks.... how to retrieve the tickcount for the current column and previous columns … this I guess would be in a similar manner that NT displays the value in the VOL indicator based on P&F based on tick data eg 150 ticks. How does NT do this ie access tick data series and then display in the vol field for Range bars and also P&F charts?

    I have tried using the Volume[0] Volume[1] fields in indicator but it retrieves the same value even if previous P&F columns had different tick counts as can be seen visually on a chart.

    I would like to then do this in a multi – series indicator with Minute bars eg 10 and then with a P&F tick data series – and be able to correlate the ticks in the current or previous P&F column with the current or previous Minute bar. Is this feasible.

    Perhaps I need a tick data series in addition to above and work with this?

    I have gone over the online NinjaScript language and data references and looking to see how to do this.

    The OnBarUpdate I would plan on setting to CalculateOnBarClose and then determining if the event was for minute bar close or P&F column close and then proceed to calculate.

    Processing on a tick by tick basis I understand there is a check for the firsttickofbar.

    I am trying to do the above for forex instruments which i realise is not centralised. Also i realise the volume field for minute data is separate to the tick data in the database.

    NT does do something with this when you add the VOL indicator for a P&F (based on ticks) or Range bar chart ie it calculates using the tick data and not the minute data; and you can see this when you display on a chart.

    Please let me know if any further clarification on question needed.

    thanks

    #2
    Hello,

    Thanks for the note.

    So just to clarify. Your saying that your using Volume[0] or VOL[0] and it is outputing a volume however you don't think this volume is correct on PnF charts?

    VOL should work, and will report the underlying data volume for the PnF bar based on that bar. Are you seeing different? If so what VOL are you getting and what VOL do you expect?

    I look forward to assisting you further.

    Comment


      #3
      Originally posted by NinjaTrader_Brett View Post
      Hello,

      Thanks for the note.

      So just to clarify. Your saying that your using Volume[0] or VOL[0] and it is outputing a volume however you don't think this volume is correct on PnF charts?

      VOL should work, and will report the underlying data volume for the PnF bar based on that bar. Are you seeing different? If so what VOL are you getting and what VOL do you expect?

      I look forward to assisting you further.
      Thanks for the prompt reply. I reviewed the code and put in some print/debug statements and realised in my haste of cut and paste the #region properties which requires methods for added plots which i added for market analyser was returning the same value - so my error. But thank you for confirmation and glad to see i was on the right track in applying this to the p&f data series.

      The next part in a multi-series indicator with minute data say 15 and p&f tick data as the 2nd series. On bar close of the minute bar can i sample the data held for the p&f column which i realise will not have closed as is not based on time. I am just trying to contrast some data here. Ultimately would like to see if i can get an approximation of the ticks (not volume) that represent the 15M bar. Is there a function/method to do this in ninjascript? I realise the ticks are held separately in the DB from minute data.

      thanks again for you prompt reply

      Comment


        #4
        Hello,

        Glad to hear.

        So are you trying to count ticks in the 15 minute data series or the PnF data series?

        I look forward to assisting you further.

        Comment


          #5
          Hello am managing to work with what i have so far - but yes the question would be can i retrieve the tick count for the 15M series ie each 15M bar? The database for minute and tick data is separate as you know. The broker or data provider that populates the volume field of the minute data as seen in the Historical data manager - can one assume that this will be the tick count for that period and will correspond to the the number of ticks shown in the Tick part of the data (where each tick volume default to 10000). The point being i dont want to Presume anything here - my sense is the broker volume field is populated with volume obviously pertaining to that broker. I do see anomolies at times when using the tick data series and these can be useful at times.

          I see there is an indicator method TickCount - which pertains to the tick count for the current bar.
          Is there a version to use in an indicator that goes over the history too? Or would that require some inner calculation and maintenance on my part to do this ?
          Hope i havent confused you but hope you can see where i am coming from ...

          thanks in advance

          Comment


            #6
            soulfx, I will have Brett get back to you tomorrow.
            AustinNinjaTrader Customer Service

            Comment


              #7
              Hello,

              You can use

              http://www.ninjatrader.com/support/h.../tickcount.htm

              This should do the trick for you and will work on historical as well.

              Let me know if I can be of further assistance.

              Comment


                #8
                Hello, ok thanks i was aware of that method and when i use it for say a 10 or 15M data series i get the same value for each bar on the chart - ie each 10M bar has the same number of ticks which is NOT the case. Since Ticks are not time imposed how can each Bar have the same number; this can be verified on looking at the Tick part of the database for the instrument in question. So the question would be which dataseries/data set does the TickCount method use. For example when a range bar chart is displayed and you add VOL to the chart you see the ticks for each range bar - NT is using the Ticks in the database to calculate this ? So again in the same way i want the ticks per 5 10 or 15Minute bar etc. Can i retrieve this or do i need to maintain and calculate this myself? thanks

                Comment


                  #9
                  Hello,

                  TickCount only works in realtime moving forward. The reason why it is this was as we dont have access to tick data on minute bars for example. You can only get this if you get the real time feed in. Minute data is only the high low and close of 1 minute and no access to total ticks on this data type. Therefor to do this what you may need to track this yourself with a secondary tick data feed and add the ticks together if they are in your time frame of the bar.

                  Let me know if I can be of further assistance.

                  Comment


                    #10
                    OK - well that makes sense .. i suspected it only worked real time moving forward as i believe some NT indicator vendors have written indicators that only work on real time data to chart and wont apply to history data.

                    Im not sure what you mean by ' You can only get this if you get the real time feed in ' ?
                    Are you saying that the broker or data feed would need to supply this in the Minute data type or currently the Minute data type does not support this feature. Out of interest does the esignal data feed support this as i know from trialing in the past that GTIS feed is quite comprehensive. Indeed do any of your supported data suppliers provide this to your knowledge? Or again i would need to program this with a tick data series in my indicator to keep track?

                    thanks for help with this, at least i am narrowing this down and perhaps seeing some of the restrictions to this.

                    Comment


                      #11
                      Hello,

                      no problem.

                      Any chart will work as long as its live only on the live bar. Since NT can only count ticks on the live bar.

                      Let me know if I can be of further assistance.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by bmartz, 03-12-2024, 06:12 AM
                      4 responses
                      31 views
                      0 likes
                      Last Post bmartz
                      by bmartz
                       
                      Started by Aviram Y, Today, 05:29 AM
                      4 responses
                      12 views
                      0 likes
                      Last Post Aviram Y  
                      Started by algospoke, 04-17-2024, 06:40 PM
                      3 responses
                      28 views
                      0 likes
                      Last Post NinjaTrader_Jesse  
                      Started by gentlebenthebear, Today, 01:30 AM
                      1 response
                      8 views
                      0 likes
                      Last Post NinjaTrader_Jesse  
                      Started by cls71, Today, 04:45 AM
                      1 response
                      7 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Working...
                      X