楼主: 金字塔客服
打印 上一主题 下一主题

[公式] 基于 金字塔平台 编写的一些经典交易系统案例

  [复制链接]
21
 楼主| 发表于 2011-12-9 17:29:09 | 只看该作者
[技术指标]交易日统计

/////////////////////////////////////
runmode:0;
variable:redk=0;
variable:redbars=0;
variable:greenk=0;
variable:greenbars=0;
variable:upgap=0;
variable:upgapbars=0;
variable:downgap=0;
variable:downgapbars=0;
variable:totalbars=0;

totalbars:=totalbars+1;
if close>open then begin
redk:=redk+(high-low);
redbars:=redbars+1;
end

if close<open then begin
greenk:=greenk+(high-low);
greenbars:=greenbars+1;
end

hh:=ref(high,1);
ll:=ref(low,1);

if open>ref(high,1) then begin
upgap:=upgap+(open-hh);
upgapbars:=upgapbars+1;
end

if open<ref(low,1) then begin
downgap:=downgap+(ll-open);
downgapbars:=downgapbars+1;
end

if islastbar then begin
上涨日振幅:trimprice(redk/redbars),linethick0;
上涨日天数:redbars,linethick0;
上涨日概率:redbars/totalbars*100,linethick0;
下跌日振幅:trimprice(greenk/greenbars),linethick0;
下跌日天数:greenbars,linethick0;
下跌日概率:greenbars/totalbars*100,linethick0;

向上跳空幅度:trimprice(upgap/upgapbars),linethick0;
向上跳空天数:upgapbars,linethick0;
向上跳空概率:upgapbars/totalbars*100,linethick0;
向下跳空幅度:trimprice(downgap/downgapbars),linethick0;
向下跳空天数:downgapbars,linethick0;
向下跳空概率:downgapbars/totalbars*100,linethick0;
end






/////////////////////////////////////
22
 楼主| 发表于 2011-12-9 17:33:14 | 只看该作者
Dual Thrust
////////////////////////////////////////////
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;
//////////////////////////////////////////

//等价改写,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;


/////////////////////////////////////////
23
 楼主| 发表于 2011-12-9 17:35:25 | 只看该作者
预计高低价系统
////////////////////////////////////

runmode:0;

input:length(14);

testhigh:=(high+low+close)*2/3-low;
testlow:=(high+low+close)*2/3-high;

upperband:=ref(hhv(testhigh,length),1);
lowerband:=ref(llv(testlow,length),1);

entrylongcond:=high>=upperband;
entryshortcond:=low<=lowerband;

if holding=0 then begin
if entrylongcond then
buy(1,1,limitr,max(open,upperband));

if entryshortcond then
buyshort(1,1,limitr,min(open,lowerband));
end

if holding>0 then begin
if entryshortcond then begin
sell(1,holding,limitr,min(open,lowerband));
buyshort(1,1,limitr,min(open,lowerband));
end
end

if holding<0 then begin
if entrylongcond then begin
sellshort(1,holding,limitr,max(open,upperband));
buy(1,1,limitr,max(open,upperband));
end
end

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

////////////////////////////////////
24
 楼主| 发表于 2011-12-9 17:36:42 | 只看该作者
置换移动均线系统

//////////////////////////////////////////////
runmode:0;

ma3x3:=ref(ma(close,3),3);
ma7x5:=ref(ma(close,7),5);
ma25x5:=ref(ma(close,25),5);

entrylongcond:=close>ma3x3 and ma3x3>ma7x5 and ma7x5>ma25x5;
exitlongcond:=ma3x3<MA7X5;

entryshortcond:=close<MA3X3
exitshortcond:=ma3x3>ma7x5;

if holding=0 then begin
if entrylongcond then
buy(1,1,limitr,close);

if entryshortcond then
buyshort(1,1,limitr,close);
end

if holding>0 then begin
if exitlongcond then
sell(1,holding,limitr,close);
end

