如何取得一段时间内的最高点或者最低点
你可以自己写个函数,例如:
double Highest(string symbol,ENUM_TIMEFRAMES timeframe,int count=WHOLE_ARRAY,int start=0) { double highest=0; double High[]; ArraySetAsSeries(High,true); int copied=CopyHigh(symbol,timeframe,start,count,High); int index=ArrayMaximum(High,0,count)+start; if(copied>0 && index<copied) highest=High[index]; return(highest); } double Lowest(string symbol,ENUM_TIMEFRAMES timeframe,int count=WHOLE_ARRAY,int start=0) { double lowest=0; double Low[]; ArraySetAsSeries(Low,true); int copied=CopyLow(symbol,timeframe,start,count,Low); int index=ArrayMinimum(Low,0,count)+start; if(copied>0 && index<copied) lowest=Low[index]; return(lowest); }
调整 start (从哪里开始,0代表当前bar)和 count(往前数计算多少个bar) 参数,来设定你要的时间段。
enjoy!
luenbo:
可是已经没有Low[]了你可以自己写个函数,例如:
enjoy!
luenbo:
sorry看明白了你可以自己写个函数,例如:
调整 start (从哪里开始,0代表当前bar)和 count(往前数计算多少个bar) 参数,来设定你要的时间段。
enjoy!
原来的会
Low[iLowest(NULL,0,MODE_LOW,3,0)]
现在这个怎么搞?