| / | Forum |
|
RClarke
2009.07.02 00:39
Hi All Quite happy with eg Highest High (of past 10 bars including current) coding, as below: double val; Quick question though..... If I wanted to find the Highest LOW or Lowest HIGH..... I would imagine i would simply change the MODE_HIGH / MODE_LOW to change the source. Is this correct? Not sure if I would need to change the High / Low at the beginning aswell eg double val; Any help would be appreciated. Thanks in advance Richard |
|
Changing the External Parameters of MQL4 Programs without Restarting The article describes a method of changing the external parameters of MQL4 programs on-the-fly, without restarting. |
|
Ruptor
2009.07.02 21:27
Hi Richard I always have to think about these convoluted statements too. You should separate them to understand what's what. High[] is just an array for which you require a position to get a price. It is the iHighest() function that does the work of finding the location of the high value. This function acesses the candles in the range you select and uses the price type given by MODE_. You could select MODE_CLOSE and find the highest close over the selected range if you want. The bottom line is the function returns the location of the value but to get the price you have to use the location on the array of prices so normally High[] would be used with MODE_HIGH, Low[] with MODE_LOW, Close[] with MODE_CLOSE and Open[] with MODE_OPEN. I now understand it better having explained it to you. |
|
RClarke
2009.07.03 22:03
Ruptor wrote >>
Hi Richard I always have to think about these convoluted statements too. You should separate them to understand what's what. High[] is just an array for which you require a position to get a price. It is the iHighest() function that does the work of finding the location of the high value. This function acesses the candles in the range you select and uses the price type given by MODE_. You could select MODE_CLOSE and find the highest close over the selected range if you want. The bottom line is the function returns the location of the value but to get the price you have to use the location on the array of prices so normally High[] would be used with MODE_HIGH, Low[] with MODE_LOW, Close[] with MODE_CLOSE and Open[] with MODE_OPEN. I now understand it better having explained it to you. Ruptor Thanks very much for your response. Took a little while to work through how it all fits together, but i think i get it now. Thank you for your time Richard |