if holding<0 then begin
if exitshortcond then
sellshort(1,holding,limitr,close);
end

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


/////////////////////////////////////////////
25
 楼主| 发表于 2011-12-9 17:38:05 | 只看该作者
肯特纳系统
//////////////////////////////////////////

runmode:0;
input:avglength(40),atrlength(40);
ma1:=ref(ma((high+low+close)/3,avglength),1);
upperband:=ma1+ref(ma(tr,atrlength),1);
lowerband:=ma1-ref(ma(tr,atrlength),1);

entrylongcond:=ma1>ref(ma1,1) and high>=upperband;
exitlongcond:=low<=ma1;

entryshortcond:=ma1<ref(ma1,1) and low<=lowerband;
exitshortcond:=high>=ma1;

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

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

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

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

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



/////////////////////////////////////////
26
 楼主| 发表于 2011-12-9 17:39:28 | 只看该作者
布林强盗系统

//////////////////////////////////////

runmode:0;
input:bollingerlengths(50);
input:liqlength(50);
input:roccalclength(30);

mid:=ma(close,bollingerlengths);
upperband:=ref(mid+1.25*std(close,bollingerlengths),1);
lowerband:=ref(mid-1.25*std(close,bollingerlengths),1);

roccalc:=close-ref(close,roccalclength-1);
entrylongcond:=roccalc>0 and high>=upperband;
entryshortcond:=roccalc<0 and low<=lowerband;

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

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

if holding>0 then begin
if entryshortcond then begin
  sell(1,holding,limitr,min(open,lowerband));
  buyshort(1,1,limitr,min(open,lowerband));
end
end

if holding<0 then begin
if entrylongcond then begin
  sellshort(1,holding,limitr,max(open,upperband));
  buy(1,1,limitr,max(open,lowerband));
end
end

if holding=0 then
liqdays:=liqlength;

if holding<>0 then begin
liqdays:=liqdays-1;
liqdays:=max(liqdays,10);
end

ma1:=ref(ma(close,liqdays),1);
if holding>0 then begin
if ma1<upperband and low<=ma1 then
  sell(1,holding,limitr,min(open,ma1));
end

if holding<0 then begin
if ma1>lowerband and high>=ma1 then
  sellshort(1,holding,limitr,max(open,ma1));
end

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



//////////////////////////////////////
27
发表于 2011-12-9 17:41:31 | 只看该作者
不说明用法,列举出来有什么用呢?
28
 楼主| 发表于 2011-12-9 17:46:03 | 只看该作者
超级日内组合策略

/////////////////////////////////////////////
runmode:0;
input:waitperiodmins(30);
input:inittradesendtime(143000);
input:liqrevendtime(110000);
input:thrustprcnt1(0.3);
input:thrustprcnt2(0.6);
input:breakoutprcnt(0.25);
input:failedbreakoutprcnt(0.25);
input:protstopprcnt1(0.25);
input:protstopprcnt2(0.15);
input:protstopamt(3);
input:breakevenprcnt(0.5);
input:avgrnglength(10);
input:avgoclength(10);

variable:averagerange=0;
variable:averageocrange=0;
variable:cantrade=0;
variable:buyeasierday=false;
variable:selleasierday=false;
variable:buybopoint=0;
variable:sellbopoint=0;
variable:longbreakpt=0;
variable:shortbreakpt=0;
variable:longfbopoint=0;
variable:shortfbopoint=0;
variable:barcount=0;
variable:intrahigh=0;
variable:intralow=999999;
variable:buystoday=0;
variable:sellstoday=0;
variable:currtrdtype=0;
variable:longliqpoint=0;
variable:shortliqpoint=0;
variable:yesterdayocrrange=0;
variable:intratradehigh=0;
variable:intratradelow=999999;

m1:=ref(ma(callstock(stklabel,vthigh,6,0)-callstock(stklabel,vtlow,6,0),10),1);
m2:=ref(ma(abs(callstock(stklabel,vtopen,6,0)-callstock(stklabel,vtclose,6,0)),10),1);
m3:=ref(llv(low,3),1);
m4:=ref(hhv(high,3),1);

