Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

UniRenko

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

    UniRenko

    Hi folks

    UniRenko is an extremely effective bar type available in the downloads section.

    Usually bar types have just one parameter so modification is easy.

    However, there are three parameters with Unirenko, described on the downloads page as follows:

    'Tick Trend' - Number of ticks to close the bar in the Trend direction
    'Tick Reversal' - Number of ticks to close the bar in the Reversal direction
    'Open Offset' - Number of ticks offset to draw the artificial open
    I only ever use the following multiples:

    'Tick Reversal' = 2 x 'Tick Trend'

    and

    'Open Offset' = 'Tick Trend'

    I'm wondering if there's some way to modify something somewhere (so these relationships are the default) so that I only need to change one parameter rather than all three, as it be quite time consuming having to change all three when testing charts.

    I've got a feeling this may be a bit tricky but any advice would be much appreciated.

    #2
    Hello Varbuthnot,

    Thanks for your post.

    Your can set default vales for chart types by right clicking on your chart and selecting Data Series.
    Enter the desired parameters.
    Right click on the parameters and select 'Set default for ____ chart type'.

    Comment


      #3
      Thanks, Brandon, but that's not quite what I meant.

      I didn't mean a default value. What I'm looking for is a way so that I only have to enter one parameter rather than three.

      At the moment, Unirenko users have to change all three parameters to get a new chart. But is there conceivably a way of linking the parameters mathematically, as I described, so that only one parameter needs to be changed rather than all three?

      If this were an indicator, there would be no problem but the code for bar types is more arcane and seemingly locked up somewhere deep in the system.

      Thanks for your further advice.

      Comment


        #4
        Hello arbuthnot,

        Thanks for your reply.

        To do this would require custom coding. I will move your inquiry to the NinjaScript section and have a NinjaScript representative follow up with you.

        Comment


          #5
          Thanks very much, Brandon.

          Looking forward to hearing from your colleague.

          Cheers.

          Comment


            #6
            Hello arbuthnot,

            Please note that this is not supported. To accomplish this you would likely want to remove the two mathematically set parameters from appearing in the user interface. This would involve adjusting the GetProperties method like the following:
            Code:
            public override PropertyDescriptorCollection GetProperties(PropertyDescriptor propertyDescriptor, Period period, Attribute[] attributes)
            {
            	PropertyDescriptorCollection properties = base.GetProperties(propertyDescriptor, period, attributes);
            
            	properties.Remove(properties.Find("BasePeriodType",  true));
            	properties.Remove(properties.Find("PointAndFigurePriceType", true));
            	properties.Remove(properties.Find("ReversalType", true));
            [COLOR="DarkRed"]	properties.Remove(properties.Find("Value2", true));
            	properties.Remove(properties.Find("BasePeriodValue", true));	//### Remove to customize OpenOffset[/COLOR]
            	Gui.Design.DisplayNameAttribute.SetDisplayName(properties, "Value",  "\r\rTick \rTrend");
            
            	return properties;
            }
            Then you would need to adjust the //### First Bar section to something like this:
            Code:
            	//### First Bar
            if ((bars.Count == 0) || bars.IsNewSession(time, isRealtime))
            {
            	tickSize = bars.Instrument.MasterInstrument.TickSize;
            
            	trendOffset    = bars.Period.Value  * bars.Instrument.MasterInstrument.TickSize;
            [COLOR="DarkRed"]	reversalOffset = (bars.Period.Value* 2) * bars.Instrument.MasterInstrument.TickSize;
            	openOffset = Math.Ceiling((double)bars.Period.Value * 1) * bars.Instrument.MasterInstrument.TickSize;[/COLOR]
            
            	barOpen = close;
            	barMax  = barOpen + (trendOffset * barDirection);
            	barMin  = barOpen - (trendOffset * barDirection);
            
            	AddBar(bars, barOpen, barOpen, barOpen, barOpen, time, volume, isRealtime);
            }
            Please note if you create this as a new custom bar type instead of directly writing over the UniRenkoBarType.cs file you will have conflicting Custom Bar Type IDs because they both will be using the Custom5 slot. To modify this to a value that is not being used, please change this part of the code:
            Code:
            public UniRenkoBarsType() : base([COLOR="DarkRed"]PeriodType.Custom5[/COLOR]) { }
            You can change it to PeriodType.Custom6, PeriodType.Custom7, etc until you find a number that works.

            My best practice when modifying bar types is to exit ninja trader before I save any code into the Types folder. Then I restart NinjaTrader, and recompile by navigating to Tools -> Edit NinjaScript -> Indicator -> [any indicator] -> Press F5 on my keyboard to recompile then I will test my changes to the custom bar type by opening a new chart.

            Please let me know if you experience any difficulties or if you have any questions.
            Michael M.NinjaTrader Quality Assurance

            Comment


              #7
              Thanks very much, Michael. That's terrific - all the more so as this is unsupported.

              It's very late here now so I'll try to look at this in detail over the next day or two.

              Comment


                #8
                Thanks again, Michael.

                If I need to edit an indicator or strategy, I go to Tools => Edit NinjaScript.

                but 'bar type' files must be stored elsewhere. Could you kindly post a quick note to let me know where I can find the relevant file for Unirenko?

                Much obliged.

                Comment


                  #9
                  Hello arbuthnot,

                  Your custom bar type file should be found in the (My) Documents\NinjaTrader 7\bin\Custom\Type folder. It will normally be at the bottom of the list.

                  If the code I provided is giving you problems, please make sure to set the bars.Period.BasePeriodValue = bars.Period.Value, and the bars.Period.Value2 = 2 * bars.Period.Value at the very top of the //### First Bar section.

                  Please let me know if I may be of further assistance.
                  Michael M.NinjaTrader Quality Assurance

                  Comment


                    #10
                    Thanks very much, Michael, for directing me to the Custom\Type folder with the Unirenko file.

                    When I open this, it appears as a Notepad text document. Is it sufficient to modify/'save as' this text file or is there a way of opening an actual NinjaScript-based document?

                    Forgive me for asking these elementary questions. I've worked on many indicators and strategies but this is the first time I've tried to work on a 'chart type'.

                    Comment


                      #11
                      Hello arbuthnot,

                      You can open and modify the file in notepad, however you need to make sure it is saved as a .cs file. In notepad you need to go to File -> Save As and make sure the end of the filename is .cs and that "Save as type" is set to "All Files (*.*)". Please see the attached screenshot for reference.

                      Remember that every time you edit and save a .cs file in this folder you need to restart NinjaTrader, then naivgate to Tools -> Edit NinjaScript -> Indicator -> [select any indicator] -> when the code editor pops up press F5 on your keyboard to recompile the code. Then you can test your changes in the bar type.

                      Please let me know if I may be of further assistance.
                      Attached Files
                      Michael M.NinjaTrader Quality Assurance

                      Comment


                        #12
                        That's terrific, Michael. Based on all the information you've kindly supplied me, I should be able to make progress with this.

                        Comment


                          #13
                          Hello arbuthnot,

                          It is always my pleasure. Please have a great rest of your day!
                          Michael M.NinjaTrader Quality Assurance

                          Comment


                            #14
                            Hello,

                            I am also using unirekno and they are great.

                            I am trying to play with different settings of unirenko and I am wondering if all theree parameters can be optimize in genetic or default optimizing tools. Currently only no of trend ticks can be modified when checking option data series.

                            Is there some way to optimize, backtest all three parameters?

                            Thank you

                            Comment


                              #15
                              Originally posted by miroslav View Post
                              Hello,

                              I am also using unirekno and they are great.

                              I am trying to play with different settings of unirenko and I am wondering if all theree parameters can be optimize in genetic or default optimizing tools. Currently only no of trend ticks can be modified when checking option data series.

                              Is there some way to optimize, backtest all three parameters?

                              Thank you
                              When you try to optimize the DataSeries, it should show you all those parameters. Yes, you have to explicitly mark the option to optimize the DataSeries.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              603 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              349 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              104 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              560 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              560 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X