单均线穿越交易系统源码[金字塔模型]
相关标签:5种均线交易系统,期货简单均线交易系统,现货均线交易系统,最好的均线交易系统,均线交易系统,外汇均线交易系统,最简单均线交易系统,我的外汇均线交易系统,外汇120均线交易系统,
模型策略源码:
runmode:0;
input:period(100,5,100,5);
variable:myasset=30000;
entertime:=time>=092500 and time<=145500;
exittime:=time>=150000;
buycond:=entertime and ref(cross(close,ma(close,period)),1);
buyprice:=open;
buyshortcond:=entertime and ref(cross(ma(close,period),close),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:周期
输出 VARIABLE:MYASSET=30000
ENTERTIME赋值:TIME>=092500 AND TIME<=145500
EXITTIME赋值:TIME>=150000
BUYCOND赋值:ENTERTIME AND 昨日收盘价上穿收盘价的周期日简单移动平均
BUYPRICE赋值:开盘价
BUYSHORTCOND赋值:ENTERTIME AND 昨日收盘价的周期日简单移动平均上穿收盘价
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
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 262069696 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容