if date>ref(date,1) then begin
averagerange:=m1;
yesterdayocrrange:=abs(open-close);
averageocrange:=m2;
cantrade:=0;

if yesterdayocrrange<0.85*averageocrange then cantrade:=1;
buyeasierday:=false;
selleasierday:=false;

if callstock(stklabel,vtclose,6,-1)<=callstock(stklabel,vtclose,6,-2) then buyeasierday:=true;
if callstock(stklabel,vtclose,6,-1)>callstock(stklabel,vtclose,6,-2) then selleasierday:=true;

if buyeasierday then begin
  buybopoint:=callstock(stklabel,vtopen,6,0)+thrustprcnt1*averagerange;
  sellbopoint:=callstock(stklabel,vtopen,6,0)-thrustprcnt2*averagerange;
end

if selleasierday then begin
  sellbopoint:=callstock(stklabel,vtopen,6,0)-thrustprcnt1*averagerange;
  buybopoint:=callstock(stklabel,vtopen,6,0)+thrustprcnt2*averagerange;
end

longbreakpt:=callstock(stklabel,vthigh,6,-1)+breakoutprcnt*averagerange;
shortbreakpt:=callstock(stklabel,vtlow,6,-1)-breakoutprcnt*averagerange;
shortfbopoint:=callstock(stklabel,vthigh,6,-1)-failedbreakoutprcnt*averagerange;
longfbopoint:=callstock(stklabel,vtlow,6,-1)+failedbreakoutprcnt*averagerange;

barcount:=0;
intrahigh:=0;
intralow:=999999;
buystoday:=0;
sellstoday:=0;
currtrdtype:=0;
end

if high>intrahigh then intrahigh:=high;
if low<intralow then intralow:=low;

barcount:=barcount+1;
if barcount>waitperiodmins/datatype and cantrade=1 then begin
if holding=0 then begin
  intratradehigh:=0;
  intratradelow:=999999;
end

if holding>0 then begin
  intratradehigh:=max(intratradehigh,high);
  buystoday:=1;
end

if holding<0 then begin
  intratradelow:=min(intratradelow,low);
  sellstoday:=1;
end

if buystoday=0 and time<inittradesendtime then
  LBreakOut:buy(1,1,stop,buybopoint);
  
if sellstoday=0 and time<inittradesendtime then
  SBreakout:sellshort(1,1,stop,sellbopoint);
  
if intrahigh>longbreakpt and sellstoday=0 and time<inittradesendtime then
  SfailedBO:sellshort(1,1,stop,shortfbopoint);
  
if intralow<shortbreakpt and buystoday=0 and time<inittradesendtime then
  BfeiledBO:buy(1,1,stop,longfbopoint);
  
if holding>0 then begin
  longliqpoint:=enterprice-protstopprcnt1*averagerange;
  longliqpoint:=min(longliqpoint,enterprice-protstopamt);
  
  if ref(holding,1)<0 and enterbars>=1 and ref(high,1)>=shortliqpoint and shortliqpoint<shortfbopoint then
   currtrdtype:=-2;
  
  if currtrdtype=-2 then begin
   longliqpoint:=enterprice-protstopprcnt2*averagerange;
   longliqpoint:=min(longliqpoint,enterprice-protstopamt);
  end
  
  if intratradehigh>=enterprice+breakevenprcnt*averagerange then
   longliqpoint:=enterprice;
   
  if time>=inittradesendtime then
   longliqpoint:=max(longliqpoint,m3);
   
  if time<liqrevendtime and sellstoday=0 and longliqpoint<>enterprice and enterbars>=4 then begin
   LongLiqRev:sellshort(1,1,stop,longliqpoint);
  end else begin
   LongLiq:sell(1,1,stop,longliqpoint);
  end   
