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

Loading Weekly and Monthly Data on a 2 min chart

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

    Loading Weekly and Monthly Data on a 2 min chart

    Hi there,

    I want to be able to display prior week, month and quarter HLC on a 2 min chart without having to load up to 6 month worth of 2-min data (that is if I would want to calculate last quarter's HLC in December). There's gotta be a way to retrieve the values of the last 5 monthly candles on a small timeframe chart without having to set the number of "days to load" field in the Data Series up to 200 days. Loading all this data is such an overload on performance and switching from let's say a 2-min to a 10-min chart takes far too long, because again the load time for all the unnecessary data is such a bottle-neck.

    Even with an inferior product like MetaTrader this is not a problem at all. If it isn't possible in NT to achieve such a small feat, when will this be rectified?

    Please advice - Thank you

    #2
    Hello abctrader,

    With a custom indicator you can add a data series and set a plot value to the higher time frame, as well as set the value to the previous bar when higher time frame is not updating.

    Below is a link to an example.


    You will need to load the full data for all series.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Looks to me that the examples you provided all reference a plot e.g. for a calculate EMA, etc. This is NOT what I need though.

      In plain words I want to achieve the following:

      on a 2-min chart with max of 3 days worth of data I want to be able to plot the current week high / low along with the current month high / low plus also the previous week, month HLC. This HOWEVER, without having to load the past 60 days worth of data.

      Values [0][0] is only populated by calling the AddPlot method though ...

      When using the AddDataSeries method I know how to access the historical data via Highs[1][0], Lows[1][0], etc. How do I access the current (weekly) high / low values though???

      Thanks for your help

      Comment


        #4
        Trying to come up with an indicator that plots different EMA's / SMA's on to a chart, but no luck so far ...

        MMM2MovAvgs.cs (this is the example with just 2 MA's, but even that one doesn't show up correctly. It only displays properly (hourly 25-SMA and daily 8-EMA) when at least 8 days of days are loaded on to the chart)

        thanks for ur help

        P.S. this is one issue;

        I also still would like to be able to access current weekly and monthly high / low values without having to load a lot of days into the chart for performance reasons.
        Attached Files
        Last edited by abctrader; 12-06-2021, 07:59 AM.

        Comment


          #5
          Hello abctrader,

          Don't focus on the indicator. This is a code example of how to plot a higher time frame on a lower time frame chart, with any indicator plot.

          Is this not what you are trying to accomplish?

          If you are not wanting to plot a higher time frame plot on a lower time frame chart, can you clarify what you are trying to accomplish?

          Unfortunately, that is not how NinjaTrader works. Indicators will need to load all of the days of data for all series.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            "Unfortunately, that is not how NinjaTrader works. Indicators will need to load all of the days of data for all series."

            This is exactly the big drawdown for NT ... I want to display the 13,50 and 200 daily MA on a 5 min chart without having to load 200 days worth of data ...
            In every other trading software I traded with so far, I was able to load the last 200 daily candles and determine and determine whatever I wanted with that data. But I didn't have to load 200 days of 5 min data in order to do so. If NT isn't capable of doing such a small feat, it's very poorly designed and performance is therefore terrible.

            My other issues I have is how can I determine the current weekly high /low. Obiously on a Monday it's today's high / low, but there has to be a way if we trade on Friday to load Monday to Thursday daily candles with their respective HLC values without having to load all this data into the chart in a small time-frame (e.g. on a 2-min chart), when all I need is the OHLC from the past 4 days of data ...

            Please advice of how to do that. Thank u

            Comment


              #7
              Hello abctrader,

              You could use a variable. If the bar high is greater than the saved value, save the value to the variable. Reset this at the start of a new week to the open.

              Below is a link to an indicator found searching the User App Share.
              Based on CurrentDayOHL indicator. CurrentWeekOHL will draw lines on your chart: Open, High, Low for the given week. You can select on which day the indicator should start calculating from. An example to access the week open value: double currentWeekOpenPrice = CurrentWeekOpen(true,true,true,DayOfWeek.Monday).C urrentWeekOpen[0]; Enjoy
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                I'm aware of this indicator and that's the logic I already incorporated into my coding (awa the monthly version of it). This indicator also requires to load a week (or month) worth of 5-min data into a chart for it to work properly. That's such an overhead which is a big hit on performance. So, there is no way to access the current weekly candle?

                In MetaTrader it's done via a simple statement: ArrayCopyRates(weekly_prices, (Symbol()), PERIOD_W1); this copies all the weekly candles into an array and can easily be accessed via

                low = weekly_prices[0][2];
                high = weekly_prices[0][3];

                I do not have to load umpteen low time-frame candles onto a chart to access past weekly, monthly data.

                Is this not possible in NT?

                Comment


                  #9
                  Hello abctrader,

                  The data that loads with the Data Series is the data available to the script.

                  AddDataSeries() does have an overload with barsToLoad.


                  You could also do a BarsRequest to get arbitrary data out of sync with the script and use this in calculations, but this cannot be supplied to an indicator.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    Well, this seems to be the solution I need, but for indicator development, so if this can't be used in an indicator it's of no value. I'm not sure if you guys work on a new NT release, but I would highly recommend this feature to be implemented in future releases. In the meantime I'll be shopping for a new platform to trade with.

                    Comment


                      #11
                      Hello abctrader,

                      I will submit your feature request.

                      Once I have a tracking ID for this request I will post in this thread for future reference.
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        Hello abctrader,

                        Thanks for your patience.

                        This is Brandon responding on behalf of Chelsea who is out of the office at this time.

                        The internal tracking number for your feature request is SFT-2571. Please reference this internal tracking number when contacting Platform Support if you ever have questions regarding this feature request.

                        When a feature request is implemented, you'll find a description of the new feature in the release notes:Let us know if we may assist further.
                        Brandon H.NinjaTrader Customer Service

                        Comment


                          #13
                          What's the status of this request? The whole design of NT8 is flawed. It makes it basically impossible to switch quickly from a 2min timeframe to a 30 min and back, especially if you've got a couple of indicators on the chart (e.g. weekly and monthly pivots). Unless you fix this issue ASAP your platform is loosing out to Sierra Charts and tons of others which have a much better structure and design to begin with. If you want to survive in this busines it's about time you address this issue.

                          Comment


                            #14
                            Hello abctrader,

                            Please note, we receive many requests and cannot reasonably implement all requested features or changes. Interest is tracked internally and if enough interest is tracked, it would be weighed against how feasible it would be to make those changes to consider implementing, so we cannot offer an ETA or promise of fulfillment.

                            When new features are implemented, they will be listed in the Release Notes page of the Help Guide. The ID number may be different than the internal feature request tracking ID, but the description of the feature will let you know if that feature has been implemented.

                            Unfortunately, we cannot provide an ETA of any feature request or bug report.

                            Release Notes - https://ninjatrader.com/support/help...ease_notes.htm
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #15
                              just go and switch from a 2 min timeframe to a 15min to a 1h and back to a 10min - NinjaTrader is terrible responding to these steps in a timely manner, especially if you have weekly and monthly pivots applied to the chart. In ANY other platform (even a terrible platform like MetaTrader) this can be achieved without any interruption and hesitation. NinjaTrader's architecture is terrible when it comes to analyzing charts. So, if you guys want to stay in this game for good, you have to address this issue ASAP. You are loosing customers left and right to Sierra Charts otherwise.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by gravdigaz6, Today, 11:40 PM
                              1 response
                              7 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Started by MarianApalaghiei, Today, 10:49 PM
                              3 responses
                              10 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Started by XXtrader, Today, 11:30 PM
                              0 responses
                              4 views
                              0 likes
                              Last Post XXtrader  
                              Started by love2code2trade, Yesterday, 01:45 PM
                              4 responses
                              28 views
                              0 likes
                              Last Post love2code2trade  
                              Started by funk10101, Today, 09:43 PM
                              0 responses
                              9 views
                              0 likes
                              Last Post funk10101  
                              Working...
                              X