当前位置:分析家公式网 → 股票公式 → 金字塔公式 → 一键转帖:三均线指路交易系统[金字塔模型]
软件名称:[B]三均线指路交易系统[金字塔模型][/B]
软件类型:国产软件
运行环境:Win2000/WinXP/Win2003/WinVista
软件语言:简体中文
授权方式:共享软件
软件大小:0 Bytes
官方主页:Home Page
更新时间:2013-03-12 04:53:08
软件简介:
三均线指路交易系统源码:
runmode:0;
input:period1(4,1,100,1);
input:period2(9,1,100,1);
input:period3(18,1,100,1);
variable:myasset=30000;
entertime:=time>=092500 and time<=145500;
exittime:=time>=150000;
ma1:=ma(close,period1);
ma2:=ma(close,period2);
ma3:=ma(close,period3);
buycond:=entertime and ref(close>ma1 and ma1>ma2 and ma2>ma3,1);
buyprice:=open;
buyshortcond:=entertime and ref(close<ma1 and ma1<ma2 and ma2<ma3,1);
buyshortprice:=open;
if holding=0 and buycond then begin
buy(1,1,limitr,buyprice);
end
if holding=0 and buyshortcond then begin
buyshort(1,1,limitr,buyshortprice);
end
if holding>0 and exittime then begin
sell(1,holding,limitr,close);
end
if holding<0 and exittime then begin
sellshort(1,holding,limitr,close);
end
if exittime then
myasset:=asset;
资产:myasset,noaxis,colormagenta;
次数:totaltrade,linethick0;
收益:(myasset-30000)/30000,linethick0;
成功率:percentwin,linethick0;
出击:totaltrade/(count(date<>ref(date,1),0)+1),linethick0;
连亏:maxseqloss,linethick0;
连赢:maxseqwin,linethick0;
源码解析:
输出 RUNMODE:0
输出 INPUT:PERIOD1(4,1,100,1)
输出 INPUT:PERIOD2(9,1,100,1)
输出 INPUT:PERIOD3(18,1,100,1)
输出 VARIABLE:MYASSET=30000
ENTERTIME赋值:TIME>=092500 AND TIME<=145500
EXITTIME赋值:TIME>=150000
MA1赋值:收盘价的PERIOD1日简单移动平均
MA2赋值:收盘价的PERIOD2日简单移动平均
MA3赋值:收盘价的PERIOD3日简单移动平均
BUYCOND赋值:ENTERTIME AND 昨日CLOSE>MA1ANDMA1>MA2ANDMA2>MA3
BUYPRICE赋值:开盘价
BUYSHORTCOND赋值:ENTERTIME AND 昨日CLOSE<MA1ANDMA1<MA2ANDMA2<MA3
BUYSHORTPRICE赋值:开盘价
逻辑判断 HOLDING=0 AND BUYCOND THEN BEGIN BUY(1,1,LIMITR,BUYPRICE)
END 逻辑判断 HOLDING=0 AND BUYSHORTCOND THEN BEGIN BUYSHORT(1,1,LIMITR,BUYSHORTPRICE)
END 逻辑判断 HOLDING>0 AND EXITTIME THEN BEGIN SELL(1,HOLDING,LIMITR,收盘价)
END 逻辑判断 HOLDING<0 AND EXITTIME THEN BEGIN SELLSHORT(1,HOLDING,LIMITR,收盘价)
MYASSET赋值:ASSET
输出 资产:MYASSET,NOAXIS,画洋红色
输出 次数:TOTALTRADE,线宽为0
输出 收益:(MYASSET-30000)/30000,线宽为0
输出 成功率:PERCENTWIN,线宽为0
输出 出击:TOTALTRADE/(统计0日中满足DATE<>REF(日期,1)的天数+1),线宽为0
输出 连亏:MAXSEQLOSS,线宽为0
输出 连赢:MAXSEQWIN,线宽为0
[url=http://www.70822.com/soft/sort013/sort068/down-59336.html]三均线指路交易系统[金字塔模型][/url]