分析家公式网,提供指标公式,股票软件 用户登录  |  用户 注册

软件名称:[B]移动止损的编写方法[/B]
软件类型:国产软件
运行环境:Win9X/Win2000/WinXP/Win2003/Win7/
软件语言:简体中文
授权方式:免费版
软件大小:1.00 KB
官方主页:Home Page
更新时间:2016-02-23 02:35:22
软件简介:

还是以之前的模型为例,希望加入移动止损,即:开仓后的最高点回落10个点要盘中止损离场
加入一个全局变量 hl,记录开多后的最高点,开空后的最低点:

我也不能判断是什么软件的公式源码:

runmode:0;
variable:zs=0,cc=0,hl=0;
ma5:=ma(c,5);
ma20:=ma(c,20);
entertime:=time>100000 and time<144500;
if holding>0 and cc<=0 then sell(1,1,limitr,o);
if holding<0 and cc>=0 then sellshort(1,1,limitr,o);
if holding=0 and cc>0 then buy(1,1,limitr,o);
if holding=0 and cc<0 then buyshort(1,1,limitr,o);
if cc>0 and l<zs then begin
sell(1,1,limitr,min(o,zs-0.6));
cc:=0;
end
if cc<0 and h>zs then begin
sellshort(1,1,limitr,max(o,zs+0.6));
cc:=0;
end
if cc>0 and ma5<ma20 then cc:=0;
if cc<0 and ma5>ma20 then cc:=0;
if cc=0 and ma5>ma20 and entertime then begin
cc:=1;
zs:=c-10;
hl:=h;
end
if cc=0 and ma5<ma20 and entertime then begin
cc:=-1;
zs:=c+10;
hl:=l;
end
if cc>0 and h>hl then begin//创新高后,上移hl
hl:=h;
zs:=hl-10;
end
if cc<0 and l<hl then begin//创新低后,下移hl
hl:=l;
zs:=hl+10;
end
if time>=150000 then begin
cc:=0;
end


[url=http://www.70822.com/soft/sort013/sort010/down-95123.html]移动止损的编写方法[/url]

关于本站 | 网站帮助 | 广告合作 | 声明 | 友情连接 | 网站地图 |
分析家公式网声明:本站所有股票公式软件资料均网上公开收集,如侵权请联系删帖。站内所有广告,均与本站无关!
Copyright © 2003-2024 70822.Com. All Rights Reserved .
页面执行时间:46.87500 毫秒