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.
    https://ninjatrader.com/support/foru...196#post820196

    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, 06: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.
              https://ninjatraderecosystem.com/use...urrentweekohl/
              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.
                  https://ninjatrader.com/support/help...dataseries.htm

                  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.
                  https://ninjatrader.com/support/help...arsrequest.htm
                  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

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by whiterhino, Today, 01:18 AM
                        1 response
                        11 views
                        0 likes
                        Last Post NinjaTrader_Manfred  
                        Started by ラリー, Yesterday, 11:17 PM
                        1 response
                        16 views
                        0 likes
                        Last Post NinjaTrader_ChrisSch  
                        Started by ラリー, Yesterday, 06:14 PM
                        1 response
                        12 views
                        0 likes
                        Last Post ラリー  
                        Started by relogical, Yesterday, 05:20 PM
                        0 responses
                        18 views
                        0 likes
                        Last Post relogical  
                        Started by vivekniwas, Yesterday, 05:11 PM
                        0 responses
                        15 views
                        0 likes
                        Last Post vivekniwas  
                        Working...
                        X