Hi coders, could you please advise and provide your coding solution. I can get the highest Open/Close prices but I cannot get the lowest Open/Close prices for the loops.
Kindly help, thanks
Inserted Code
double tMxOC=0;
for(int i=20; i>=1; i--)
{
double mxOC=MathMax(iOpen(Symbol(),60,i),iClose(Symbol(),60,i));
if(mxOC>=tMxOC) {
tMxOC=mxOC;
}
}
{Alert(Symbol()+" Highest OC Price : "+DoubleToStr(tMxOC,5)); }
// This loop works and the highest Open/Close Prices are shown
//+------------------------------------------------------------------+
double tMnOC=0;
for(int i=20; i>=1; i--)
{
double mnOC=MathMin(iOpen(Symbol(),60,i),iClose(Symbol(),60,i));
if(mnOC<=tMnOC) {
tMnOC=mnOC;
}
}
{Alert(Symbol()+" Lowest OC Price : "+DoubleToStr(tMnOC,5)); }
// This loop is NOT working and the lowest Open/Close Prices are shown "0", no price at all. Kindly help, thanks