# indicator StoMoIndex

Questions about MultiCharts and user contributed studies.
nuno-online
Posts: 174
Joined: 31 Jan 2006
Has thanked: 74 times
Been thanked: 5 times

### indicator StoMoIndex

Hi

when i test this indicator , i have value1=0
if someone can help me ?

Nuno

here the function

Code: Select all

{Type : Function, Name : NR_StoMoIndex}
input:
length1(NumericSimple),
length2(NumericSimple),
length3(NumericSimple),
StoMoIndex(numericref);
var:
HH(0),
LL(0);

HH = Highest(H,length1);
LL = Lowest (L,length1);

StoMoIndex = 100 * (XAverage(XAverage(C-(0.5*(HH+LL)),length2),length3) /
(0.5 * XAverage(XAverage(HH-LL,length2),length3)));

//NR_StoMoIndex = 1;
Here the indicator

Code: Select all

{***********************************************************
Description NR_StoMoIndex : This Indicator plots Stochastic Momentum Index.
***********************************************************}

Inputs: Length1(10), Length2(20), Length3(2), UpColor(green), DwnColor(magenta);
Variables: StoMoIndex(0);

Value1 = NR_StoMoIndex(length1,length2,length3,StoMoIndex);
plot1( Value1, "StoMoIndex" );
plot2(0, "Zero");

If value1>value1[1] then
begin
plot1[1](value1[1],"StoMoIndex",upcolor);
plot1(value1,"StoMoIndex",upcolor);
end
else begin
plot1[1](value1[1],"StoMoIndex",dwncolor);
plot1(value1,"StoMoIndex",dwncolor);
end;

TJ
Posts: 7210
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 991 times
Been thanked: 2052 times
{Type : Function, Name : NR_StoMoIndex}
input:
length1(NumericSimple),
length2(NumericSimple),
length3(NumericSimple),
StoMoIndex(numericref); <--- remove this line

{indicator ----------------------------------------}

Inputs: Length1(10), Length2(20), Length3(2), UpColor(green), DwnColor(magenta);
Variables: StoMoIndex(0);

Value1 = NR_StoMoIndex(length1,length2,length3,StoMoIndex); <-- remove StoMoIndex

nuno-online
Posts: 174
Joined: 31 Jan 2006
Has thanked: 74 times
Been thanked: 5 times
i did it but the same result????

Code: Select all

{Type : Function, Name : NR_StoMoIndex}

input:
length1(NumericSimple),
length2(NumericSimple),
length3(NumericSimple);

var:
HH(0),
LL(0),
StoMoIndex(0);

HH = Highest(H,length1);
LL = Lowest (L,length1);

StoMoIndex = 100 * (XAverage(XAverage(C-(0.5*(HH+LL)),length2),length3) /
(0.5 * XAverage(XAverage(HH-LL,length2),length3)));

//NR_StoMoIndex = 1;

Code: Select all

{**************************************************************************
Description NR_StoMoIndex : This Indicator plots Stochastic Momentum Index.
***************************************************************************}

Inputs: Length1(10), Length2(20), Length3(2), UpColor(green), DwnColor(magenta);
Variables: StoMoIndex(0);

Value1 = NR_StoMoIndex(length1,length2,length3);
plot1( Value1, "StoMoIndex" );
plot2(0, "Zero");

If value1>value1[1] then
begin
plot1[1](value1[1],"StoMoIndex",upcolor);
plot1(value1,"StoMoIndex",upcolor);
end
else begin
plot1[1](value1[1],"StoMoIndex",dwncolor);
plot1(value1,"StoMoIndex",dwncolor);
end;

TJ
Posts: 7210
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 991 times
Been thanked: 2052 times
i did it but the same result????

because you have done something else !!!

TJ
Posts: 7210
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 991 times
Been thanked: 2052 times
the function must have an output !!!

{Type : Function, Name : NR_StoMoIndex}
input:
length1(NumericSimple),
length2(NumericSimple),
length3(NumericSimple);

var:
HH(0),
LL(0);

HH = Highest(H,length1);
LL = Lowest (L,length1);

NR_StoMoIndex = 100 * (XAverage(XAverage(C-(0.5*(HH+LL)),length2),length3) /
(0.5 * XAverage(XAverage(HH-LL,length2),length3)));

//NR_StoMoIndex = 1;

nuno-online
Posts: 174
Joined: 31 Jan 2006
Has thanked: 74 times
Been thanked: 5 times
ok!!!!

thank you TJ