金字塔决策交易系统

 找回密码
 

微信登录

微信扫一扫,快速登录

搜索
查看: 3079|回复: 1

编写模型,谢谢!

[复制链接]

8

主题

15

帖子

15

积分

Rank: 1

等级: 新手上路

注册:
2022-11-21
曾用名:
发表于 2022-11-26 20:44 | 显示全部楼层 |阅读模式
开多1:10均线和30均线金叉开多。
开多2:收盘价大于20日最高价。
平仓:A、止损200个点平仓。B,开仓后盈利小于400,回撤200个点平仓。C、开仓后盈利大于400个点后回撤,在开仓后最高价减去开仓价60%的位置平仓(比如开仓是2000,开仓后最高价2500,最高价减开仓价盈利大于400,回撤到2300位置平仓)。

开空1:10均线和30均线死叉开空。
开空2:收盘价小于20日最低价。
平仓:A、止损200个点平仓。B,开仓后盈利小于400,回撤200个点平仓。C、开仓后盈利大于400个点后回撤,在开仓价减最低价价差60%的位置平仓(比如开仓是2000,开仓后最低价1500,开仓价减最低价盈利大于400,回撤到1700位置平仓)。
一开一平信号过滤。

回复

使用道具 举报

21

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

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

h20:hhv(h,20);
l20:llv(l,20);


variable:maxprofit=0;//有仓位时最大获利幅度
//开仓
if (cross(ma10,ma30) or c>h20) and holding=0 then
begin
  buy(1,1,market);
  maxprofit:=0;
end


//开仓
if (cross(ma30,ma10) or c<l20) and holding=0 then
begin
  buyshort(1,1,market);
  maxprofit:=0;
end


//判断当前持仓状态下的最大盈利
win:=0;
win2:=0;
if holding > 0 and enterbars > 0 then
begin
  win:=(c-enterprice); //记录最大盈利
  if win>maxprofit then
    maxprofit:=win; 
 
  win2:=(maxprofit-win); //最大盈利后的回调
end


if holding < 0 and enterbars > 0 then
begin
  win:=(enterprice-c); //记录最大盈利
  if win > maxprofit then
    maxprofit:=win;
 
win2:=(maxprofit-win); //最大盈利后的回调
end

//浮亏200点止损
多止损:sell(win<-200*mindiff,0,market);
空止损:sellshort(win<-200*mindiff,0,market);
 
//出现最高盈利后,回落到盈利的60%平仓出场
多回撤止赢1:sell(maxprofit<=400*mindiff  and win2>=200*mindiff, 0,market);
空回撤止赢1:sellshort(maxprofit<=400*mindiff and win2>=200*mindiff, 0,market);


多回撤止赢2:sell(maxprofit>400*mindiff  and (maxprofit-win)/maxprofit>=0.4, 0,market);
空回撤止赢2:sellshort(maxprofit>400*mindiff and (maxprofit-win)/maxprofit>=0.4,0,market);
金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-7-22 10:22 , Processed in 0.189443 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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