Hi Programmers Apprentice
I have a request for some coding help, which concerns the Custom time Frame View.
I keep coming back to modifying the Custom Time Frame View extension.
What I have already done is I have modified this, so that for example I create a separate view for time frame ranging from m5 to m50.
I have been using this for a while now but keep tweaking to get to my ideal configuration.
In this I have several drop down menus I have made, one which has 10 entries for changing the tf multiplier.
Then a second for changing the desired output tf, again with 10 entries.
And third, I have a dropdown for the tab label, again with 10 entries.
Then what I have done is all these dropdowns have been modified so that they all display one of 10 entries, because the code has been written so that by choosing the m5 on the base tf I automatically choose m5 time frame base.
Then on the second by choosing the m5 on the output tf dropdown, this again automatically chooses the correct multiplier, in this case 1 to make m5 (base tf) x 1 (Output TF multiplier) equals m5.
And last the corresponding label which also says m5 so that the tab displays the m5 text, again automatically.
So all 3 corresponding dropdowns say m5, and every different tf has a different set of dropdowns.
And so on for all the other entries.
For example if I choose the m30 tf then all 3 dropdowns have a selection of m30 on all 3 of these dropdowns.
This way I do not need to work out any changes mentally as I change tf's, as they are now presets.
When I use the version that has H6 as the base it gets tedious doing mental calculations while changing the parameters which is why I have done this, almost foolproof.
So here is the problem however, and this concerns changing the date range so that all tf's can display the same amount of bars on the chart.
Say I wish to view 500 bars across the chart, and this number on my charts compresses the x-hair double vertical lines until they just become one vertical line, then all the time frames I choose need to be set like this so that I do not need to constantly adjust the tf and then fiddle with the calendar range, as this gets tedious especially when I flick through a few tf's like this.
I am constantly adjusting the range value as the view defaults to showing all the available range, so changing from even the m5 to the m50 is a vast jump in the displayed number of bars.
So for each version I have limited the range in the code.
So the problem is I am unable to modify the range part of the code to produce a preset dropdown like I have for the other parameters.
The calendar dropdown is hit and miss whereas I would like to specify a certain number of bars for each tf, and not have to flick up or down.
The other 3 operations are relatively painless and super quick, so have been playing with the code for a while on and off to achieve this with the range parameters but with no luck yet.
I am not necessarily asking for this to be done but rather asking how to do this as this benefits my coding this way.
In fact the end goal is to be able to combine all these presets so that just by choosing the label value dropdown all the other parameters are auto selected.
I have enclosed the modded version of this as far as I have been able to get.
I use 5 of these ranging from m5 all the way up to D4, and all these versions use a different base tf for the calculations with their corresponding multipliers and labels, and the range is kind of chosen to minimise this jumping around with the displayed bar range.
regards
kaspo99
hey Apprentice hope you are keeping well