getting maximum level of indicator

 
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?

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
 
Vladimir Karputov #:

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:


Result:

thanks for your help

Reason: