金字塔决策交易系统

 找回密码
 

微信登录

微信扫一扫,快速登录

搜索
查看: 1883|回复: 4

求教金字塔加仓问题

[复制链接]

15

主题

56

帖子

56

积分

等级: 免费版

注册:
2023-11-7
曾用名:
发表于 2024-4-16 20:48 | 显示全部楼层 |阅读模式
求教老师:以下三段文字该怎样编写,图表交易。
1 .  第一次进场,使用总资金的40%。若是损失总资金3%全部平仓出场。
2.   若是盈利达到总资金6%,那么第二次进场,使用剩余总资金50%。若是损失总资金5%全部平仓出场。
3.  若是盈利达到总资金10%,那么第三次进场,使用全部剩余总资金。进场后若是损失总资金7%全部平仓出场。

回复

使用道具 举报

44

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
发表于 2024-4-17 09:03 | 显示全部楼层
variable:n=0;
if 开仓条件 and n=0 then
begin
        n:=1;
        buy(1,40%,marketr);
end
if OPENPROFITPER<-3/100 and n=1 then sell(1,holding,marketr);

//第二次
if 开仓条件 and OPENPROFITPER>6/100 and n=1 then
begin
        n:=2;
        buy(1,50%,marketr);
end
if OPENPROFITPER<-5/100 and n=2 then sell(1,holding,marketr);

//第三次
if 开仓条件 and OPENPROFITPER>10/100 and n=2 then
begin
        n:=3;
        buy(1,50%,marketr);
end
if OPENPROFITPER<-7/100 and n=3 then sell(1,holding,marketr);
金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

21

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
FireScript
发表于 2024-4-17 09:11 | 显示全部楼层
[PEL] 复制代码
variable:cur:=0,fas:=0;;

kd:todaybar=1;//你自己的开仓条件


if asset/fas<=0.97 and cur=1 and holding>0 then 
begin 
止损1:sell(1,holding,market);
cur:=0;
end 

if asset/fas<=0.95 and cur=2 and holding>0 then 
begin 
止损2:sell(1,holding,market);
cur:=0;
end 

if asset/fas<=0.9 and cur=3 and holding>0 then 
begin 
止损3:sell(1,holding,market);
cur:=0;
end 

if holding=0 and kd then 
begin 
首次入场:buy(1,40%,market),pertrader; 
cur:=1;
fas:=asset;//记录首次开仓时候的资产
end

if cur=1 and asset/fas>=1.06 and holding>0 then 
begin 
二次入场:buy(1,50%,market),pertrader;	
cur:=2;
end 

if cur=2 and asset/fas>=1.1 and holding>0 then 
begin 
三次入场:buy(1,100%,market),pertrader;	
cur:=3;
end 


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

使用道具 举报

15

主题

56

帖子

56

积分

等级: 免费版

注册:
2023-11-7
曾用名:
 楼主| 发表于 2024-4-17 11:36 | 显示全部楼层
技术009 发表于 2024-4-17 09:11
[mw_shl_code=pel,true]variable:cur:=0,fas:=0;;

kd:todaybar=1;//你自己的开仓条件

这里止损和进场可以换下位置吗,总习惯先进场再止损
回复

使用道具 举报

15

主题

56

帖子

56

积分

等级: 免费版

注册:
2023-11-7
曾用名:
 楼主| 发表于 2024-4-17 11:37 | 显示全部楼层
技术008 发表于 2024-4-17 09:03
variable:n=0;
if 开仓条件 and n=0 then
begin

谢谢老师,老师费心了。写的挺清楚的
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-7-29 06:08 , Processed in 0.135360 second(s), 22 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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