Rss & SiteMap

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

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

标题:[原创]套利策略

1楼
z7c9 发表于:2013/3/29 6:03:03

runmode:0;

symbol1:='y13';
symbol2:='p13';

lots1:=1;
lots2:=1;

close1:=callstock(symbol1,vtclose,6,0);
close2:=callstock(symbol2,vtclose,6,0);

spread:=close1-close2;

length:=20;

myma:=ma(spread,length);

if stricmp(stklabel,symbol1)=0 then begin
 if holding=0 then begin
  if spread>myma then
   buy(1,lots1,limitr,close);
 end
 
 if holding=0 then begin
  if spread<myma then
   buyshort(1,lots1,limitr,close);
 end
 
 if holding>0 then begin
  if spread<myma then begin
   sell(1,lots1,limitr,close);
   buyshort(1,lots1,limitr,close);
  end 
 end
 
 if holding<0 then begin
  if spread>myma then begin
   sellshort(1,lots1,limitr,close);
   buy(1,lots1,limitr,close);
  end 
 end
end

if stricmp(stklabel,symbol2)=0 then begin
 if holding=0 then begin
  if spread<myma then
   buy(1,lots2,limitr,close);
 end
 
 if holding=0 then begin
  if spread>myma then
   buyshort(1,lots2,limitr,close);
 end
 
 if holding>0 then begin
  if spread>myma then begin
   sell(1,lots2,limitr,close);
   buyshort(1,lots2,limitr,close);
  end 
 end
 
 if holding<0 then begin
  if spread<myma then begin
   sellshort(1,lots2,limitr,close);
   buy(1,lots2,limitr,close);
  end 
 end
end

盈亏:asset-500000,noaxis,colorred,linethick2;

 

 

runmode:0;

y盈亏:=stkindi('y13','tt.盈亏',0,6,0),noaxis;
p盈亏:=stkindi('p13','tt.盈亏',0,6,0),noaxis;

总体盈亏:y盈亏+p盈亏,noaxis,linethick2;

 

 


图片点击可在新窗口打开查看此主题相关图片如下:5555.png
图片点击可在新窗口打开查看
2楼
独孤求败 发表于:2013/3/29 7:16:11
不错
3楼
solarhe2006 发表于:2013/3/30 14:16:34
http://www.weistock.com/bbs/dispbbs.asp?boardid=10&Id=50390

runmode:0;

symbol1:='y13';
symbol2:='p13';

lots1:=1;
lots2:=1;

close1:=callstock(symbol1,vtclose,6,0);
close2:=callstock(symbol2,vtclose,6,0);

spread:=close1-close2;

length:=20;

myma:=ma(spread,length);

if stricmp(stklabel,symbol1)=0 then begin
 if holding=0 then begin
  if spread>myma then
   buy(1,lots1,limitr,close);
 end
 
 if holding=0 then begin
  if spread<myma then
   buyshort(1,lots1,limitr,close);
 end
 
 if holding>0 then begin
  if spread<myma then begin
   sell(1,lots1,limitr,close);
   buyshort(1,lots1,limitr,close);
  end 
 end
 
 if holding<0 then begin
  if spread>myma then begin
   sellshort(1,lots1,limitr,close);
   buy(1,lots1,limitr,close);
  end 
 end
end

if stricmp(stklabel,symbol2)=0 then begin
 if holding=0 then begin
  if spread<myma then
   buy(1,lots2,limitr,close);
 end
 
 if holding=0 then begin
  if spread>myma then
   buyshort(1,lots2,limitr,close);
 end
 
 if holding>0 then begin
  if spread>myma then begin
   sell(1,lots2,limitr,close);
   buyshort(1,lots2,limitr,close);
  end 
 end
 
 if holding<0 then begin
  if spread<myma then begin
   sellshort(1,lots2,limitr,close);
   buy(1,lots2,limitr,close);
  end 
 end
end

盈亏:asset-500000,noaxis,colorred,linethick2;

 

 

runmode:0;

y盈亏:=stkindi('y13','tt.盈亏',0,6,0),noaxis;
p盈亏:=stkindi('p13','tt.盈亏',0,6,0),noaxis;

总体盈亏:y盈亏+p盈亏,noaxis,linethick2;

 

4楼
wilsonax 发表于:2013/10/10 22:36:00
有个问题:
y盈亏:=stkindi('y13','tt.盈亏',0,6,0),noaxis;

这里面的“tt”是什么?
5楼
wilsonax 发表于:2013/10/17 9:14:40
有个问题:
y盈亏:=stkindi('y13','tt.盈亏',0,6,0),noaxis;

这里面的“tt”是什么?
共5 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.13794 s, 2 queries.