Rss & SiteMap

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

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

标题:自动交易

1楼
曹晓东 发表于:2016/11/30 10:18:27
a1:=stickline(barpos=datacount-22,c,o,10,0,COLORMAGENTA); 
a2:=stickline(barpos=datacount-10,c,o,10,0,COLORMAGENTA); 
a3:=c<a1;
a4:=c>a1;

mm:=ref(h,1)=hhv(h,3);
nn:=ref(l,1)=llv(l,3);
if mm then bj:=1;
if nn then bj:=-1;
nn1:=barslast(mm);
nn2:=barslast(nn);
if c<ref(l,nn1+1) and bj=1 then i:=1;
if c>ref(h,nn2+1) and bj=-1 then i:=-1;

uu3:=cross(i=1,0.5);//绿
uu4:=cross(i=-1,0.5);//红

if a3 and uu3 then begin  
 buyshort(holding=0,1,market);//阴包阳,卖出
 end
if a4 and uu4 then begin
 buy(holding=0,1,market);//阳包阴,买入
 end
 

 
 if holding>0 and c>a2 then sellshort(1,0,thisclose);
  
 if holding>0 and c<a2 then sell(1,0,thisclose);



问一下   为什么我这个代码放在交易系统里面不能进行交易?求改正!
 
2楼
jinzhe 发表于:2016/11/30 10:24:07
stickline出来就是一个图,没有结果,a1和a2的赋值无效
3楼
曹晓东 发表于:2016/11/30 10:25:20
那能否帮忙改正一下  就这个交易策略?
4楼
jinzhe 发表于:2016/11/30 10:27:34
你的a1和a2分别要赋值什么?
5楼
曹晓东 发表于:2016/11/30 10:33:31
前面第10根和第22根k线的收盘价。a1是前面第22根k线的收盘价,a2是10k的收盘价
6楼
jinzhe 发表于:2016/11/30 10:43:52

a1:=ref(c,22);
a2:=ref(c,10);
a3:=c<a1;
a4:=c>a1;


mm:=ref(h,1)=hhv(h,3);
nn:=ref(l,1)=llv(l,3);
if mm then bj:=1;
if nn then bj:=-1;
nn1:=barslast(mm);
nn2:=barslast(nn);
if c<ref(l,nn1+1) and bj=1 then i:=1;
if c>ref(h,nn2+1) and bj=-1 then i:=-1;


uu3:=cross(i=1,0.5);//绿
uu4:=cross(i=-1,0.5);//红


if a3 and uu3 then begin 
 buyshort(holding=0,1,market);//阴包阳,卖出
 end
if a4 and uu4 then begin
 buy(holding=0,1,market);//阳包阴,买入
 end
 


 
 if holding<0 and c>a2 then sellshort(1,0,thisclose);
 
 if holding>0 and c<a2 then sell(1,0,thisclose);

7楼
曹晓东 发表于:2016/11/30 10:51:09
这样的话入场测试还是不对啊   不交易。能不能帮我在检查一下到底哪里出问题
8楼
jinzhe 发表于:2016/11/30 10:59:00
以下是引用曹晓东在2016-11-30 10:51:09的发言:
这样的话入场测试还是不对啊   不交易。能不能帮我在检查一下到底哪里出问题

入场测试还是不对  指的是什么

不交易  指的是不下单?

9楼
曹晓东 发表于:2016/11/30 11:04:30
就这样   测试结果为000
图片点击可在新窗口打开查看此主题相关图片如下:qq图片20161130110351.png
图片点击可在新窗口打开查看
10楼
jinzhe 发表于:2016/11/30 11:10:39
你测的数据不够长,你测个一年试试
共53 条记录, 每页显示 10 条, 页签: [1] [2][3][4][5][6]


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