技术008 发表于 2025-1-10 09:02
你这个具体是什么样的逻辑呢
什么教连续盈利中第几次加仓
variable:mark:=0;//使用全局变量进行记录
kd:TODAYBAR=3;
pd:TODAYBAR=5;
ss:=1;
if pd and holding>0 then
begin
sell(1,holding,market);
//平仓一次算一次盈亏
if numprofit(1)<0 then mark:=0;
if numprofit(1)>0 then mark:=mark+1;
end
if kd and holding=0 then
begin
//连盈大于2次,2倍初始手数开仓
buy(1,if(mark>=2,2*ss,ss),market);
end
连盈次数:mark;
技术006 发表于 2025-1-10 13:54
大致的处理逻辑如下,使用全局变量记录盈利的次数即可。
variable:num=0;
无为上善若水 发表于 2025-1-12 08:31
如果盈利大于 20000 ,加仓怎么写
欢迎光临 金字塔决策交易系统 (https://www.weistock.com/BBS/) | Powered by Discuz! X3.4 |