金字塔决策交易系统

 找回密码
 

微信登录

微信扫一扫,快速登录

搜索
查看: 2339|回复: 5

麻烦老师们帮忙写下这个策略

[复制链接]

22

主题

63

帖子

63

积分

等级: 免费版

注册:
2022-10-18
曾用名:
发表于 2023-9-6 09:51 | 显示全部楼层 |阅读模式
1.从年初1.1开始做,一直做到12.31号,下一年又重新开始
2.做多:15分钟100均线之上macd绿柱缩小做多,止损为前5根k线的最低点,不破开仓点的止损就一直拿到年底12.31平仓,破了止损后,等新的开仓信号
3.做空:15分钟100均线之下macd红柱缩小做空,,止损为前5根k线的最低点,不破开仓点的止损就一直拿到年底12.31平仓,破了止损后,等新的开仓信号
4.无论多空,止损后,看接下来最近的开仓信号是多还是空,多就做多,空就做空


回复

使用道具 举报

21

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
FireScript
发表于 2023-9-6 10:06 | 显示全部楼层
[PEL] 复制代码
VARIABLE:zs:=0;//全局变量记录止损价
ma100:ma(c,100);

//macd指标模块
input:p(26,20,100,8),s(12,5,40,4),m(9,2,60,6);
diff :ema(close,s) - ema(close,p);
dea  :ema(diff,m);
macd1 :=2*(diff-dea), colorstick;


kd:c>ma100 and macd1>ref(macd1,1) and all(macd1<0,2);
kk:c<ma100 and macd1<ref(macd1,1) and all(macd1>0,2);

L1:=REF(llv(l,5),1);
H1:=REF(hhv(h,5),1);
if kd and holding=0 then 
begin
buy(1,1,market);
zs:=L1;	 
end 

if kk and holding=0 then 
begin
buyshort(1,1,market);
zs:=H1;	 
end 


if c<zs and holding>0 then 多止损:sell(1,holding,market);
if c>zs and holding<0 then 空止损:sellshort(1,holding,market);

//年底 最后一根K 清仓
if MONTH=12 and  ISMONTHEND and time=CLOSETIME(0) then 
begin
sell(1,holding,market);
end 
金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

22

主题

63

帖子

63

积分

等级: 免费版

注册:
2022-10-18
曾用名:
 楼主| 发表于 2023-9-6 10:20 | 显示全部楼层
技术009 发表于 2023-9-6 10:06
[mw_shl_code=pel,true]VARIABLE:zs:=0;//全局变量记录止损价
ma100:ma(c,100);

D:\zm\1693966767272.jpg
回复

使用道具 举报

22

主题

63

帖子

63

积分

等级: 免费版

注册:
2022-10-18
曾用名:
 楼主| 发表于 2023-9-6 10:20 | 显示全部楼层
回复

使用道具 举报

22

主题

63

帖子

63

积分

等级: 免费版

注册:
2022-10-18
曾用名:
 楼主| 发表于 2023-9-6 10:22 | 显示全部楼层
信号只有最前面一段时间有,后面就没有信号了
1693966767272.jpg
回复

使用道具 举报

21

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
FireScript
发表于 2023-9-6 10:34 | 显示全部楼层

//年底 最后一根k 清仓
if month=12 and  ismonthend and time=closetime(0) then
begin
sell(1,holding,market);
sellshort(1,holding,market);
end

少了个平空。

截图202309061034161306.png

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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-5-29 13:31 , Processed in 0.126966 second(s), 24 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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