//+---------------------------------------------------------------------------------+ //|Функция для определения тренда (общая) | //+---------------------------------------------------------------------------------+ int Trend(Filtr filtr_, ENUM_TIMEFRAMES tf, int shift) { int res=0; if(filtr_==no) { if(AskupperEnv2()) { res=0; } } if(filtr_==Pik) { if(iLow(NULL,tf,shift)<= iLow(NULL,tf,iLowest(NULL,tf,MODE_LOW,period_env2,shift))) { res=1; } if(iHigh(NULL,tf,shift)>=iHigh(NULL,tf,iHighest(NULL,tf,MODE_HIGH,period_env2,shift))) { res=0; } } if(filtr_==full_color) { if (iClose(NULL,tf,shift)>iOpen(NULL,tf,shift)&&ha(tf,3,shift)>=ha(tf,2,shift))//белая { res=1; } if (iClose(NULL,tf,shift)<=iOpen(NULL,tf,shift)&&ha(tf,3,shift)=ha(tf,2,shift))//белая { res=1; } if (ha(tf,3,shift)iOpen(NULL,tf,shift))//белая { res=1; } if (iClose(NULL,tf,shift)<=iOpen(NULL,tf,shift))//черная { res=0; } } return res; } //+---------------------------------------------------------------------------------+ //|Функция для определения тренда (общая) | //+---------------------------------------------------------------------------------+ int Trend(Filtr filtr_, ENUM_TIMEFRAMES tf, int shift) { int res=0; if(filtr_==no) { if(AskupperEnv2()) { res=0; } } if(filtr_==Pik) { if(iLow(NULL,tf,shift)<= iLow(NULL,tf,iLowest(NULL,tf,MODE_LOW,period_env2,shift))) { res=1; } if(iHigh(NULL,tf,shift)>=iHigh(NULL,tf,iHighest(NULL,tf,MODE_HIGH,period_env2,shift))) { res=0; } } if(filtr_==full_color) { if (iClose(NULL,tf,shift)>iOpen(NULL,tf,shift)&&ha(tf,3,shift)>=ha(tf,2,shift))//белая { res=1; } if (iClose(NULL,tf,shift)<=iOpen(NULL,tf,shift)&&ha(tf,3,shift)=ha(tf,2,shift))//белая { res=1; } if (ha(tf,3,shift)iOpen(NULL,tf,shift))//белая { res=1; } if (iClose(NULL,tf,shift)<=iOpen(NULL,tf,shift))//черная { res=0; } } return res; }