hi, some indicators like ADX have variant maximum level in their subwindow,does anyone knows a way to get maximum level of subwindow of an indicator for the last bar?
Pourya Ebrahimi :
hi, some indicators like ADX have variant maximum level in their subwindow,does anyone knows a way to get maximum level of subwindow of an indicator for the last bar?
hi, some indicators like ADX have variant maximum level in their subwindow,does anyone knows a way to get maximum level of subwindow of an indicator for the last bar?
When the number of a subwindow is known, you can easily get the maximum price of this subwindow (ATTENTION: you get the maximum price of the WINDOW, and not the maximum price of the indicator in the visible window !!!)
Code:
//+------------------------------------------------------------------+ //| ChartGetDouble.mq5 | //| Copyright © 2021, Vladimir Karputov | //+------------------------------------------------------------------+ #property copyright "Copyright © 2021, Vladimir Karputov" #property version "1.00" #property script_show_inputs //--- input parameters input int InpSubWindow = 1; // Subwindow number //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { //--- Print(ChartGetDouble(ChartID(),CHART_PRICE_MAX,InpSubWindow)); } //+------------------------------------------------------------------+
Result:
2021.06.10 05:33:34.362 ChartGetDouble (USDCAD,M15) 57.3267
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register