end  

if holding<0 then begin
  shortliqpoint:=enterprice+protstopprcnt1*averagerange;
  shortliqpoint:=max(shortliqpoint,enterprice+protstopamt);
  
  if ref(holding,1)<0 and enterbars>=1 and ref(low,1)<longliqpoint and longliqpoint>longfbopoint then
   currtrdtype:=2;
   
  if currtrdtype=2 then begin
   shortliqpoint:=enterprice+protstopprcnt2*averagerange;
   shortliqpoint:=max(shortliqpoint,enterprice+protstopamt);
  end
  
  if intratradelow<=enterprice-breakevenprcnt*averagerange then
   shortliqpoint:=enterprice;
   
  if time>=inittradesendtime then
   shortliqpoint:=min(shortliqpoint,m4);
   
  if time<liqrevendtime and buystoday=0 and shortliqpoint<>enterprice and enterbars>=4 then begin
   ShortLiqRev:buy(1,1,stop,shortliqpoint);
  end else begin
   ShortLiq:sellshort(1,1,stop,shortliqpoint);
  end   
end
end

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

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

/////////////////////////////////////////////


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册入住  

x
29
 楼主| 发表于 2011-12-9 17:47:52 | 只看该作者
期货废人 发表于 2011-12-9 17:41
不说明用法,列举出来有什么用呢?

请自己体会,
饭不该要有人喂才会吃的啊。
30
发表于 2011-12-9 17:49:31 | 只看该作者
其实有时候简单的才是最有效的。
31
 楼主| 发表于 2011-12-9 17:50:10 | 只看该作者
本帖最后由 金字塔客服 于 2011-12-9 17:51 编辑

菲阿里突破
//////////////////////////////////////////

runmode:0;

variable:longtrade=0;
variable:shorttrade=0;
variable:stopline=0;

predayhigh:=callstock(stklabel,vthigh,6,-1);
predaylow:=callstock(stklabel,vtlow,6,-1);
predayrange:=(predayhigh-predaylow)*0.5;
predayrange:=round(predayrange/mindiff)*mindiff;

dayopen:=callstock(stklabel,vtopen,6,0);

trailingstop:=predayrange;

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

myentrytime:=time<=145500;
myexittime:=time>=150000;

upperband:=ref(hhv(high,dist),1);
lowerband:=ref(llv(low,dist),1);

hh:=ref(high,1);
ll:=ref(low,1);

if holding=0 then begin
if myentrytime and dayopenpredaylow then begin
if high>=predayhigh and longtrade=0 then begin
buy(1,1,limitr,max(open,predayhigh));
longtrade:=1;
end

if low<=predaylow and shorttrade=0 then begin
buyshort(1,1,limitr,min(open,predaylow));
shorttrade:=1;
end
end

if myentrytime and dayopen>=predayhigh then begin
if dist>=4 and high>=upperband and longtrade=0 then begin
buy(1,1,limitr,max(open,upperband));
longtrade:=1;
end
end

if myentrytime and dayopen<=predaylow then begin
if dist>=4 and low<=lowerband and shorttrade=0 then begin
buyshort(1,1,limitr,min(open,lowerband));
shorttrade:=1;
end
end
end

if holding>0 and enterbars>=1 then begin
myexitprice:=0;

if stopline=0 then
stopline:=enterprice-trailingstop;

if hh-trailingstop>stopline then
stopline:=hh-trailingstop;

if low<=stopline then
myexitprice:=min(open,stopline);

if myexittime then
myexitprice:=close;

if myexitprice>0 then begin
sell(1,holding,limitr,myexitprice);
stopline:=0;
end
end

if holding<0 and enterbars>=1 then begin
myexitprice:=0;

if stopline=0 then
stopline:=enterprice+1000;

if ll+trailingstop<STOPLINE then="then"
stopline:=ll+trailingstop;

if high>=stopline then
myexitprice:=max(open,stopline);

if myexittime then
myexitprice:=close;

