Fan sayfamıza katılın
Öyleyse bir link gönderin -
başkalarının da faydalanmasını sağlayın
- Görüntülemeler:
- 5828
- Derecelendirme:
- Yayınlandı:
- 2013.08.02 19:23
- Güncellendi:
- 2016.11.22 07:32
-
Bu koda dayalı bir robota veya göstergeye mi ihtiyacınız var? Freelance üzerinden sipariş edin Freelance'e git
An example of how to use IndicatorSetString(). A simple indicator that shows how to create a label, e.g. "Overbought level" for each level.
Using the #property compiler directives for the indicator, which is drawn in a separate window, you can specify the required horizontal levels, for example:
//--- display three horizontal levels in a separate indicator window #property indicator_level1 30 #property indicator_level2 50 #property indicator_level3 70
In addition, the IndicatorSetString() function can be used for adding labels to each level and even changing the labels dynamically when necessary:
//--- Set descriptions of horizontal levels IndicatorSetString(INDICATOR_LEVELTEXT,0,"First Level (index 0)"); IndicatorSetString(INDICATOR_LEVELTEXT,1,"Second Level (index 1)"); IndicatorSetString(INDICATOR_LEVELTEXT,2,"Third Level (index 2)");
Note
Numbering of properties (modifiers) starts from 1 (one) when using the #property directive, while the function uses numbering from 0 (zero). In case the level number is set incorrectly, resulting indicator can differ from the intended one.
For example, in order to set description of the first horizontal level use the zero index:
IndicatorSetString(INDICATOR_LEVELTEXT, 0, "First Level") //- Index 0 is used for setting the text description of the first level.
MetaQuotes Ltd tarafından Rusçadan çevrilmiştir.
Orijinal kod: https://www.mql5.com/ru/code/1760
![Simple Hedge Panel](https://c.mql5.com/i/code/expert.png)
A panel for opening and closing positions on several financial symbols in one click.
![Demo_IndicatorSetInteger](https://c.mql5.com/i/code/indicator.png)
An example of the IndicatorSetInteger() function. A simple indicator that shows how to create a label, e.g. "Overbought level" for each horizontal level.
![DeMarker_HTF](https://c.mql5.com/i/code/indicator.png)
DeMark's oscillator with an option of setting a fixed timeframe for the calculation of the indicator in the input parameters.
![RoundLevels](https://c.mql5.com/i/code/indicator.png)
The RoundLevels indicator draws two closest "round" levels above the current price and two more below it