Rss & SiteMap

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

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

标题:[交易系统]闪灵交易系统

1楼
z7c9 发表于:2011/10/3 17:06:48

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

 

runmode:0;

input:length1(60);
input:length2(30);

variable:myholding=0;
variable:myprofit=0;
variable:myentryprice=0;
variable:myexitprice=0;
variable:myfailtrade=0;

entryupperband:=ref(hhv(high,length1),1);
entrylowerband:=ref(llv(low,length1),1);

entrylongcond:=high>=entryupperband;
entryshortcond:=low<=entrylowerband;

exitupperband:=ref(hhv(high,length2),1);
exitlowerband:=ref(llv(low,length2),1);

exitlongcond:=low<=exitlowerband;
exitshortcond:=high>=exitupperband;

if myholding=0 then begin
 if entrylongcond then begin
  myholding:=1;
  myentryprice:=max(open,entryupperband);
 end 
end 

if myholding=0 then begin
 if entryshortcond then begin
  myholding:=2;
  myentryprice:=min(open,entrylowerband);
 end 
end 
 
if myholding=1 then begin
 if exitlongcond then begin
  myholding:=0;
  myexitprice:=min(open,exitlowerband);
  myprofit:=myexitprice-myentryprice;
  if myprofit<0 then
   myfailtrade:=myfailtrade+1;
  else
   myfailtrade:=0; 
 end
end 

if myholding=2 then begin
 if exitshortcond then begin
  myholding:=0;
  myexitprice:=max(open,exitupperband);
  myprofit:=myentryprice-myexitprice;
  if myprofit<0 then
   myfailtrade:=myfailtrade+1;
  else
   myfailtrade:=0;
 end
end

if holding=0 and myfailtrade=1 then begin
 if entrylongcond then
  buy(1,1,limitr,max(open,entryupperband));
end

if holding=0 and myfailtrade=1 then begin
 if entryshortcond then
  buyshort(1,1,limitr,min(open,entrylowerband));
end

if holding>0 then begin
 if exitlongcond then
  sell(1,holding,limitr,min(open,exitlowerband));
end

if holding<0 then begin
 if exitshortcond then
  sellshort(1,holding,limitr,max(open,exitupperband));
end

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

2楼
xian_0_9 发表于:2011/10/3 18:37:43
。。。过节也不休息奥图片点击可在新窗口打开查看
3楼
xxb398 发表于:2011/10/6 8:33:51
闪灵交易系统初看不错,1楼的图是何时的测试区间呀?如能加上中文注解就更利于学习和交流了。
4楼
xxb398 发表于:2011/10/11 6:10:27
z7c9,请问闪灵交易系统主要思想是什么呢?谢谢
5楼
a7777 发表于:2013/1/29 21:38:46
图片点击可在新窗口打开查看
共5 条记录, 每页显示 10 条, 页签: [1]


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