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

金字塔交易系统中移动止损得范例[金字塔模型]

发布时间:2022/10/4 13:42:24  浏览次数:
金字塔交易系统中移动止损得范例

VARIABLE: aspect=0; //初始化假定做多头
VARIABLE: stopprice=0;//止损价咯变量
VARIABLE: stopnum = 10; //止损价差

RUNMODE:0;            //工作于逐周期模式

if barpos = 0 then
  stopprice := l - stopnum;

if aspect = 0 then
begin
 //多头处理 
 if l <= stopprice then
 begin
  //多反空
  aspect:= 1;
  stopprice := h+stopnum;
 end
 
 //处理移动的底部
 if l - stopnum > stopprice then
  stopprice := l-stopnum;
end

if aspect = 1 then
begin
 //空头处理 
 if h >= stopprice then
 begin
  //空反多
  aspect:= 0;
  stopprice := l-stopnum;
 end
 
 //处理移动的底部
 if h + stopnum < stopprice then
  stopprice := h+stopnum;
end

//画线
PARTLINE( aspect = 0, stopprice , colorrgb(255,0,0));
PARTLINE( aspect = 1, stopprice , colorrgb(0,255,0));


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