金字塔决策交易系统

 找回密码
 

微信登录

微信扫一扫,快速登录

搜索
12
返回列表 发新帖
楼主: 玻璃翠

麻烦帮忙编写个指标吧,多谢老师了

[复制链接]

21

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
FireScript
发表于 2022-11-24 11:19 | 显示全部楼层
“MA10穿20” 交叉区域满足这个 就平仓?无论当前是多空持仓?
金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

1

主题

8

帖子

8

积分

Rank: 1

等级: 新手上路

注册:
2022-11-9
曾用名:
 楼主| 发表于 2022-11-24 11:35 | 显示全部楼层
技术009 发表于 2022-11-24 11:19
“MA10穿20” 交叉区域满足这个 就平仓?无论当前是多空持仓?


下跌当中符合条件开的是空单,平仓止盈止损当价格穿破站稳最上面的一根均线(这个老师已经写好了),或者10上穿20,这两个条件不管哪个先达到,就平仓,
上涨当中符合条件开的是多单,平仓止盈止损当价格穿破站稳最下面的一根均线,或者10下穿20,这两个条件不管哪个先达到,就平仓,

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号? 微信登录

x
回复

使用道具 举报

21

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
FireScript
发表于 2022-11-24 13:22 | 显示全部楼层
你补上这句:
if cross(ma10,ma20) and ma30>ma20 and ma40>ma30 and holding<0 then 空止损2:sellshort(1,holding,market);

还是以空头效果为例。
金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

1

主题

8

帖子

8

积分

Rank: 1

等级: 新手上路

注册:
2022-11-9
曾用名:
 楼主| 发表于 2022-11-24 13:33 | 显示全部楼层
技术009 发表于 2022-11-24 13:22
你补上这句:
if cross(ma10,ma20) and ma30>ma20 and ma40>ma30 and holding

就是这样的,麻烦你把多单也补齐了吧
回复

使用道具 举报

21

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
FireScript
发表于 2022-11-24 14:18 | 显示全部楼层
[PEL] 复制代码
ma10:ma(c,10);
ma20:ma(c,20);
ma30:ma(c,30);
ma40:ma(c,40);


dtpl:ma40<ma30 and ma30<ma20 and ma20<ma10;
ktpl:ma40>ma30 and ma30>ma20 and ma20>ma10;

if dtpl and holding=0 and  l<ma10 and l>ma20 then buy(1,1,market);
if ktpl and holding=0 and  h>ma10 and h<ma20 then buyshort(1,1,market);

if holding<0 and cross(c,ma40) and not(ktpl) then 空止盈:sellshort(1,holding,market);
if holding<0 and ktpl and  h>ma40 and cross(c,ma40) then 空止损:sellshort(1,holding,market);
if cross(ma10,ma20) and ma30>ma20 and ma40>ma30 and holding<0 then 空止损2:sellshort(1,holding,market);

if holding>0 and cross(ma40,c) and not(dtpl) then 多止盈:sell(1,holding,market);
if holding>0 and dtpl and  l<ma40 and cross(ma40,c) then 多止损:sell(1,holding,market);
if cross(ma20,ma10) and ma30<ma20 and ma40<ma30 and holding>0 then 多止损2:sell(1,holding,market);

if dtpl  and l<ma30 and l>ma40 and abs(holding)<=2 then buy(1,1,market);
if dtpl  and l<ma20 and l>ma30 and abs(holding)<=1 then buy(1,1,market);


if ktpl  and h>ma30 and h<ma40 and abs(holding)<=2 then buyshort(1,1,market);
if ktpl  and h>ma20 and h<ma30 and abs(holding)<=1 then buyshort(1,1,market);




金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

12

主题

56

帖子

56

积分

等级: 免费版

注册:
2024-4-26
曾用名:
发表于 2024-5-30 10:52 | 显示全部楼层
好帖
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-7-28 03:05 , Processed in 0.127693 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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