指标编写学习论坛
标题:
怎么显示今天的收盘价是在几日收盘价中的最高?
[打印本页]
作者:
admin
时间:
2016-5-7 17:19
标题:
怎么显示今天的收盘价是在几日收盘价中的最高?
怎么显示今天的收盘价是在几日收盘价中的最高?
比如说,我在K线图中看出今天收盘价是15日内收盘价的最高,这个15日用公式怎么求出来?
正确答案1:
hac[1]:=0;
att1:=hac[1];
att2:=hac[1];
attc:=hac[1];
fc:=c*1;
attc:=fc[datacount];
att1:=1;
for i=datacount-1 downto datacount-200 do
begin
if fc[i]<attc and att2=0 then att1:=att1+1;
if fc[i]>attc then att2:=1;;
end;
n:att1;
正确答案2:
也可这样
cc:=if(barscount(c)=1,999999,c);
sumbars(ref(cc,1)-cc,0)-1;
欢迎光临 指标编写学习论坛 (http://www.shgm.net/)
Powered by Discuz! X3.2