Download MetaTrader 5

Programming a custom indicator in a seperate window

To add comments, please log in or register
pstar
105
pstar  
Hello community, first time poster here! Background: I have mild mql programming experience having programmed a few EAs in the past but recently became interested in creating my own customer indicators. I have a two part question: 1) So far I understand that indicators can either overlay the price chart using "#property indicator_chart_window" (eg. moving averages, SAR, etc..) or indicators that show up below the price chart using "#property indicator_separate_window" (eg. MACD, ATR, etc..) however the latter is NOT what I am looking for. **I would like to create an indicator that can pop up in a separate window from all of the currency pairs.** Please see the attached image for an idea of what I am looking for. 2) Most indicators I have seen only reference one single currency pair at a time. I would like to create a view in the separate window (referenced in #1) which can reference price data for multiple currency pairs. In particular, I would like the view to show ATR plots for the USD pairs. Please see the attached image for an idea of what I am looking for. To clarify, the image attached is an indicator in a separate window which shows, for example, ATR for USDJPY in green, ATR for USDCAD in red, followed by ATR for the remaining 5 pairs below that. Please offer any advice (coding or otherwise) that can accomplish these things. Thank you in advance for the help, and please feel free to ask for clarification if my post lacked clarity. Cheers
pstar
105
pstar  
Anybody? Any insight would be a great help - thanks
nicholishen
947
nicholishen  
pstar:
Anybody? Any insight would be a great help - thanks

https://www.mql5.com/en/articles/3236

Developing custom indicators using CCanvas class
Developing custom indicators using CCanvas class
  • 2017.07.19
  • Alexander Fedosov
  • www.mql5.com
The article deals with developing custom graphical indicators using graphical primitives of the CCanvas class.
whroeder1
16112
whroeder1  
nicholishen: https://www.mql5.com/en/articles/3236

That won't help. That is about creating objects on a chart. The OP wants to create a independent window.

pstar: I would like to create an indicator that can pop up in a separate window from all of the currency pairs.
Not possible to create windows. You'll have to shell off a process and call Window's API, and arrange non-blocking communication back to the indicator if necessary.
pstar
105
pstar  
whroeder1:

That won't help. That is about creating objects on a chart. The OP wants to create a independent window.

Not possible to create windows. You'll have to shell off a process and call Window's API, and arrange non-blocking communication back to the indicator if necessary.
Thank you for your replies thus far, interesting article. And I apologize for double posting (noobie mistake, will not happen again). As a follow up idea, would it be possible to create this type of view on an existing pair chart? After that, all chart colours can be set to NULL so that the chart lines will not distort the visualization?
whroeder1
16112
whroeder1  

What would be the point of putting un-seeable objects on a chart?

nicholishen
947
nicholishen  
whroeder1:

That won't help. That is about creating objects on a chart. The OP wants to create a independent window.

Not possible to create windows. You'll have to shell off a process and call Window's API, and arrange non-blocking communication back to the indicator if necessary.

My bad... I thought OP was looking for something like {this}.


Alexander Voronkov
22709
Alexander Voronkov  
pstar:
Hello community, first time poster here! Background: I have mild mql programming experience having programmed a few EAs in the past but recently became interested in creating my own customer indicators. I have a two part question: 1) So far I understand that indicators can either overlay the price chart using "#property indicator_chart_window" (eg. moving averages, SAR, etc..) or indicators that show up below the price chart using "#property indicator_separate_window" (eg. MACD, ATR, etc..) however the latter is NOT what I am looking for. **I would like to create an indicator that can pop up in a separate window from all of the currency pairs.** Please see the attached image for an idea of what I am looking for. 2) Most indicators I have seen only reference one single currency pair at a time. I would like to create a view in the separate window (referenced in #1) which can reference price data for multiple currency pairs. In particular, I would like the view to show ATR plots for the USD pairs. Please see the attached image for an idea of what I am looking for. To clarify, the image attached is an indicator in a separate window which shows, for example, ATR for USDJPY in green, ATR for USDCAD in red, followed by ATR for the remaining 5 pairs below that. Please offer any advice (coding or otherwise) that can accomplish these things. Thank you in advance for the help, and please feel free to ask for clarification if my post lacked clarity. Cheers

If you are very much interested in this, then it is possible to do so.

pstar
105
pstar  
whroeder1:

What would be the point of putting un-seeable objects on a chart?

To clarify, this is what I meant by setting chart colors to NULL (see attached images):

As you mentioned, creating a brand new window is not possible, so instead, the indicator would be opened on a random currency pair chart (in the example attached is CADJPY) by using methodologies similar to the article shared by "nicholishen". Then, one could set all CADJPY parameter colors to NULL to show only the indicator. To further clarify, I would not be concerned with the CADJPY chart at all, I would just be using it to open the indicator view.

I suppose if creating a brand new window is not possible it's not the biggest concern (is just a "nice to have"), but what I ultimately want to do is to create a visualization which references multiple currency pairs data (ie the majors) and shows it all in one window. It is this that I hope to obtain so that I can create a "Master view" of ATR of multiple currency pairs - is this possible?

Alexander Voronkov
22709
Alexander Voronkov  

As one of the simplest solutions to this problem, can be performed using the ATR indicator with the settings of the currency pair.

Please see an example:


nicholishen
947
nicholishen  
Alexander Voronkov:

As one of the simplest solutions to this problem, can be performed using the ATR indicator with the settings of the currency pair.

Please see an example:



K.I.S.S. - This is really the best solution. 

12
To add comments, please log in or register