Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 10/15/2005(UTC) Posts: 10
|
Hi,
I developed my custom indicator and it works fine.
but when I name it as explained in the Help doc, it won´t plot.
What am I missing?
What I want is: Have the Indicator plotted and at the same time refer to in a trading formula that I can backtest.
Thank you
Teo
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 3/19/2005(UTC) Posts: 2,995
Was thanked: 14 time(s) in 10 post(s)
|
How are you trying to refer to your formula? Can you list the code you are using?
|
|
|
|
Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 10/15/2005(UTC) Posts: 10
|
Middle:= Mov( C,200, E);
Thanks
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Teo
When you name a variable you must also create an output by stating the variable name.
{Example 1, unnamed variable}
Mov( C,200, E);
{Example 2, named variable}
Middle:= Mov( C,200, E);
Middle;
An unnamed variable creates its own output, but a named variable does not - you must list the variable name for it to output (plot a result). The semicolon terminator is optional unless more code follows, bit it's good practice to alwyas use a terminator.
Named variables are preferable because the FmlVar() function can be used by other formulas to call a variable from anywhere within an indicator. Unnamed variables, on the other hand ,can only be called by an Fml() function, and only then when they are the last output from the formula.
Roy
MetaStock Tips & Tools
|
|
|
|
Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 10/15/2005(UTC) Posts: 10
|
Thanks Roy.
That is the kind of explanation I was missing. Is it in the MS Help file? IO went crazy looking for it.
Anyway, I´ll let you know how it goes.
By the way, nice website.
Regards
Teo
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Teo
I don't know where the information on named and unnamed variables can be found in the documentation. It's just one of those things that one learns along the way.
Roy
MetaStock Tips & Tools
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 3/19/2005(UTC) Posts: 2,995
Was thanked: 14 time(s) in 10 post(s)
|
Thanks, Roy.
Teo, make sure you d/l the Formula Primer. It has a lot of excellent examples and covers these types of questions. I use it regularly... it's really an essential part of MS.
|
|
|
|
Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 10/15/2005(UTC) Posts: 10
|
Thank you.
Where do I get it?
T
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 3/19/2005(UTC) Posts: 2,995
Was thanked: 14 time(s) in 10 post(s)
|
|
|
|
|
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.