金字塔决策交易系统

 找回密码
 

微信登录

微信扫一扫,快速登录

搜索
查看: 1560|回复: 1

买入后的价格最高价回撤百分10并且低于二十日线止损怎么写

[复制链接]

129

主题

213

帖子

223

积分

Rank: 7Rank: 7Rank: 7

等级: 版主

注册:
2021-5-25
曾用名:
发表于 2023-7-31 08:42 | 显示全部楼层 |阅读模式
买入后的价格最高价回撤百分10并且低于二十日线止损怎么写?
回复

使用道具 举报

21

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
FireScript
发表于 2023-7-31 09:37 | 显示全部楼层
[PEL] 复制代码
variable:maxp:=0;

ma5:ma(c,5);
ma10:ma(c,10);
ma20:ma(c,20);

kd:cross(ma5,ma10);
pd:cross(ma10,ma5);

if kd and holding=0 then 
begin 
buy(1,1,market);
maxp:=0;
end

if pd and holding>0 then 
begin 
sell(1,holding,market);	
end 


if holding<>0 and enterbars>0 then 
begin 
if h>maxp then 	maxp:=h; 
end

if 100*(maxp-c)/maxp>=10 and c<ma20 then 
begin 
回撤平仓:sell(1,holding,market);	
end 


可参考这个范例的思路。这里是只有多头部分,空头部分可自行尝试下。
金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 微信登录

本版积分规则

手机版|小黑屋|上海金之塔信息技术有限公司 ( 沪ICP备13035422号 )

GMT+8, 2025-6-16 11:11 , Processed in 0.103384 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表