如何获得另一支股票的数据?另一支股票的代码在变量里。 [通达信]
-
咨询内容:
方法1:
我有一个指标,名叫“自定义指标1”,源码如下:
STOCK_CODE := IF(CODE = '125089', '000089',
IF(CODE = '125887', '000887',
IF(CODE = '126729', '000729',
IF(CODE = '127001', '000099',
IF(CODE = '128001', '002347',
IF(CODE = '128002', '002065',
IF(CODE = '128003', '002185',
IF(CODE = '128004', '002318',
IF(CODE = '128005', '002408',
IF(CODE = '110007', '600966',
IF(CODE = '110009', '600481',
IF(CODE = '110011', '600037',
IF(CODE = '110012', '600798',
IF(CODE = '110015', '600028',
IF(CODE = '110016', '600674',
IF(CODE = '110017', '600026',
IF(CODE = '110018', '600795',
IF(CODE = '110019', '600356',
IF(CODE = '110020', '600219',
IF(CODE = '110022', '600085',
IF(CODE = '110023', '600016',
IF(CODE = '110024', '600820',
IF(CODE = '110025', '600109',
IF(CODE = '113001', '601988',
IF(CODE = '113002', '601398',
IF(CODE = '113003', '601989',
IF(CODE = '113005', '601318',
IF(CODE = '113006', '601139', ''))))))))))))))))))))))))))));
MY_NAME := CALCSTOCKINDEX(STOCK_CODE, 'STKNAME', 1);
DRAWTEXT_FIX(ISLASTBAR, 0, 0, 0, MY_NAME);
但是这不行,没有输出。
方法2:
再建立一个指标:“STOCK_NAME”,源码如下:
MY_STKNAME : STKNAME;
然后在“自定义指标1”中,这样调用:
MY_NAME := CALCSTOCKINDEX(STOCK_CODE, 'STOCK_NAME', 1);
DRAWTEXT_FIX(ISLASTBAR, 0, 0, 0, MY_NAME);
这样也不行,还是没有输出。
求大师帮看看,万谢!!! -
通达信技术部:
STOCK_NAME:=IF(CODE='125089', '深圳机场',
IF(CODE = '125887', '000887',
IF(CODE = '126729', '000729',
IF(CODE = '127001', '000099',
IF(CODE = '128001', '002347',
IF(CODE = '128002', '002065',
IF(CODE = '128003', '002185',
IF(CODE = '128004', '002318',
IF(CODE = '128005', '002408',
IF(CODE = '110007', '600966',
IF(CODE = '110009', '600481',
IF(CODE = '110011', '600037',
IF(CODE = '110012', '600798',
IF(CODE = '110015', '600028',
IF(CODE = '110016', '600674',
IF(CODE = '110017', '600026',
IF(CODE = '110018', '600795',
IF(CODE = '110019', '600356',
IF(CODE = '110020', '600219',
IF(CODE = '110022', '600085',
IF(CODE = '110023', '600016',
IF(CODE = '110024', '600820',
IF(CODE = '110025', '600109',
IF(CODE = '113001', '601988',
IF(CODE = '113002', '601398',
IF(CODE = '113003', '601989',
IF(CODE = '113005', '601318',
IF(CODE = '113006', '601139', ''))))))))))))))))))))))))))));
DRAWTEXT_FIX(ISLASTBAR, 0, 0, 0, STOCK_NAME);请直接如上 把你要显示的字符串改下 你的后面那个股票代码直接写成那个股票代码的股票名称 你想通过读取一个股票代码显示这个代码的名称的方式是不可以实现的 因为当期品种的STkNAMe只对当前浏览股票有效{我就改了第一个 其他的你自己改}
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 511411198 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容