股票公式平台 股票公式 股票软件 手机炒股软件 登录 注册
公式平台网
未来函数检测
首 页 精品公式 通达信公式 大智慧公式 同花顺公式 通达信股票池 大智慧股票池 益盟公式 文华公式 博易大师公式 通达信软件 更多
当前位置:公式平台网金字塔公式 → 正文

金字塔落影模型策略源码(带移动止损)

发布时间:2022/10/8 9:17:34  浏览次数:
金字塔落影模型策略源码(带移动止损)
源码:
HNL:=IF(HIGH>REF(HHV(HIGH,3),1),LOW,0);
L1:=IF(HNL>REF(L,1),REF(L,1),IF(HNL>REF(L,2),REF(L,2),IF(HNL>REF(L,3),REF(L,3),IF(HNL>REF(L,4),REF(L,4),0))));
L2:=IF(L1>REF(L,1),REF(L,1),IF(L1>REF(L,2),REF(L,2),IF(L1>REF(L,3),REF(L,3),IF(L1>REF(L,4),REF(L,4),0))));
L3:=VALUEWHEN(L2>0,L2);
LNH:=IF(LOW<REF(LLV(LOW,3),1),HIGH,666);
H1:=IF(LNH<REF(H,1),REF(H,1),IF(LNH<REF(H,2),REF(H,2),IF(LNH<REF(H,3),REF(H,3),IF(LNH<REF(H,4),REF(H,4),666))));
H2:=IF(H1<REF(H,1),REF(H,1),IF(H1<REF(H,2),REF(H,2),IF(H1<REF(H,3),REF(H,3),IF(H1<REF(H,4),REF(H,4),0))));
H3:=VALUEWHEN(H2>0,H2);
SEL:=VALUEWHEN((CLOSE>H3 and REF(CLOSE,1)<=H3)or(CLOSE<L3 and REF(CLOSE,1)>=L3),IF(CLOSE>H3 and REF(CLOSE,1)<=H3,1,0));
LINE:IF(SEL=1,L3,H3),COLORblue;

//开仓
long:= line<c and time>091400 and time<150500;
if long then
   begin
   sellshort(holding<0,holding,limitr,c);
   buy(holding=0,1,limitr,c);
   end

short:=line>c and time>091400 and time<150500;
if short then
   begin
   sell(holding>0,holding,limitr,c);
   buyshort(holding=0,1,limitr,c);
   end

sell(time>151200 and holding>0,0,thisclose);
sellshort(time>151200 and holding<0,0,thisclose);

PARTLINE( line<c, line, colorrgb(255,0,0));
PARTLINE( line>c, line, colorrgb(0,255,0));

DRAWNUMBER(ISLASTBAR,LINE,LINE,0,COLORblue);


增值电信业务经营ICP许可证:合字B2-20230351  粤ICP备2023083431号-1
免责声明:公式平台网是股票软件指标公式分享平台,不开展相关证券业务,平台展示的所有股票资料由网络收集,不保障实时性和真实性,由此引起的投资亏损与本站无关.
Copyright © 2023 gspt.com , All Rights Reserved.