Rss & SiteMap

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

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

标题:请问为何图表上没有开平仓信号?

1楼
jjjfk 发表于:2016/6/20 11:05:38
我把系统双击应用于图表,但是图表没有显示开平仓信号,请问是怎么回事?谢谢!以下是代码和图表:

//函数定义
a1:=valuewhen(todaybar=1,high);
a2:=valuewhen(todaybar=1,low);
a3:=time>=020000;
a4:=time<230000;
a5:=a3 and a4;
a6:=time>=002300;

//做多条件
if holding=0 and a5 and close>a1 
then begin
buy(1,1,marketr);
end

//平多条件
if holding>0 and close<a2
then begin
sell(1,0,marketr);
end

//做空条件
if holding=0 and a5 and close<a2
then begin
buyshort(1,1,marketr);
end

//平空条件
if holding<0 and close>a1
then begin
sellshort(1,0,marketr);
end

//收盘平仓
if a6 and holding>0
then begin
sell(1,0,marketr);
end

if a6 and holding<0
then begin
sellshort(1,0,marketr);
end


图片点击可在新窗口打开查看此主题相关图片如下:没有开平仓信号.jpg
图片点击可在新窗口打开查看

2楼
jinzhe 发表于:2016/6/20 11:16:31

这边是有信号的, 全是信号

用户代码是不是用的不是上面给的?用下面的代码呢?

a1:=valuewhen(todaybar=1,high);
a2:=valuewhen(todaybar=1,low);
a3:=time>=020000;
a4:=time<230000;
a5:=a3 and a4;
a6:=time>=002300;


//做多条件
if holding=0 and a5 and close>a1
then begin
buy(1,1,marketr);
end


//平多条件
if holding>0 and close<a2
then begin
sell(1,0,marketr);
end


//做空条件
if holding=0 and a5 and close<a2
then begin
buyshort(1,1,marketr);
end


//平空条件
if holding<0 and close>a1
then begin
sellshort(1,0,marketr);
end


//收盘平仓
if a6 and holding>0
then begin
sell(1,0,marketr);
end


if a6 and holding<0
then begin
sellshort(1,0,marketr);
end

 

3楼
jjjfk 发表于:2016/6/20 11:34:35
1.用户代码是不是用的不是上面给的?
代码是我自己写的,用的就是贴出来的代码;

2.用下面的代码呢?
我复制了您的代码,应用于图标,居然全是信号;我对比了我的代码和您的代码,我没看到有什么区别啊,为什么我用自己原来的代码不行,用你的就可以呢?
4楼
jinzhe 发表于:2016/6/20 13:22:12
你代码没编译或者用错代码之类的
5楼
jjjfk 发表于:2016/6/20 13:53:05
我复制了您的代码,应用于图标,居然全是信号;我对比了我的代码和您的代码,我没看到有什么区别啊,为什么我用自己原来的代码不行,用你的就可以呢?

6楼
jinzhe 发表于:2016/6/20 14:01:00
以下是引用jinzhe在2016-6-20 13:22:12的发言:
你代码没编译或者用错代码之类的

共6 条记录, 每页显示 10 条, 页签: [1]


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