Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CloseD Series Function

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

    #16
    Originally posted by futurenets View Post
    - hope so but just making sure.

    but thanks for helping out.

    so say I have 500 5 minute sessions to backtest each one requiring a 100 day moving average - how many 5 minute bars do I need to load?
    That is certainly information that you can calculate, but is pointless. Just load 100 days. OK. maybe 105 days, for a cushion, and be about it. Leave it to the platform to calculate and load however many 5-minute bars that is. Why do you need to know?

    If you insist on knowing, as you are using only 5-minute bars, no matter how many sessions, it would not matter how many bars you have to load: it will be the same number, regardless of how many sessions you are running, albeit each session will have to load the bars for itself. It is still just the same data, being read from the same data files, so the bars will just be loaded from a cache, either by NinjaTrader or by the operating system.
    Last edited by koganam; 03-07-2016, 01:01 PM.

    Comment


      #17
      I realize this may be frustrating for you but please bear with me, this discussion has been very useful ...

      I just want to be aware of approx. how many 5 minute bars would actually need to be downloaded

      EURUSD 24 hours session has 24*60/5 = 288 5 minute bars

      daily MA at session 0 would need session 1 to session 100 bars = 288 * 100 = 28,800
      daily MA at session 1 would need session 2 to session 101 bars = 28,800 + (288 * 1) = 29088
      daily MA at session 2 would need session 3 to session 102 bars = 28,800 + (288 * 2) = 29376
      ...
      daily MA at session 100 would need session 101 to session 200 bars = 28,800 + (288 * 100) = 57600
      daily MA at session 200 would need session 201 to session 300 bars = 28,800 + (288 * 200) = 86400
      etc.

      is this correct? not even considering calculating daily MA Length > 100 (eg 200 day MA) or MA weekly/monthly yet.

      also if I have a daily chart that's running alongside my 5 minute chart, could the 5 minute chart reference the daily chart? if this was possible I could possibly create an equivalent CloseD series function?

      previously from NT
      You would create a script that runs on the other chart (the daily in this example) and then expose that data series - making sure it is synced to the primary series in the script and set to the desired value.
      but not sure how to do this?
      Last edited by futurenets; 03-08-2016, 03:40 AM.

      Comment


        #18
        Originally posted by futurenets View Post
        I realize this may be frustrating for you but please bear with me, this discussion has been very useful ...

        I just want to be aware of approx. how many 5 minute bars would actually need to be downloaded

        EURUSD 24 hours session has 24*60/5 = 288 5 minute bars

        daily MA at session 0 would need session 1 to session 100 bars = 288 * 100 = 28,800
        daily MA at session 1 would need session 2 to session 101 bars = 28,800 + (288 * 1) = 29088
        daily MA at session 2 would need session 3 to session 102 bars = 28,800 + (288 * 2) = 29376
        ...
        daily MA at session 100 would need session 101 to session 200 bars = 28,800 + (288 * 100) = 57600
        daily MA at session 200 would need session 201 to session 300 bars = 28,800 + (288 * 200) = 86400
        etc.

        is this correct? not even considering calculating daily MA Length > 100 (eg 200 day MA) or MA weekly/monthly yet.
        I do not understand what you are asking. Why would you have overlapping sessions? What information would require you to have 300 overlapping charts? I cannot answer, because I do not understand what you are trying to do.
        also if I have a daily chart that's running alongside my 5 minute chart, could the 5 minute chart reference the daily chart? if this was possible I could possibly create an equivalent CloseD series function?

        previously from NT but not sure how to do this?
        You can use some undocumented methods to have an indicator on one chart read data from a different chart, but why would you? You would have introduced another slow resource into your data processing, and have mandated that that slow resource must exist before you can even process your data.

        This same idea has been brought up before. Here is the thread. http://ninjatrader.com/support/forum...494#post427494

        Comment


          #19
          ok yes just seen it, give me 5 minutes
          Last edited by futurenets; 03-08-2016, 09:48 AM.

          Comment


            #20
            sorry about that mix up ...

            daily MA at session 0 (day 0) would need 288 bars = 288
            daily MA at session 1 (day 1) would need = 288 * 2 = 576
            daily MA at session 2 (day 2) would need = 288 * 3 = 864
            ...
            daily MA at session 100 (day 100) would need = 288 * 101 = 29,088
            daily MA at session 200 (day 200) would need = 288 * 201 = 57,888
            etc.

            is this the correct number of 5 minute bars required to plot a daily MA?
            Last edited by futurenets; 03-08-2016, 10:01 AM.

            Comment


              #21
              this is what I need

              This same idea has been brought up before. Here is the thread. http://ninjatrader.com/support/forum...494#post427494
              thanks for your help koganam

              any sample code?
              Last edited by futurenets; 03-08-2016, 10:21 AM.

              Comment


                #22
                if you have time koganam I'd like to know your thoughts on running a daily chart alongside a 5 minute chart with an array outside the namespace to hold previous 200 (or something) daily closing values. I understand this can be referenced by other charts.

                Again thanks for all your help (and patience), really useful.

                Comment


                  #23
                  Originally posted by futurenets View Post
                  this is what I need



                  thanks for your help koganam

                  any sample code?
                  There is no sample code from me, because, as I clearly say, it is a silly idea to process data in a slow, constrained manner, just so that one can read back that data. I write code to process data as efficiently as I can, not code that runs in a slow, and constrained manner.

                  Other than for visual purposes of confirmation, I do not care one hoot about displaying data on a chart, and I would most certainly never put data on a chart for the sole purpose of reading it back. It is beyond my ability to comprehend why anyone wants to do so, but to each one's own.

                  Comment


                    #24
                    Originally posted by futurenets View Post
                    if you have time koganam I'd like to know your thoughts on running a daily chart alongside a 5 minute chart with an array outside the namespace to hold previous 200 (or something) daily closing values. I understand this can be referenced by other charts.

                    Again thanks for all your help (and patience), really useful.
                    See my other response.

                    ref: http://ninjatrader.com/support/forum...d.php?p=451755

                    Comment


                      #25
                      Originally posted by futurenets View Post
                      sorry about that mix up ...

                      daily MA at session 0 (day 0) would need 288 bars = 288
                      daily MA at session 1 (day 1) would need = 288 * 2 = 576
                      daily MA at session 2 (day 2) would need = 288 * 3 = 864
                      ...
                      daily MA at session 100 (day 100) would need = 288 * 101 = 29,088
                      daily MA at session 200 (day 200) would need = 288 * 201 = 57,888
                      etc.

                      is this the correct number of 5 minute bars required to plot a daily MA?
                      Not really. No matter how you slice and dice it, you are going to need a minimum of 100 days loaded in order to calculate a correct value for the 100 day SMA. All your other calculations mean nothing. Once you hit that threshold, you will always require a previous number of bars equal to 100 days worth of data in order to calculate SMA(100): it is irrelevant if there are more than that many on the chart, though as a matter of fact, and as I have already said, NT, like most other charting packages uses a sliding window. That means that, generally speaking any data older than the days specified, will be seamlessly dropped from the chart, so incurring no further resource penalty.
                      Last edited by koganam; 03-08-2016, 01:17 PM.

                      Comment


                        #26
                        sorry I disagree,

                        inside or outside OOP protocol there are better ways than this. accessing a single value (in this case previous days closing price) on another chart once during each trading session is perfectly ok (albeit unsupported by NT).

                        As far as I'm concerned this is my equivalent of CloseD with very little effort (and much better than relying on 57,000 bars arriving without any problems).

                        I'll probably create a GLOBALS indicator until such time a formal solution is introduced by NT.
                        Last edited by futurenets; 03-09-2016, 05:37 AM.

                        Comment


                          #27
                          Originally posted by futurenets View Post
                          sorry I disagree,

                          inside or outside OOP protocol there are better ways than this. accessing a single value (in this case previous days closing price) on another chart once during each trading session is perfectly ok (albeit unsupported by NT).

                          As far as I'm concerned this is my equivalent of CloseD with very little effort (and much better than relying on 57,000 bars arriving without any problems).

                          I'll probably create a GLOBALS indicator until such time a formal solution is introduced by NT.
                          Your statement is not true, as an unreliable data stream on ANY time frame has exactly the same problem: unreliable results. If there are any errors in those 57,000 bars, they are also present in the daily bars. In any case, I have explained to you multiple times that at any data point only the last 28,800, 5-minute bars would be relevant to a 100 day calculation. It is beyond me why you persist in presenting faulty arithmetic. So whence the irrelevant data beyond 100 days?

                          However, to each his/her own. I shall now exeunt, as there is little, indeed nothing, that I can contribute further to this. You seem to think that this is a matter of opinion rather than analysis. I present analysis, with reasoning. You prefer to hand out an edict of your opinion. So mote it be.

                          All the best.
                          Last edited by koganam; 03-09-2016, 07:03 AM.

                          Comment


                            #28
                            your statement is incorrect, possibly over simplified (but understandable). thanks koganam for your input. my solution is working fine so no need to discuss further. find me and send your cv.
                            Last edited by futurenets; 03-09-2016, 08:50 AM.

                            Comment


                              #29
                              for future reference:

                              How to make two charts share variable values

                              Why would I wish to do this? Lets say I have a Weekly chart with a 50EMA on it and I wish to know the current value to plot on my 100 tick chart. I do not wish of course to take the usual course of adding at least 50 weeks of data onto my 100 tick chart ...
                              Attached Files
                              Last edited by futurenets; 03-10-2016, 03:52 AM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              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
                              7 views
                              0 likes
                              Last Post maybeimnotrader  
                              Started by quantismo, Today, 05:13 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post quantismo  
                              Started by AttiM, 02-14-2024, 05:20 PM
                              8 responses
                              168 views
                              0 likes
                              Last Post jeronymite  
                              Started by cre8able, Today, 04:22 PM
                              0 responses
                              10 views
                              0 likes
                              Last Post cre8able  
                              Working...
                              X