於 Help 中有幾個使用例子, 你可以參一下
Referencing Securities with the Security Data Function
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))
|