In the Highest function there is a “length” parameter.
What is that the length of? I’ve used it like this:
channel_high = PublicFunctions.Highest(BarsOfData(1).High, BarsOfData(1).CurrentBar, mintues_back);
Is that correct?
Thanks and regards,
drolles
length in Highest Method
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: length in Highest Method
Length sets the number of bars to consider for testing the condition.
Was discussed here.
Was discussed here.
Re: length in Highest Method
Hi,
Thanks for that.
Though, I’m looking at this. It doesn’t make sense as one of the overloads is to Highest(ISeries, int length, int barsback).
So we are saying that you can pass in a longer ISeries yet specify that you only want it to go a X number of bars back into the ISeries, great.
Do you have to chop the ISeries before you pass it in? I’m getting errors about the Maximum number of bars back regardless of me setting it at 1600, then saying that I want the length to be 1500?
Thanks and regards,
drolles
Thanks for that.
Though, I’m looking at this. It doesn’t make sense as one of the overloads is to Highest(ISeries, int length, int barsback).
So we are saying that you can pass in a longer ISeries yet specify that you only want it to go a X number of bars back into the ISeries, great.
Do you have to chop the ISeries before you pass it in? I’m getting errors about the Maximum number of bars back regardless of me setting it at 1600, then saying that I want the length to be 1500?
Thanks and regards,
drolles
Re: length in Highest Method
Additionally, where does it take the 1500 from? If it is element 0 of the array (ISeries) it will always reach past the Max number of Bars.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: length in Highest Method
Hello drolles,
In your code you are constantly increasing the Length parameter:
This forces the function to reference further and further historical data with every calculation. On a certain bar the MaxBarsBack you have selected is not enough because length >= MaxBarsBack. MultiCharts increases the MaxBarsBack automatically and recalculates the study.
Please make the Length value constant in order to avoid this problem.
The solution was in the same thread I have mentioned above.
In your code you are constantly increasing the Length parameter:
Code: Select all
channel_high = PublicFunctions.Highest(BarsOfData(1).High, BarsOfData(1).CurrentBar, mintues_back);
Please make the Length value constant in order to avoid this problem.
The solution was in the same thread I have mentioned above.
Length sets the number of bars to consider for testing the condition.
Was discussed here.