if myexitprice>0 then begin
sellshort(1,holding,limitr,myexitprice);
stopline:=0;
end
end

if myexittime then begin
longtrade:=0;
shorttrade:=0;
end

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

//////////////////////////////////////////

32
 楼主| 发表于 2011-12-9 17:53:10 | 只看该作者
心手合一 发表于 2011-12-9 17:49
其实有时候简单的才是最有效的。

萝卜青菜,各有所爱,
粥粉面饭,皆有所喜。
33
发表于 2011-12-9 17:59:48 | 只看该作者
{:05:}{:05:}{:05:}{:05:}{:05:}{:05:}{:28:}{:28:}{:28:}{:28:}{:28:}
34
发表于 2011-12-9 19:49:43 | 只看该作者
谢谢楼主!
35
发表于 2011-12-12 12:24:58 | 只看该作者
看不懂啊  太深奥了......
36
发表于 2011-12-12 13:12:24 | 只看该作者
能赚钱吗
37
 楼主| 发表于 2011-12-20 15:18:09 | 只看该作者
为了支持金字塔全速发展,切实解决塔友实际困难
响应金字塔号召
特公布此模板

只要把此模板放在 模型的最后面,就可以后台全自动化交易了。
有个性化需求的,也可在此模板上的基础上定制。

runmode:0;
Globalvariable:hold=drawnull;
……//这里添加上你自己的模型

……//这里添加上你自己的模型
cc800988:=holding;//这句放在信号稳定的地方
drawtextex(1,1,800,0,'虚拟持仓为:'+numtostr(cc800988,0));//在图表上输入虚拟持仓以便监控
if not(islastbar) or workmode<>1 then exit;
xiadan800988:=cc800988-hold;
if xiadan800988>0.5 then begin
cang:=min(xiadan800988,abs(hold));
if hold<0 then begin
  tsellshort(1,cang,mkt,0,0,'800988'),allowrepeat;
  debugfile('D:\800988.txt',numtostr(hold,0)+' '+numtostr(cc800988,0)+' 平空 %.0f',cang);
end
cang:=xiadan800988+min(hold,0);
if cang>0 then begin
  tbuy(1,cang,mkt,0,0,'800988'),allowrepeat;
  debugfile('D:\800988.txt',numtostr(hold,0)+' '+numtostr(cc800988,0)+' 开多 %.0f',cang);
end
end
if xiadan800988<-0.5 then begin
cang:=min(abs(xiadan800988),abs(hold));
if hold>0 then begin
  tsell(1,cang,mkt,0,0,'800988'),allowrepeat;
  debugfile('D:\800988.txt',numtostr(hold,0)+' '+numtostr(cc800988,0)+' 平多 %.0f',cang);
end
cang:=abs(xiadan800988)-max(hold,0);
if cang>0 then begin
  tbuyshort(1,cang,mkt,0,0,'800988'),allowrepeat;
  debugfile('D:\800988.txt',numtostr(hold,0)+' '+numtostr(cc800988,0)+' 开空 %.0f',cang);
end
end
hold:=cc800988;





完整实例如下:
实例一、 K线走完模式的模型
Globalvariable:hold=drawnull;
cc800988:=holding;//这句放在信号稳定的地方

//蓝色部分改为你自己的模型(K线走完模型)
buycond:=count(c>o,2)=2;
sellcond:=count(c<o,2)=2;
if holding>0 and sellcond then sell(1,1,thisclose);
if holding<0 and buycond then sellshort(1,1,thisclose);
if holding=0 and buycond then buy(1,1,thisclose);
if holding=0 and sellcond then buyshort(1,1,thisclose);


drawtextex(1,1,800,0,'虚拟持仓为:'+numtostr(cc800988,0));//在图表上输入虚拟持仓以便监控
if not(islastbar) or workmode<>1 then exit;
xiadan800988:=cc800988-hold;
if xiadan800988>0.5 then begin
cang:=min(xiadan800988,abs(hold));
if hold<0 then begin
  tsellshort(1,cang,mkt,0,0,'800988'),allowrepeat;
  debugfile('D:\800988.txt',numtostr(hold,0)+' '+numtostr(cc800988,0)+' 平空 %.0f',cang);
