Download MetaTrader 5

ChartId and subwindow of indicator-object

To add comments, please log in or register
Owen Fausd
57
Owen Fausd 2015.09.28 10:58 

Hello everyone,


when I create an Object of an indicator-class, let's say

CiRSI rsi;
...
  rsi.Create(_Symbol, _Period, 20, PRICE_CLOSE);
  int handle = rsi.Handle();

Then it is automatically inserted as a new subwindow into the current chart.

If I want to draw into this subwindow, I need the values of

"chart_id" and "sub_window".

How can I get those values using the handle or the object of the indicator?


I don't want to search all over each chart with functions like "ChartIndicatorsTotal()", "ChartIndicatorName()" and "ChartWindowFind()". Is this the only way?

I hope, there is a possibility to get the informations directly through the handle.

Thanx a lot.

Owen Fausd
57
Owen Fausd 2015.09.30 09:48  
Indicator-Classes are no derivitives of "ChartObject".
The hirarchy is
CIndicator <- CSeries <- CArrayObj <- CArray <- CObject
So there's no method called "ChartId()".
The only chart-methods I can find are
"CIndicator::AddToChart(...)"
and
"CIndicator::DeleteFromChart(..)"

But they both NEED "chartId" and "subWindow" as parameters.

To add comments, please log in or register