Apply custom Indicator on a (virtual) custom Chart

 

Hi Guys

I wanna make inside my own custom indicator some modifications to the existing chart & period data, and save the results in my own series arrays (let's say: cust_open[], cust_close[], cust_high[], cust_low[], cust_time[], cust_tick_volume[], cust_volume[], cust_spread[]). so it's technically a virtual custom chart.

After that I wanna apply a custom indicator on this virtual chart's data, and handle the results of this indicator inside my own custom indicator. I don't have the source code of the external one, only the EX5 file. It's output is very simple, a single DRAW_COLOR_LINE. As far as I know, this should be one buffer array for the line values and one buffer array for the line color.

How can this concept be done without establishing a real custom timeframe chart and attach the external indicator to this custom chart? as I don't need this at all...

I am asking only for the general concept and the functions to use, I will sort out the details myself. iCustom didn't work for me...

thanks for your help

Step on New Rails: Custom Indicators in MQL5
Step on New Rails: Custom Indicators in MQL5
  • www.mql5.com
I will not list all of the new possibilities and features of the new terminal and language. They are numerous, and some novelties are worth the discussion in a separate article. Also there is no code here, written with object-oriented programming, it is a too serous topic to be simply mentioned in a context as additional advantages for developers. In this article we will consider the indicators, their structure, drawing, types and their programming details, as compared to MQL4. I hope that this article will be useful both for beginners and experienced developers, maybe some of them will find something new.
 
Anas MoradI wanna make inside my own custom indicator some modifications to the existing chart & period data, and save the results in my own series arrays (let's say: cust_open[], cust_close[], cust_high[], cust_low[], cust_time[], cust_tick_volume[], cust_volume[], cust_spread[]). so it's technically a virtual custom chart.After that I wanna apply a custom indicator on this virtual chart's data, and handle the results of this indicator inside my own custom indicator. I don't have the source code of the external one, only the EX5 file. It's output is very simple, a single DRAW_COLOR_LINE. As far as I know, this should be one buffer array for the line values and one buffer array for the line color. How can this concept be done without establishing a real custom timeframe chart and attach the external indicator to this custom chart? as I don't need this at all... I am asking only for the general concept and the functions to use, I will sort out the details myself. iCustom didn't work for me...

If you don't have the source code to the other custom indicators that you want to apply to your custom OHLC data, then probably the only way is to create a Custom Symbol for that data and then apply the indicator to it.

Sorry, if that is not really what you want, but unfortunately that is the answer.

If you only wanted to have a single custom data set (single buffer output), then you could use the iCustom method to feed that data into another custom indicator.

But since you want to feed OHLC data to a closed source custom indicator, then only the Custom Symbol method remains.

 

thanks fernando, kind & helpful as always.. I find your answers almost in very forum thread.

reg. my problem: i have 7 different "virtual charts" that i generate and then I apply the external indicator on each of them. if there is any possibility to automate the process of making a custom symbol and storing the data i want inside it, i would consider such a solution.

i can not ask everyone who uses my indicator on a specific chart to make 7 custom symbols and assign them the correct settings & names in order to get my indicator working.

any suggestions how to solve this issue?

 
Anas Morad #: reg. my problem: i have 7 different "virtual charts" that i generate and then I apply the external indicator on each of them. if there is any possibility to automate the process of making a custom symbol and storing the data i want inside it, i would consider such a solution. i can not ask everyone who uses my indicator on a specific chart to make 7 custom symbols and assign them the correct names in order to get my indicator working.

any suggestions how to solve this issue?

I'm somewhat confused.

You stated in your first post that you did not have the source code for the final custom indicator. But in your second post, you state that it is YOUR indicator.

Which is it then?

Assuming that the final custom indicator is indeed NOT yours nor that you have any access to the source code, then maybe you can consider creating a new indicator code to recreate its functionality. Then you can take that new indicator and adapt it to your requirements.

 
Fernando Carreiro #:

I'm somewhat confused.

You stated in your first post that you did not have the source code for the final custom indicator. But in your second post, you state that it is YOUR indicator.

Which is it then?

Assuming that the final custom indicator is indeed NOT yours nor that you have any access to the source code, then maybe you can consider creating a new indicator code to recreate its functionality. Then you can take that new indicator and adapt it to your requirements.

there are two indicators: my own which I am programming right now, and an external one that I want to use for some part of my indicator's logic.

my own indicator generates custom charts (custom OHLC data), seven series of such data, like they are seven custom symbols. after that, I apply the external indicator on these OHLC series, and fetch the result of these seven series (the external indicator's buffer for each) and use it for my own indicator's further logic.

hope it is clear now :-)

 
Anas Morad #:

there are two indicators: my own which I am programming right now, and an external one that I want to use for some part of my indicator's logic.

my own indicator generates custom charts (custom OHLC data), seven series of such data, like they are seven custom symbols. after that, I apply the external indicator on these OHLC series, and fetch the result of these seven series (the external indicator's buffer for each) and use it for my own indicator's further logic.

hope it is clear now :-)

Yes! And in that case, the second part of my previous post offers you a suggested solution — recreate the logic of the propriety indicator.
 
Fernando Carreiro #:
Yes! And in that case, the second part of my previous post offers you a suggested solution — recreate the logic of the propriety indicator.

I think I will go for making a script that creates custom symbols (didn't know before that this is possible) and fill them automatically, and than my indicator applies the external Indicator to these symbols and handle the results. Maybe it's easier than rewriting the indicator from scratch...

 
Anas Morad #:I think I will go for making a script that creates custom symbols (didn't know before that this is possible) and fill them automatically, and than my indicator applies the external Indicator to these symbols and handle the results. Maybe it's easier than rewriting the indicator from scratch...

Personally, I would try recreating the Indicator, but maybe that is just my curious nature of wanting to know how things work. Also, I don't like depending on other people's "black boxes".

Given that if at a later date the ".ex5" file requires it to be recompiled (as has often happened when there are major updates), then your work will have been in vain.

You will forever be dependant on something that is beyond your control, and you will also never be able to sell your indicator on the Market.

 
Fernando Carreiro #:

Personally, I would try recreating the Indicator, but maybe that is just my curious nature of wanting to know how things work. Also, I don't like depending on other people's "black boxes".

Given that if at a later date the ".ex5" file requires it to be recompiled (as has often happened when there are major updates), then your work will have been in vain.

You will forever be dependant on something that is beyond your control, and you will also never be able to sell your indicator on the Market.

Thanks for this frustrating facts :-)