以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  交易策略发布专区  (http://weistock.com/bbs/list.asp?boardid=10)
----  [原创]顺大势逆小势策略  (http://weistock.com/bbs/dispbbs.asp?boardid=10&id=48600)

--  作者:z7c9
--  发布时间:2013/2/16 20:32:19
--  [原创]顺大势逆小势策略

runmode:0;

lots:=1;

shortma:ma(close,5);
longma:ma(close,20);

entrylongcond:=close<shortma and close>longma;
exitlongcond:=close<longma;

entryshortcond:=close>shortma and close<longma;
exitshortcond:=close>longma;

offset:=mindiff;

if holding>=0 then begin
 if entrylongcond then
  buy(1,lots,limitr,close+offset);
end

if holding<=0 then begin
 if entryshortcond then
  buyshort(1,lots,limitr,close-offset);
end

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

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

盈亏:asset-500000,noaxis,linethick2;
次数:totaltrade,linethick0;
胜率:percentwin*100,linethick0;
持仓:state,linethick0;
价位:enterprice,linethick0;


--  作者:RogarZ
--  发布时间:2013/2/16 20:34:38
--  
图片点击可在新窗口打开查看