『最佳拍檔』智能決策系統

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 2522|回复: 7

请教编程的问题?

[复制链接]
发表于 2009-1-13 17:23:23 | 显示全部楼层 |阅读模式

大虾们,我想问下设置A股票的MACD两线相交,但是响铃提示的确是B股票这样应该怎么样写啊?

发表于 2009-1-14 11:33:03 | 显示全部楼层

那你便須要於 B 股票上用 Expert Advisor 而該 Expert Advisor 的 Alert 觸發條件, 便要指定是 A 股票的數據 ~

 

而且技術指標訊息要用  A 股票的數據作計算 !!


 

重點在於使用  Security("Symbol", Data Array)


例如:

Val1 := Security( "C:\Msdata\hk0001\0178", C) ;
M1 := Mov( Val1,12,E);
M2 := Mov( Val1,26,E);
AstockMACD := M1 - M2;
AstockMACDmov := Mov(AstockMACD,9,E);
Cross(AstockMACD,AstockMACDmov)

---------------------------------------------------------------------------
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))


 


 

B股票中顯示A股票訊號方法00.gif
B股票中顯示A股票訊號方法01.gif
 楼主| 发表于 2009-1-14 17:09:39 | 显示全部楼层
谢谢斑竹,还的向斑竹好好学习!
 楼主| 发表于 2009-1-15 16:21:35 | 显示全部楼层

回复 2# 的帖子

斑竹,我设置的条件怎么不对啊?比如说我设置HK;5MACD两线相交,响铃的为HK;1,在达到条件后为什么在HK;1上面没有出现设置的symbols呢?
发表于 2009-1-15 16:42:22 | 显示全部楼层
響玲 (Alert) 與 圖示 (Symbol )

是兩個不同的功能, 要分開獨立的設置 ~

有設置才會有顯示呢 !!
響玲 (Alert) 與 圖示 (Symbol ) _01.gif
 楼主| 发表于 2009-1-15 17:43:11 | 显示全部楼层

回复 5# 的帖子

我是分开设置的,我想问下是不是AB两个股票都要设置才会出现symbols,还是只需要设置一个!我是这样设置的:
Val1 := Security( "hk;2318", C) ;
M1 := Mov( Val1,12,E);
M2 := Mov( Val1,26,E);
AstockMACD := M1 - M2;
AstockMACDmov := Mov(AstockMACD,9,E);
Cross(AstockMACD,AstockMACDmov)
在HK;2628中设置这个指标,那2318里面是不是一定要设置才会出先symbols呢?
发表于 2009-1-16 01:06:57 | 显示全部楼层

相信係使用的方法問題:

 

你可以於 Help 內找到幾個使用方法:


你可能使用實時資料中, 所以可以試試
Security("ONLINE:hk;2318",C)


如是使用硬盤中目錄的資料可以用全目錄路徑名:
Security("C:\Metastock Data\Sample\hk;2318",C)


這樣使用只是指明現時同一目錄下的股票:
Security("hk;2318",C)


原 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))

 

 楼主| 发表于 2009-1-16 14:03:42 | 显示全部楼层
好的,多谢斑竹!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|『最佳拍檔』智能決策系統

GMT+8, 2024-6-17 04:41 , Processed in 0.055055 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表