I have referenced the icustom indicator to get values from an indicator i have, within the indicator as you can see below i have set the indicator to print the values vc to check it is working when running in my ea, which it does fine-
indicator code -
------------------------------------------------------------------
{
MomBuffer[i]=((Close[i]- Low[i])/(High[i+MomPeriod]-Low[i+MomPeriod]));
vc=MomBuffer[i];
Print (vc,",","Indicator Values");
i--;
}
return(vc);
_____________________________________________________________
in the indicator i have - setIndexBuffer(0,MomBuffer);
In the ea i have the following to call the custom indicator:-
double vm=iCustom( NULL, 0, "customindicator",0,0,0);
print(vm, ",","values taken from custom indicator");
but when this is running i get the values as stated for vc but not vm which returns 0
can someone help please
thank you
indicator code -
------------------------------------------------------------------
{
MomBuffer[i]=((Close[i]- Low[i])/(High[i+MomPeriod]-Low[i+MomPeriod]));
vc=MomBuffer[i];
Print (vc,",","Indicator Values");
i--;
}
return(vc);
_____________________________________________________________
in the indicator i have - setIndexBuffer(0,MomBuffer);
In the ea i have the following to call the custom indicator:-
double vm=iCustom( NULL, 0, "customindicator",0,0,0);
print(vm, ",","values taken from custom indicator");
but when this is running i get the values as stated for vc but not vm which returns 0
can someone help please
thank you