Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom Bar DataSeries

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

    Custom Bar DataSeries

    I understand, that I can make Custom Dataseries with Series<T> which alow me to store one double value e.g. Close. I wonder if I can make a Bar like DataSeries with custom Open,Close,High,and Low Values which alows me to access the the vals like a normal Instrument Data Series.

    Thanks!
    Frank

    #2
    Hello starcd,

    Thanks for your post.

    To clarify, for each bar, there are several data series such as Open, High, Low, Close, Volume, Time, Weighted, Typical, Median, please see: https://ninjatrader.com/support/help...riceseries.htm You can certainly duplicate by having the same number of data series or as many as you need. There is not one data series that would contain all of the information.

    Reference: https://ninjatrader.com/support/help...ice_series.htm
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      I want to modify the val of open close high low of every bar. And access them as second Dataseries via Opens,Closes,Highs,Lows[1][0] and give this modified vals in one shot to indicators via BarsArray.

      Comment


        #4
        Hello starcd,

        Thanks for your reply and clarification of what you wish to accomplish.

        It is not possible to create a bars object that holds multiple series.

        Indicators are not designed to accept multiple series in its parameters. You can create a custom indicator that has multiple series and then set those series from a calling host script.



        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Just to highlight alternatives if not clear. You could just use 5 separate data series in the data series for each aspect, Open, High, Low, Close, Volume. Set them from the actual bar data and then modify as you see fit. Another alternative is this might be a use case for a custom bar type. Where you control the bars open, high, low, close with the code in the custom bar type. I'm not sure if you would want that but just for completeness on options available.

          Comment


            #6
            Originally posted by NinjaTrader_Brett View Post
            Just to highlight alternatives if not clear. You could just use 5 separate data series in the data series for each aspect, Open, High, Low, Close, Volume. Set them from the actual bar data and then modify as you see fit. Another alternative is this might be a use case for a custom bar type. Where you control the bars open, high, low, close with the code in the custom bar type. I'm not sure if you would want that but just for completeness on options available.
            So, kind of hijacking here...but I think it might be on topic.....


            I have an indicator that does exactly this. I create 4 internal data series(OHLC) that the indicator populates with custom calculated values.

            I have a custom OnRender that uses the 4 series and renders them as candles. Works great.

            I'd like my indicator to expose a property of type Bars or PriceSeries that would "wrap" my custom OHLC values.

            The purpose of this would be to allow end-users to "feed" the exposed Bars-PriceSeries property into other indicators that expect an Instrument(Bars or PriceSeries) Input Series. Just to be very explicit, I'm talking about an Indicators "Data Series"->"Input Series" property.

            This would add a lot of flexibility. I do see some other posts asking for basically the same thing, usually around the subject of synthetic instruments or feeding multiple Series<T> into an indicator.

            I *think* almost all the pieces are currently in place. So here is some pseudo-code of what i have in mind. Works much like a custom series

            Code:
            public class GameChanger : Indicator
            {
                 private Series<double> series1;
                 private PriceSeries priceSeries1;
            
                 protected override void OnStateChange()
                 {
                      ........
                      else if (State == State.DataLoaded)
                      {
                           series1         = new Series<double>(this);
                           priceSeries1 = new PriceSeries(this);  //Aligned PriceSeries, just like Series above
                      }
                 }
            
                 protected override void OnBarUpdate()
                 {
                      series1[0] = High[0] - Low[0];
            
                      priceSeries1.Bars.High[0] = High[0] *2;
                      priceSeries1.Bars.Low[0] = Low[0] *2;
                      priceSeries1.Bars.Open[0] = Open[0] *2;
                      priceSeries1.Bars.Close0] = Close0] *2;
                      priceSeries1.Bars.Volume[0] = Volume[];
                 }
            
                 [Browsable(false)]
                 [XmlIgnore()]
                 public PriceSeries PriceSeries1
                 {
                      get
                      {
                           Update();
                           return priceSeries1;
                      }
                 }
            }
            And when adding an indicator to the chart, the Indicators "Data Series"->"Input Series" property would look like:
            GameChanger(ES 03-20 (5 Minute)).PriceSeries1


            Also, at this point, seems like it might be possible to feed it into a chart as the Charts "Data Series" property, save me and other developers the trouble of having to re-implement candlestick drawing in OnRender.....



            Click image for larger version  Name:	4d8yc3.jpg Views:	0 Size:	60.8 KB ID:	1116131

            Comment


              #7
              starcd - there already is a 'Bar like DataSeries", it's named PriceSeries.
              NinjaTrader_Brett

              I made a meme, means you have to do this now Ninjatrader.

              I gave it a shot, was able to create the PriceSeries. It looked like the PriceSeries I created had the same OHLC values of the Chart Data Series Open[], High[] Low[] and Close[].

              I could not find a way to update the values in priceSeries1. Only thing I found was a few Add methods, AddBar and RemoveBar. I tried to call those, but no values were modified.

              Also, when calling Add in OnBarUpdate() I hit a threading exception around the Read-Write locks. I was able to "fix" the threading exception using priceSeries1.SyncRoot.XXXX, but still could not actually update priceSeries1.

              Comment


                #8
                Hello michelm,

                Thanks for your posts.

                The add method would be for bartypes only.

                We've added your vote to an existing feature request identified as SFT-1606, "Indicators on Indicator support for indicators which would use High/Low/etc.".

                Feature Request Disclaimer.
                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.
                When new features are implemented, they will be listed in the Release Notes page of the Help Guide. The ID number will 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.
                Release Notes - https://ninjatrader.com/support/help...ease_notes.htm
                Paul H.NinjaTrader Customer Service

                Comment


                  #9
                  How about a second vote on behalf of @starcd ?

                  Comment


                    #10
                    Hello michelm,

                    Thanks for your post.

                    Yes, of course.

                    Paul H.NinjaTrader Customer Service

                    Comment


                      #11
                      3rd vote for me please!
                      Attached Files

                      Comment


                        #12
                        Hello sdrymer,

                        Thanks for your post.

                        Your vote has been added.
                        Paul H.NinjaTrader Customer Service

                        Comment


                          #13
                          Could I create 4 properties on my indicator that allows the user to specify 4 input series that the indicator could use internally?
                          I'd like to do something like:
                          Code:
                          [TypeConverter(typeof(NinjaTrader.Gui.Tools.InputSeriesConverter))]
                          [Display(Order = 01, Name = "High", GroupName = "OHLC")]
                          public Series<double> HighSeries { get; set; }
                          
                          [TypeConverter(typeof(NinjaTrader.Gui.Tools.InputSeriesConverter))]
                          [Display(Order = 01, Name = "Low", GroupName = "OHLC")]
                          public Series<double> LowSeries { get; set; }
                          
                          [TypeConverter(typeof(NinjaTrader.Gui.Tools.InputSeriesConverter))]
                          [Display(Order = 01, Name = "Open", GroupName = "OHLC")]
                          public Series<double> OpenSeries { get; set; }
                          
                          [TypeConverter(typeof(NinjaTrader.Gui.Tools.InputSeriesConverter))]
                          [Display(Order = 01, Name = "Close", GroupName = "OHLC")]
                          public Series<double> CloseSeries { get; set; }
                          So in the Indicators Property Grid, I would have 4 fields displayed that look and work like the Instruments standard "Data Series" Group "Input Series" field. At that point, I could select 4 Indicators Series to feed back into the instrument, something like:
                          High Gamechanger(Spy).High
                          Low Gamechanger(Spy).Low
                          Open Gamechanger(Spy).Open
                          Close Gamechanger(Spy).Low

                          I can't figure out to create the 4 properties that behave like the properties grid "Data Series" Group "Input Series" field...



                          Comment


                            #14
                            Hello michelm,

                            Thanks for your post.

                            I believe there have been others that have tried this approach as well and without success. To that end, I have added your vote to SFT-1513, "Input series selector as property".

                            An alternative you might consider is to create an enum of indicators to select from and the same with price type.
                            Here is a link to an example that may be helpful: https://ninjatraderecosystem.com/use...acrossbuilder/
                            Please note: The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
                            Paul H.NinjaTrader Customer Service

                            Comment


                              #15
                              I also need some help. I am new to NT8. Long back I used NT7 but then shifted to Amibroker. Now I am again using NT of version 8. I am missing a few things in order to customise my chart the way I need it. As a newbie I have some queries.
                              1. How to set thick Black Verucal Grid line to Mark a new Day beginning while leaving other vertical lines as default.
                              2. Same about Price Marker: I want to set it as distinctive Dark or some other color to distinguish it from indicators Marker visually.
                              3. I want to create an Indicator(Indicator(Indicator) such as: x1 x1= EMA(TEMA(C, P1), P2) ;
                              x2 = EMA(x1, P3) ;
                              I was able to create x1 by selecting and changing Input series. But I am unable to create x2.
                              Any help from NT8 experts will be highly appreciated and I will be so grateful. Thanking you for a great trading software like NT8.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by inanazsocial, Today, 01:15 AM
                              0 responses
                              2 views
                              0 likes
                              Last Post inanazsocial  
                              Started by trilliantrader, 04-18-2024, 08:16 AM
                              5 responses
                              22 views
                              0 likes
                              Last Post trilliantrader  
                              Started by Davidtowleii, Today, 12:15 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post Davidtowleii  
                              Started by guillembm, Yesterday, 11:25 AM
                              2 responses
                              9 views
                              0 likes
                              Last Post guillembm  
                              Started by junkone, 04-21-2024, 07:17 AM
                              9 responses
                              71 views
                              0 likes
                              Last Post jeronymite  
                              Working...
                              X