Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共4 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:代码编写求助

1楼
qq代人发帖 发表于:2018/10/15 9:18:07
 1*  a:=c-ref(c,5);   
假定在5分钟周期下进行交易,当5分钟周期a>0、30分钟周期a>0、日线周期a>0,三个周期都处于0轴上方则开多,
反之,三个周期的a值处于0轴下方( a<0)则开空。
2*如何具体写程序?
[此贴子已经被作者于2018/10/15 9:20:41编辑过]
2楼
FireScript 发表于:2018/10/15 9:25:27
 可如下处理方式:
先新建一个单独的指标A:
a:=c-ref(c,5);


然后在交易指标下引用A指标下的不同周期的a的值:

a1:STKINDI('','A.a',0,6,0);//日线
a2:STKINDI('','A.a',0,4,0);//30分钟
a3:STKINDI('','A.a',0,2,0);//5分钟


if a1>0 and a2>0 and a3>0  then
begin
sellshort(holding<0,holding,market);
buy(holding=0,1,market);
end

if a1<0 and a2<0 and a3<0  then
begin
sell(holding>0,holding,market);
buyshort(holding=0,1,market);
end
3楼
xxh321451 发表于:2018/10/15 9:41:15
非常感谢。

4楼
xxh321451 发表于:2018/10/15 9:41:43
非常感谢!
共4 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.03125 s, 3 queries.