[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EquisMetaStock Group] Re: How to create custom formula which prompts for security input



PureBytes Links

Trading Reference Links

Biju,

You can and cannot do what you want.

The input function asks for numerical values so from that standpoint 
you cannot do what you want.

But lets say you are watching several stocks all at the same time.
You can assign a value from the security to the variable and use the 
input to select the security which will be used in the indicator 
calculation. Let's explain:

Here is the formula for a MACD:

mov(close,12,E) - mov(close,26,E)

Let's use it to look at the MACD of several different secuirities.

Our first task is selecting the secuties,referncing them, and 
assigning them to a variable. The Security Data function allows a 
formula to access price data for any online or local security.  This 
function can be used in any of MetaStock's formula tools. Online 
securities are referenced by including "ONLINE:" before the symbol.  
Local securities are referenced by including the full path to the 
security file. If the security exists in the same folder as the base 
security, the path does not need to be included.  The symbol, 
including the path or online reference, is enclosed in quotation 
marks.

To reference Microsoft's close as an online security:
Security("ONLINE:MSFT",C)
To reference Microsoft's close as a local security using the full 
path:
Security("C:\Metastock Data\Sample\MSFT",C)
To reference Microsoft's close as a local security in the same 
folder as the base security:
Security("MSFT",C)
The last type of reference is particularly useful if you use local 
data exclusively, and store all of your securities in the same local 
data folder.

For example, the following indicator displays a 30-day moving 
average of Microsoft's close on any chart, if your online data 
vendor is active.
Mov(Security("ONLINE:MSFT",C),30,S)
The same formula could be written as:
Security("ONLINE:MSFT",Mov(C,30,S))



Let's build our indicator.

{MACD FOR SECURITIES} 
{securities list}
x1:= Security("C:\Metastock Data\Sample\MSFT",C);
x2:= Security("C:\Metastock Data\Sample\SOFT",C);
x3:= Security("C:\Metastock Data\Sample\FOOT",C);
x4:= Security("C:\Metastock Data\Sample\MISS",C);
x5:= Security("C:\Metastock Data\Sample\SISS",C);

XX:= Input("Select Security 1=MSFT,2=SOFT,3=FOOT,
4=MISS,5=SISS",1,5,1);

YY:= If(XX=1,X1,
If(XX=2,X2,
If(XX=3,X3,
If(XX=4,X4,X5)))); 

mov(YY,12,E) - mov(YY,26,E);
{END}

That should do it.

Hope this helps,

Preston










--- In equismetastock@xxxxxxxxxxxxxxx, Biju Samuel 
<bijusamuel2003@xxx> wrote:
>
> Hi,
>    
>   I wanted to create a numbe of custom formulas which when plotted 
will ask for security input. Something like the prompt in predefined 
indicator "Relative Strength Comparative". When this indicator is 
plotted, its parametres have the facility to browse to a particular 
security.
>    
>   Can we mimick it in custom indicators?
>    
>   Regards.
>    
>   Biju Samuel




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/equismetastock/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:equismetastock-digest@xxxxxxxxxxxxxxx 
    mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/