end
cang:=xiadan800988+min(hold,0);
if cang>0 then begin
  tbuy(1,cang,mkt,0,0,'800988'),allowrepeat;
  debugfile('D:\800988.txt',numtostr(hold,0)+' '+numtostr(cc800988,0)+' 开多 %.0f',cang);
end
end
if xiadan800988<-0.5 then begin
cang:=min(abs(xiadan800988),abs(hold));
if hold>0 then begin
  tsell(1,cang,mkt,0,0,'800988'),allowrepeat;
  debugfile('D:\800988.txt',numtostr(hold,0)+' '+numtostr(cc800988,0)+' 平多 %.0f',cang);
end
cang:=abs(xiadan800988)-max(hold,0);
if cang>0 then begin
  tbuyshort(1,cang,mkt,0,0,'800988'),allowrepeat;
  debugfile('D:\800988.txt',numtostr(hold,0)+' '+numtostr(cc800988,0)+' 开空 %.0f',cang);
end
end
hold:=cc800988;




实例二、即时下单模型(固定时间间隔)
Globalvariable:hold=drawnull;
//蓝色部分改为你自己的模型
buycond:=h>ref(hhv(h,10),1);
sellcond:=l<ref(llv(l,10),1);
if holding>0 and sellcond then sell(1,1,market);
if holding<0 and buycond then sellshort(1,1,market);
if holding=0 and buycond then buy(1,1,market);
if holding=0 and sellcond then buyshort(1,1,market);

cc800988:=holding;//这句放在信号稳定的地方

drawtextex(1,1,800,0,'虚拟持仓为:'+numtostr(cc800988,0));//在图表上输入虚拟持仓以便监控
if not(islastbar) or workmode<>1 then exit;
xiadan800988:=cc800988-hold;
if xiadan800988>0.5 then begin
cang:=min(xiadan800988,abs(hold));
if hold<0 then begin
  tsellshort(1,cang,mkt,0,0,'800988'),allowrepeat;
  debugfile('D:\800988.txt',numtostr(hold,0)+' '+numtostr(cc800988,0)+' 平空 %.0f',cang);
end
cang:=xiadan800988+min(hold,0);
if cang>0 then begin
  tbuy(1,cang,mkt,0,0,'800988'),allowrepeat;
  debugfile('D:\800988.txt',numtostr(hold,0)+' '+numtostr(cc800988,0)+' 开多 %.0f',cang);
end
end
if xiadan800988<-0.5 then begin
cang:=min(abs(xiadan800988),abs(hold));
if hold>0 then begin
  tsell(1,cang,mkt,0,0,'800988'),allowrepeat;
  debugfile('D:\800988.txt',numtostr(hold,0)+' '+numtostr(cc800988,0)+' 平多 %.0f',cang);
end
cang:=abs(xiadan800988)-max(hold,0);
if cang>0 then begin
  tbuyshort(1,cang,mkt,0,0,'800988'),allowrepeat;
  debugfile('D:\800988.txt',numtostr(hold,0)+' '+numtostr(cc800988,0)+' 开空 %.0f',cang);
end
end
hold:=cc800988;

--------------------------------
leevolvo原创

38
发表于 2011-12-25 23:32:08 | 只看该作者
不知道怎么用,辛苦
39
发表于 2012-1-3 09:29:14 | 只看该作者
{:28:}{:28:}
40
发表于 2012-1-5 11:36:17 | 只看该作者
{:13:}
您需要登录后才可以回帖 登录 | 注册入住  

本版积分规则

易家网  ©2015-2023  郑州期米信息技术有限公司版权所有  豫公网安备 41010502005136号 豫ICP备16010300号