Page 1 of 1

Highest value offset for a given number of bars back.

PostPosted: Mon Jan 16, 2017 1:27 pm
by manojg
Hello,

How do I get the "Highest/Lowest value offset for a given number of bars back" in Indicore SDK. In TradingView it is highestbars(high, period)/lowestbars(low, period).

Thanks.

Re: Highest value offset for a given number of bars back.

PostPosted: Fri Jan 20, 2017 12:57 pm
by manojg
Hello, anybody home?

Re: Highest value offset for a given number of bars back.

PostPosted: Sat Jan 21, 2017 4:22 am
by Apprentice
U can use this line to Finds both the minimal and the maximal value in the range.
local Min,Max= mathex.minmax(source, period-N+1,period);
local Ratio= Min/Max;
or
local Min= mathex.min(source, period-N+1,period);
local Max= mathex.max(source, period-N+1,period);
local Ratio= Min/Max;
or
local Min= mathex.min(source.high, period-N+1,period);
local Max= mathex.max(source.low, period-N+1,period);
local Ratio= Min/Max;

To have "Highest/Lowest value offset for a given number of bars back" use
source.high[period-N]/source.low[period-N]

Re: Highest value offset for a given number of bars back.

PostPosted: Sat Jan 21, 2017 4:17 pm
by manojg
Thanks, I appreciate.