关于CurrentBar实时取值
老师,您好!下面一段代码是求历史最高价与历史最低价,并Plot显示,在非实盘情况下,一切正常,但在实盘时,最后一个hisHigh及hisLow就不正确,导致线形扭曲。不知何故?怎样才能解决这个问题?顺便说一句,用系统提供的Highest与Lowest求值,更不正确。Numeric hisHigh; // 用以储存历史最高价Numeric hisLow; // 用以储存历史最低价// 赋初值hisHigh = High[CurrentBar]; hisLow = Low{CurrentBar]; // 循环求值For i = CurrentBar Downto 0{ If(High[i] >= hisHigh) hisHigh = High[i]; // 历史最高价 If(Low[i] <= hisLow) hisLow = Low[i]; // 历史最低价}// 可视化PlotNumeric("plt_hisHigh", hisHigh);PlotNumeric("plt_hisLow", hisLow);