Rss & SiteMap

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

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

标题:[交易系统]Dual Thrust

1楼
z7c9 发表于:2011/8/14 12:54:54

input:k(0.7,0.1,1,0.1);

dist1:=barslast(day>ref(day,1))+1;
dist2:=ref(dist1,dist1);

predayhigh:=ref(hhv(high,dist2),dist1);
predaylow:=ref(llv(low,dist2),dist1);
predayclose:=ref(close,dist1);
predayrange:=max(predayhigh-predayclose,predayclose-predaylow);

dayopen:=ref(open,dist1-1);

upperband:=dayopen+k*predayrange;
lowerband:=dayopen-k*predayrange;

if holding=0 then begin
 if high>=upperband then
  buy(1,volunit,limitr,max(open,upperband));
end

if holding=0 then begin
 if low<=lowerband then
  buyshort(1,volunit,limitr,min(open,lowerband));
end

if holding>0 then begin
 if low<=lowerband then begin
  sell(1,holding,limitr,min(open,lowerband));
  buyshort(1,volunit,limitr,min(open,lowerband));
 end
 
 if time>=closetime(0) then
  sell(1,holding,limitr,close);
end

if holding<0 then begin
 if high>=upperband then begin
  sellshort(1,holding,limitr,max(open,upperband));
  buy(1,volunit,limitr,max(open,upperband));
 end
 
 if time>=closetime(0) then
  sellshort(1,holding,limitr,close);
end

资产:asset,noaxis,colorred,linethick2;

 

图片点击可在新窗口打开查看 

2楼
rogerhylt 发表于:2011/10/20 11:09:45

不错 可程序编得有误

  if high>=upperband then
buy(1,volunit,limitr,max(open,upperband));

if time>=closetime(0) then
sellshort(1,holding,limitr,close);
 

都有问题

 看了几个你编得几个程序 都有一样的问题。

[此贴子已经被作者于2011-10-20 11:15:57编辑过]
3楼
前线小卒 发表于:2011/10/24 15:03:40
很好的日内交易系统,要是能修改成前台图表交易就好了。
4楼
豆芽 发表于:2011/10/25 8:43:38
以下是引用前线小卒在2011-10-24 15:03:40的发言:
很好的日内交易系统,要是能修改成前台图表交易就好了。 这就能用在前台图表啊!!!
[此贴子已经被作者于2011-10-25 8:44:35编辑过]
5楼
rogerhylt 发表于:2011/10/25 14:46:08
拷代码到你的系统里面 就能用了。 不过代码只能看看,用于指导你写策略 不能用于实盘。 有未来数据
6楼
sxpms 发表于:2011/10/31 23:26:59

连续数据测试时,每个月末和月初时的最高最低价一样,应该是软件系统问题

7楼
liuche001 发表于:2011/11/22 18:21:01

请问老师我把它导入新建交易系统,怎么一个信号都没有啊?图表交易可以用吗?

8楼
fly 发表于:2011/12/5 11:32:09

//等价改写,1分钟周期

 

input:k(0.7,0.1,1,0.1);

 

N:=barslast(date<>ref(date,1))+1;

predayhigh:=ref(hhv(h,N),N); //昨日最高价
predaylow:=ref(LLv(L,N),N);  //昨日最低价
predayclose:=VALUEWHEN(DATE<>REF(DATE,1),REF(CLOSE,1)); //昨收
predayrange:=max(predayhigh-predayclose,predayclose-predaylow);

dayopen:=valuewhen(date<>ref(date,1),o);       //当日开盘价

 

upperband:=dayopen+k*predayrange;
lowerband:=dayopen-k*predayrange;

 

if low<=lowerband then
begin
  sell(holding>0,holding,limitr,min(open,lowerband));
  buyshort(holding=0,volunit,limitr,min(open,lowerband));
end

 

if high>=upperband then
begin
  sellshort(holding<0,holding,limitr,max(open,upperband));
  buy(holding=0,volunit,limitr,max(open,upperband));
end

 

if time>=closetime(0)-300 then
begin
  sell(holding>0,holding,limitr,close);
  sellshort(holding<0,holding,limitr,close);
end

 

资产:asset,noaxis,colorred,linethick2;

9楼
solarhe2006 发表于:2012/8/16 13:28:54

input:k(0.7,0.1,1,0.1);

dist1:=barslast(day>ref(day,1))+1;
dist2:=ref(dist1,dist1);

predayhigh:=ref(hhv(high,dist2),dist1);
predaylow:=ref(llv(low,dist2),dist1);
predayclose:=ref(close,dist1);
predayrange:=max(predayhigh-predayclose,predayclose-predaylow);

dayopen:=ref(open,dist1-1);

upperband:=dayopen+k*predayrange;
lowerband:=dayopen-k*predayrange;

if holding=0 then begin
 if high>=upperband then
  buy(1,volunit,limitr,max(open,upperband));
end

if holding=0 then begin
 if low<=lowerband then
  buyshort(1,volunit,limitr,min(open,lowerband));
end

if holding>0 then begin
 if low<=lowerband then begin
  sell(1,holding,limitr,min(open,lowerband));
  buyshort(1,volunit,limitr,min(open,lowerband));
 end
 
 if time>=closetime(0) then
  sell(1,holding,limitr,close);
end

if holding<0 then begin
 if high>=upperband then begin
  sellshort(1,holding,limitr,max(open,upperband));
  buy(1,volunit,limitr,max(open,upperband));
 end
 
 if time>=closetime(0) then
  sellshort(1,holding,limitr,close);
end

资产:asset,noaxis,colorred,linethick2;

10楼
erichu168 发表于:2012/8/19 18:29:17

感谢大师们

 

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


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