求助 MathMin 得不到最小值
//+------------------------------------------------------------------+
//| Display .mq4 |
//| |
//| |
//+------------------------------------------------------------------+
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
#property indicator_width1 1
//---- indicator buffers
double TodayOpenBuffer;
//---- input parameters
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID);
SetIndexBuffer(0,TodayOpenBuffer);
SetIndexEmptyValue(0,0.0);
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
ObjectsDeleteAll();
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int lastbar;
int counted_bars= IndicatorCounted();
if (counted_bars>0) counted_bars--;
lastbar = Bars-counted_bars;
DailyOpen(0,lastbar);
}
//+------------------------------------------------------------------+
int DailyOpen(int offset, int lastbar)
{
int shift;
int k,counter;
for(shift=lastbar;shift>=offset;shift--){
if(TimeYear(Time[shift]) != TimeYear(Time[shift+1]))
{ for (counter=k ;counter<=k+11;counter++)
{TodayOpenBuffer[shift]=MathMin( Low[shift-counter],TodayOpenBuffer[shift]); //就是这句
TodayOpenBuffer[shift+1]= 0; }
}
else{
TodayOpenBuffer[shift]= TodayOpenBuffer[shift+1];
}
}
return(0);
}
2楼
已解决 :014:
韬客社区www.talkfx.co