Here's one way:
int start()
{
double high, low;
for(int i = 0; i < Bars-1; i++){
if( TimeDay( iTime(Symbol(), PERIOD_H4, i)) == TimeDay(TimeCurrent())) continue;
if( TimeDayOfWeek( iTime(Symbol(), PERIOD_H4, i)) == 5){
high = MathMax(iHigh(Symbol(), PERIOD_H4, i), iHigh(Symbol(), PERIOD_H4, i+1));
low = MathMin(iLow (Symbol(), PERIOD_H4, i), iLow (Symbol(), PERIOD_H4, i+1));
break;
}
}
Comment( "High = "+high+
"\nLow = "+low);
return(0);
}
OK,thank you.
If i want to introduce code for line indicator Hi and Lo with this, is this complicated?
Thanks
If i want to introduce code for line indicator Hi and Lo with this, is this complicated?
Thanks
?
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Thanks