A:=c>ref(c,1)*1.099 ;
买入条件:filter(A,1);
买入天数:=BARSLAST(买入条件);
买入价:ref(c,买入天数),linethick0;
手续费:=0.003;
盈亏:100*((c-买入价)/买入价-手续费),linethick0,colore66878;
百分之5止赢:买入价*(1+0.05+手续费),linethick0,color000999;
百分之2止损:买入价*(1-0.025+手续费),coLORgreen,linethick0;
止赢条件:=H>百分之5止赢;
止赢天数:=BARSLAST(止赢条件);
止损条件:=c<百分之2止损;
止损天数:=BARSLAST(止损条件);
止赢:=买入天数> 止赢天数 and 止赢天数<止损天数;
{www.gUPaNg.com 股旁网_最新股票指标公式}
止赢天数2:=BARSLAST(止赢条件 and 止赢 and count(ref(止赢,1),1)=0);
止损:=买入天数>止损天数 and 止赢天数>止损天数;
止损天数2:=BARSLAST(止损 and count(ref(止损,1),1)=0);
drawtext(止赢 and count(ref(止赢,1),1)=0 and 买入天数<止损天数2,0.8,'止赢');
drawicon(止赢 and count(ref(止赢,1),1)=0 and 买入天数<止损天数2,0.5,7);
drawtext(止损 and count(ref(止损,1),1)=0 and 买入天数<止赢天数2,0.4,'止损');
drawicon(止损 and count(ref(止损,1),1)=0 and 买入天数<止赢天数2,0.6,8);
202108211239.jpg
|