当前位置:→ 首页 > 其他公式 > 金字塔公式 > 金字塔对应平仓示例

以下是金字塔对应平仓示例(无源码的请下载附件导入)

开仓条件为A对应平仓条件A1。开仓条件为B的话对应平仓条件为B1。

金字塔公式 金字塔模型策略源码:
 

VARIABLE:aa=0;
 VARIABLE:bb=0;
 if holding=0 then aa:=0;
 if holding=0 then bb:=0;

h20:ref(hhv(h,20),1);
 l20:ref(llv(l,20),1);
 ma2:ma(c,30);

A:=cross(c,h20);
 A1:=cross(l20,c);
 B:=cross(c,ma2);
 B1:=cross(ma2,c);

if aa=1 and holding>0 and A1  then sell(1,holding,limitr,c);
 if bb=1 and holding>0 and B1  then sell(1,holding,limitr,c);

if A and holding=0 then
 begin
 buy(1,1,limitr,c);
 IF  A and  holding>0 THEN aa:=1;

end
 if B and holding=0 then
 begin
 buy(1,1,limitr,c);
 IF  B and  holding>0 THEN bb:=1;

end

 


关于我们 - 联系我们 - 广告合作 - 下载声明 - 网站帮助 - 友情链接 - 网站地图 - RSS订阅 - TOP
赣ICP备2025055624号
Copyright © 裘昧科技,All Rights Reserved.
股票公式,股票指标,股票软件,股票知识