比如做多开第一单 赚钱后,加仓 加仓呈倒金字塔方式(1赚钱加2手 在赚钱加3手 1+2+3+4+5+6+7+8+9+10+11+12+13+………………)直到止损条件触发满足,麻烦给写个 框架 谢谢
variable:n=1;
if kd then buy(1,n,marketr);
if openprofit>0 then n:=n+1;
if zhiying then begin
sell();
n:=1;
end
[此贴子已经被作者于2017/6/16 10:36:35编辑过]
我是用于期货交易, 开空的怎么写 ,怎么写做空加仓倒金字塔式,谢谢
,end前的n=1;是什么意思,我用于期货,做空 倒金字塔加仓怎么写 谢谢
end前的n:=1是什么意思?用于期货做空倒金字塔 加仓怎么写 谢谢
n:=1;是在止盈后,将手数再次初始为0,便于下次使用。
空仓部分和上述2楼的方式一致,可以参考修改,建议你先学习基本语法。而不是跳跃式学习。
做空的话,只需要把开多函数换成开空函数,平多函数换成平空函数。
variable:n=1;
if kd then buyshort(1,n,marketr);
if openprofit>0 then n:=n+1;
if zhiying then begin
sellshort();
n:=1;
end
KD: c>ref(h,1) ; //开多条件
KK:c<ref(l,1) ; //开空条件
variable:n=1;
多进:BUY( KD ,n,THISCLOSE); //开多信号
//止盈
if openprofit>0 then n:=n+1;
多赢:SELL(kk and
holding>0,HOLDING,MARKETR);
n:=1;
空进:BUYSHORT(KK ,n,THISCLOSE);
//止盈
if openprofit>0 then n:=n+1;
空赢:sellshort( kd ,holding,MARKETR);
n:=1;
我这么写错在哪 没没有实现加仓啊 求教