FXCM Forex Trading

Highest value offset for a given number of bars back.

Section for discussions related to indicators, use of indicators, and building of trading stategies using indicators.

Moderator: admin

Highest value offset for a given number of bars back.

Postby manojg » Mon Jan 16, 2017 1:27 pm

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.
manojg
 
Posts: 3
Joined: Mon Jan 16, 2017 1:20 pm

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

Postby manojg » Fri Jan 20, 2017 12:57 pm

Hello, anybody home?
manojg
 
Posts: 3
Joined: Mon Jan 16, 2017 1:20 pm

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

Postby Apprentice » Sat Jan 21, 2017 4:22 am

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]
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 16949
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

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

Postby manojg » Sat Jan 21, 2017 4:17 pm

Thanks, I appreciate.
manojg
 
Posts: 3
Joined: Mon Jan 16, 2017 1:20 pm


Return to Discussions

Who is online

Users browsing this forum: No registered users and 2 guests