if(Low[i] < iLowest(NULL,60, MODE_LOW,120,1))
-
Perhaps you should read the manual. iLowest - Timeseries and Indicators Access - MQL4 Reference
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.What do you think “a price < bar index” means? I think 1.54321 will be less than (say) 10 on almost every bar.
-
Don't hard code constants. Use the proper supplied constants. Your code fails if you do not run on the PERIOD_H1. mixing apples and oranges.
Hi William, Thanks for responding. I read the section on iLowest and can see I missed getting the value of the lowest candle so have changed the code as below, however I still get arrows under all the candles for the Up Trend Signal yet for the Down Trend Signal it only shows arrows where the high of the candle is higher than the highest of the previous 120 candles. Still can't see why the Down Trend Signal works but the Up Trend doesn't as the code is essentially the same just reversed.
btw, thanks for the observation regarding the chart period, I set the Period to 60 as I will only run this on a 60 minute chart, but I have changed to PERIOD_H1 as recommended.
Any thoughts?

- www.mql5.com
i am try to get the lowest low of a certain number of previous candles, and i want it to be constant or fix. it should not change along with further new candle
this how hoe the code is:
if(!buyTrade && Cur_Ema10 > Cur_Ema140 )
{
OpenManual_BuyOrder();
double lowestlow = iLow(NULL,0,0);
for(int k = 1; k <= 15; k++)
{
double low = iLow(NULL,0,k);
if(low < lowestlow){
lowestlow = low;
const double lowestPrice = lowestlow;
}
}
Alert("lowest Price ",lowestPrice);

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, I am trying to write an indicator that puts an arrow below or above the current candle if it's Low/High is lower/higher than the Lowest/Highest value in the previous 120 candle but I can't work out why my code is putting arrows on every candle. Would appreciate some help.
Here is the code.