in the help section of metastock
Referencing Variables within Custom
Indicators
Since custom indicators can contain variables, you can reference a
specific variable within a custom indicator rather than the entire custom
indicator. The fmlvar() function is used to do
this.
For example, if the custom indicator named "MyMACD" contains a
variable named "SignalLine," and you only want to reference the SignalLine
variable, it could be done as follows using the fmlvar() function:
fmlvar("MyMACD",
"SignalLine" )
If the variable
does not exist within the custom indicator, you will receive an error message.
Just a reminder though, If the base indicator has inputs in it's formula and you then use the fml or fmlvar functions in another indicator,expert,or exploration, the base indicator will then default to the default values
here is an example {My indicator}
pds1:=Input("fast ma",5,100,5);
pds2:=Input("slow ma",10,200,21);
pds3:=Input("signal len",2,100,5);
A:=Mov((H+L)/2,pds1,E)-Mov((H+L)/2,pds2,E);
Sig:=Mov(A,pds3,E);
BullRise:=If(A>0 AND A>Ref(A,-1),A,0);
BullFall:=If(A>0 AND A<Ref(A,-1),A,0);
BearRise:=If(A<0 AND A>Ref(A,-1),A,0);
BearFall:=If(A<0 AND A<Ref(A,-1),A,0);
UZ:=Ref(HHV(Sig,52),-1)*.90;
LZ:=Ref(LLV(Sig,52),-1)*.90;
UZ;LZ;Sig;BullRise;Bullfall;BearFall;BearRise;
If I were to use the Fml() function the last variable named would be the value called
so in the above indicator the fml("my indicator") function would return "BearRise" value based on the default values from the inputs IE: 5,21,5 because BearRise is the last named Variable
If the last line of code was UZ;LZ;Sig;BullRise;Bullfall;BearFall;BearRise;0; The Fml() function would return a 0 value
If I were to use the FmlVar("My indicator","BearFall") function the variable named BearFall would be the value called
so in the above indicator the FmlVar("My indicator","BearFall") would return
"BearRise" value based on the default values from the inputs IE: 5,21,5