logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
xrousaios  
#1 Posted : Friday, February 24, 2012 4:50:53 AM(UTC)
xrousaios

Rank: Member

Groups: Registered, Registered Users, Unverified Users
Joined: 1/30/2012(UTC)
Posts: 22
Location: Athens, Greece

Hi, I'm using the EKTA 600+- indicator in an expert advisor user formula. This indicator plots two lines representing the standard deviation from both sides of the values moving average for a specific period. Each line has each different value. Unfortunately, I can refer to only one of these values by using the EKTA600 indicator name itself. No any variable is available to refer to each value separately. However, the Data Window of Metastock, shows the two values respectively, as shown bellow at the http://briefcases.pathfinder.gr/download/622311, but with no any label in the front of the second value. Any idea on how to solve this problem ?
wabbit  
#2 Posted : Friday, February 24, 2012 5:05:43 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
RTFM : FmlVar();


wabbit [:D]

henry1224  
#3 Posted : Friday, February 24, 2012 5:36:54 AM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
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

xrousaios  
#4 Posted : Friday, February 24, 2012 5:57:51 AM(UTC)
xrousaios

Rank: Member

Groups: Registered, Registered Users, Unverified Users
Joined: 1/30/2012(UTC)
Posts: 22
Location: Athens, Greece

Hopelessly, EKTA600 is a pasword-protected formula. So, I can't see the variable-names it uses for.
wabbit  
#5 Posted : Friday, February 24, 2012 6:15:02 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Where does the indicator come from?



wabbit [:D]

henry1224  
#6 Posted : Friday, February 24, 2012 9:12:41 AM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
Dear X,

in the indicator builder, click new indicator,
click in the formula area,
click the functions button,
you will see 2 little boxes PASTE FUNCTIONS and SHOW ENGLISH NAMES
put a mark in each box

Under the FUNCTION CATAGORY highlight the ALL

You will now be able to see all of the variables in the PASTE FUNCTION CATAGORY

Scroll down till you see the EKTA 600 Indicator, once there the Variables will be listed in the order they
were written, the last two should be the values that you are looking for

xrousaios  
#7 Posted : Friday, February 24, 2012 11:08:50 AM(UTC)
xrousaios

Rank: Member

Groups: Registered, Registered Users, Unverified Users
Joined: 1/30/2012(UTC)
Posts: 22
Location: Athens, Greece

In order to have a clearer view of the above mentioned indicators and my problem too, please: - Go to the http://briefcases.pathfi...file/gozilla/7577/622313 - Click on the Ekta600.rar to download file. This file contains the “2 EKTA 600 + - 30” indicator and the appropriate template for it. - Import the indicator to Metastock. - Copy the template file into Charts folder of Metastock. - Try this indicator to any security, by applying to it the corresponding template. - Then try to use the same indicator in a custom formula (e.g. in Expert advisor). You will see that you can have only the value of the bottom curve. Thank you very much for your attention. P.S. EKTA indicators, were developed by the Greek Community of Technical Analysis, some years ago. Any attempting to find out more details was failed.
MS Support  
#8 Posted : Friday, February 24, 2012 1:29:59 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,967

Thanks: 93 times
Was thanked: 156 time(s) in 151 post(s)
If a formula plots more than one line, when it is referenced with Fml() or copied into the expert advisor, only the last plot created by the formula will be used. all other values, even if on the same line, will be ignored. If you want to access those values, you will have to only paste in that much of the formula OR use the FmlVar() function to reference the specific variable that value was calculated on.
wabbit  
#9 Posted : Friday, February 24, 2012 5:50:44 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
henry1224 wrote:

in the indicator builder, click new indicator,
click in the formula area,
click the functions button,
you will see 2 little boxes PASTE FUNCTIONS and SHOW ENGLISH NAMES
put a mark in each box


Unfortunately Henry, this wonderful workaround only works if the code authors actually use variables when creating their work, e.g.
Code:

myVar1:={expression 1};
myVar2:={expression 2};

{plot}
myVar1 + myVar2;


In this example, in the paste functions window we'd be able to see the result of the indicator, callable with Fml() and also the two variables it contains, callable with FmlVar().

In George's case: the code writers have not used variables e.g.
Code:

{expression 1};
{expression 2};

so the paste functions dialogue box will only show the indicator name, meaning the only value which can be called is using the Fml() which will return the last value i.e. expression 2.

This issues is a good example to all authors of how NOT to write user-friendly codes! It seems the 'Greek Community of Technical Analysis' need to spend some time with MS User Manual and the Formula Primer to improve their coding skills! [:D]




wabbit [:D]

xrousaios  
#10 Posted : Thursday, March 1, 2012 7:51:59 AM(UTC)
xrousaios

Rank: Member

Groups: Registered, Registered Users, Unverified Users
Joined: 1/30/2012(UTC)
Posts: 22
Location: Athens, Greece

I thank all of you for helping and for time spending for me. I really appreciate that. Regards George
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.