| / | Forum |
|
zosimus
2010.07.03 22:37
Hi, I'm new to programming. Just wrote my first Indicator and I have a problem. The range of the indicator's values e change considerably when the time frames change. So, I wish to find a way to set different range for each time frame. I defined the range with "#property indicator_minimum" and "#property indicator_maximum" How do I make the value of those properties change each time the user changes the time frame? I know exactly which range values I want for each time frame. Thanks, Yon. |
|
How to Develop a Reliable and Safe Trade Robot in MQL 4 The article deals with the most common errors that occur in developing and using of an Expert Advisor. An exemplary safe automated trading system is described, as well. |
|
ricx
2010.07.04 00:01
get the current period => http://docs.mql4.com/windows/Period then define the range (if value is X, range = N) => http://docs.mql4.com/constants/timeframes no? |
|
zosimus
2010.07.04 00:37
ricx: get the current period => http://docs.mql4.com/windows/Period then define the range (if value is X, range = N) => http://docs.mql4.com/constants/timeframes no? Thanks ricx for your fast reply. As I understand, the value of "#property indicator_minimum/maximum" is determined at the beginning of the code and cannot be addressed in the the "int start() " section. I do not see how I can change the values of "#property indicator_minimum/maximum" after the initialization of the indicator. |
|
zosimus
2010.07.04 01:14
zosimus: Thanks ricx for your fast reply. As I understand, the value of "#property indicator_minimum/maximum" is determined at the beginning of the code and cannot be addressed in the the "int start() " section. I do not see how I can change the values of "#property indicator_minimum/maximum" after the initialization of the indicator. zosimus: Thanks ricx for your fast reply. As I understand, the value of "#property indicator_minimum/maximum" is determined at the beginning of the code and cannot be addressed in the the "int start() " section. I do not see how I can change the values of "#property indicator_minimum/maximum" after the initialization of the indicator. OK - found a simple solution which made me feel quite stupid - I deleted the "#property indicator_minimum/maximum" lines. And now the range is automatically adjusted to the indicator's values range. I did not have to define the range at first. Thanks again, Yon. |
|
ricx
2010.07.04 21:27
your welcome mate :) glad something worked out for you.
|