Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I like HLC bars and I have tried the indicators on nexusfi.com (formerly BMT), but these are not a new type of bar objects and they do not get coloured by paint bar indicators for that reason.
I have looked for and found a way to add a new chart style for NT7, which does work with indicators that colour bars. This will be interesting if you want to see how to create a new chart style or if you want the option to use HLC bars.
NT has been extended to include Bloomberg style Mountain Charts by creating a new chart style. Taking that as an inspiration, I copied code from @ChartStyles.cs [1] for the OHLC chart style and modified that code to only show the HLC parts.
I am new to C# and NT and this is an advanced modification, so I would appreciate a review of the code by the experienced members, before posting the new chart type for general use.
Please take a look at the code and let me know if any modifications are needed. The version 1.0 copy is attached.
In my own tests it works fine, but I don't want to release this if there are obvious flaws!
Installation
Download HlcChartStyle.zip, then follow the usual import procedure. File, Utilites, Import NinjaScript
Use
Open a new chart and select HLC as the chart style or open the data series in an open chart and select HLC. These are the same steps you would follow to change from OHLC to CandleStick. Do not look for an indicator, because my code is not an indicator, its a new chart style.
Code Modification
This is not an indicator and you need to follow this method to make changes.
Copy the Type directory from the zip file to your disk.
Edit HlcChartStyle.cs with your text editor.
Delete the Type folder from the zip file and replace with the modified version.
Re-import the ChartType and accepting the warnings
Removing the New Chart Type
I am not sure how to completely remove the new chart style, but I can confirm that it can't be done by the method you use to remove an indicator via the NT GUI. After installing the new chart type, you should see HlcChartSyle.cs in the directory [1], but there may be other places with references to the chart style. So it may not be as simple as deleting the cs file from [1].
My Guess Work
@BarTypes [1] contains references to ChartStyleType.Custom0 to 9 and I do not understand how these work. The Mountain style chart has base(ChartStyleType.Custom3) and that did not work for me, so I tried Custom0 and that did work.
I don't know if these are "slots" that can be used or different specifications. For example, I installed the Mountain style charts first and that may have used up the "slot" for Custom3 and that may be why I was unable to get things to work. If that is correct, Custom0 may have worked because the slot was free on my machine.
If the Custom0-9 styles are slots, there could be deployment issues as the slot is hard coded into the new type and there may be a problem if that slot is already in use (not too likely, unless it becomes popular to create new chart styles!).
Line 97 public HlcChartStyle() : base(ChartStyleType.Custom0)
Screenshot showing HLC bars, coloured by Better ProAm