EA needs data of another EA to trade

 

Hello,

I've got a problem. I created an EA which trades the data of a range bar EA. Everything is working fine when I have both of the EAs operating on my computer MT4 terminal.

I basically open up a M1 chart and place the range bar EA on it. After that I open up the offline chart which was created by the range bar EA. After that my EA gets initialized on the offline range bar chart.

EA opens and closes trades just perfectly fine.

However I now want to operate my EA using the MT4 VPS hosting. But the EA does no longer open any trades. I have already read something about this failure a while back but cannot find the thread anymore.

I assume the problem is that my EA needs a "function" which tells the EA to use the range bar data which is generated by the other EA. I guess that if I used a regular VPS where the whole desktop is basically uploaded to the server, everything would just work fine as it would be completely the same as if the EAs were operated on my computers MT4 terminal. However because of the special hosting with MT4 VPS where only the EAs are uploaded to the server I end up getting this malefunction.


Am I correct with my analysis? Is it even possible to use the MT4 VPS if I want to use an EA which is based on the data of another EA? If yes, what exactly do I need to change to get everything up and running?

Thanks in advance.


Regards

Michael

 

It depends on the mechanisn of communication between EA's and since there is no code shown, i can not say anything about that.

But if you feel that you should run it on a regular VPS with RDC then go with that.

 
Michael Breu:

I've got a problem. I created an EA which trades the data of a range bar EA. Everything is working fine when I have both of the EAs operating on my computer MT4 terminal.

I basically open up a M1 chart and place the range bar EA on it. After that I open up the offline chart which was created by the range bar EA. After that my EA gets initialized on the offline range bar chart.

EA opens and closes trades just perfectly fine.

However I now want to operate my EA using the MT4 VPS hosting. But the EA does no longer open any trades. I have already read something about this failure a while back but cannot find the thread anymore.

I assume the problem is that my EA needs a "function" which tells the EA to use the range bar data which is generated by the other EA. I guess that if I used a regular VPS where the whole desktop is basically uploaded to the server, everything would just work fine as it would be completely the same as if the EAs were operated on my computers MT4 terminal. However because of the special hosting with MT4 VPS where only the EAs are uploaded to the server I end up getting this malefunction.

Am I correct with my analysis? Is it even possible to use the MT4 VPS if I want to use an EA which is based on the data of another EA? If yes, what exactly do I need to change to get everything up and running?

I once had the same problem! When using any kind of non-standard bar data generated by a separate EA or Indicator into Offline Charts (Range Bars, Renko, Point & Figure, etc.); your main EA is dependent on that, which makes back-testing extremely difficult and also makes it impossible to use MetaQuotes' VPS hosting.

Since I code my own EA's, what I did, was move all the generation code into my primary EA's, so that it generates its own bar data internally (stored as arrays of structures, such as "MqlRates"). In this way, you are no longer limited and can back-test it with no problem and also move it into a MetaQuotes' VPS host just as easily.

If you are a coder, then that is what I suggest you do. If not a coder, then you will have to explain this very clearly to the coder you hire, so that he/she can update your main EA's to generate the Range Bar data internally, and thus only have one EA to upload to MetaQuotes' VPS hosting.

PS! In my own EA's, I have successfully used this method for Range Bars, Renko Bars, Point & Figure as well as several other non-standrad types of my own. It is much faster than using Offline Charts and easily allows you to change settings on the fly (especially useful for back-testing). So I highly recommend you adapt your EA using this method, even if you don't end up using the MetaQuotes' VPS hosting.

EDIT: Remember also, that since the bar data is generated internally, any indicators which you previously used on the Offline Charts, will also have to be coded internally in the EA as well.

 
Fernando Carreiro:

I once had the same problem! When using any kind of non-standard bar data generated by a separate EA or Indicator into Offline Charts (Range Bars, Renko, Point & Figure, etc.); your main EA is dependent on that, which makes back-testing extremely difficult and also makes it impossible to use MQL5's VPS solution.

Since I code my own EA's, what I did, was move all the generation code into my primary EA's, so that it generates its own bar data internally (stored as arrays of structures, such as "MqlRates"). In this way, you are no longer limited and can back-test it with no problem and also move it into a MQL5 VPS just as easily.

If you are a coder, then that is what I suggest you do. If not a coder, then you will have to explain this very clearly to the coder you hire, so that he/she can update your main EA's to generate the Range Bar data internally, and thus only have one EA to upload to MQL5's VPS.

PS! In my own EA's, I have successfully used this method for Range Bars, Renko Bars, Point & Figure as well as several other non-standrad types of my own. It is much faster than using Offline Charts and easily allows you to change settings on the fly (especially useful for back-testing). So I highly recommend you adapt this method, even if you don't use the MQL5 VPS Hosting.

EDIT: Remember also, that since the bar data is generated internally, any indicators which you previously used on the Offline Charts, will also have to be coded internally in the EA as well.

Ok I thought of that method as well. So basically I have to copy the source code of the range bar EA into the code of my "trading EA". I will try it and hope to get everything working. Are you a coder? Could you give me a helping hand? Otherwise I will just open up a request in the freelance section if I don't get it to work. But I guess you exactly know the tweaks which are needed to get everything running.
 
Michael Breu: Ok I thought of that method as well. So basically I have to copy the source code of the range bar EA into the code of my "trading EA". I will try it and hope to get everything working. Are you a coder? Could you give me a helping hand? Otherwise I will just open up a request in the freelance section if I don't get it to work. But I guess you exactly know the tweaks which are needed to get everything running.

No! Copying the source code over will not do, because that would just generate an Offline Chart and be of no use to you.

You have to re-code the logic to produce the data internally according to the needs of your primary EA and store that data in for example in an MqlRates array or any other data structure that would be more fitting, such as any extra indicator data.

Yes, as I stated, I am a coder! On this thread, I can only offer guidance and minor assistance. Any major coding requirements would have to be via the "Freelance"!

History Data Structure - Data Structures - Standard Constants, Enumerations and Structures - MQL4 Reference
History Data Structure - Data Structures - Standard Constants, Enumerations and Structures - MQL4 Reference
  • docs.mql4.com
History Data Structure - Data Structures - Standard Constants, Enumerations and Structures - MQL4 Reference
 
hello Michael Breu, am have a renko bar that produces offline charts and on the other hand, an EA that trade on the offline chart, i dont know if you can help me out?
 
Nkechi Sonia Kanu: hello Michael Breu, am have a renko bar that produces offline charts and on the other hand, an EA that trade on the offline chart, i dont know if you can help me out?

That is exactly what the OP does NOT want! In order to use the MetaQuotes VPS hosting or use standard back-testing, you CANNOT use the Oflline Chart method. In order for it to work properly, the non-standand bar data has to be genreated within the primary EA and not by any kind of secondary EA or Indicator that outputs to an Offline Chart.

 
Fernando Carreiro:

That is exactly what the OP does NOT want! In order to use the MetaQuotes VPS hosting or use standard back-testing, you CANNOT use the Oflline Chart method. In order for it to work properly, the non-standand bar data has to be genreated within the primary EA and not by any kind of secondary EA or Indicator that outputs to an Offline Chart.


this is also the same thing i want, inside of running two seperate EAs, they should be combined into one EA

 
Nkechi Sonia Kanu:

this is also the same thing i want, inside of running two seperate EAs, they should be combined into one EA

Well then, do as I sugested and re-code it or if you don't know how, then place a request at the Freelance section as I explained in an earlier post!
 
Fernando Carreiro:

I once had the same problem! When using any kind of non-standard bar data generated by a separate EA or Indicator into Offline Charts (Range Bars, Renko, Point & Figure, etc.); your main EA is dependent on that, which makes back-testing extremely difficult and also makes it impossible to use MetaQuotes' VPS hosting.

Since I code my own EA's, what I did, was move all the generation code into my primary EA's, so that it generates its own bar data internally (stored as arrays of structures, such as "MqlRates"). In this way, you are no longer limited and can back-test it with no problem and also move it into a MetaQuotes' VPS host just as easily.

If you are a coder, then that is what I suggest you do. If not a coder, then you will have to explain this very clearly to the coder you hire, so that he/she can update your main EA's to generate the Range Bar data internally, and thus only have one EA to upload to MetaQuotes' VPS hosting.

PS! In my own EA's, I have successfully used this method for Range Bars, Renko Bars, Point & Figure as well as several other non-standrad types of my own. It is much faster than using Offline Charts and easily allows you to change settings on the fly (especially useful for back-testing). So I highly recommend you adapt your EA using this method, even if you don't end up using the MetaQuotes' VPS hosting.

EDIT: Remember also, that since the bar data is generated internally, any indicators which you previously used on the Offline Charts, will also have to be coded internally in the EA as well.

Could you Tell me how much effort it is for you to integrate a range bar creating Code Inside of my existing EA 
 
Michael Breu: Could you Tell me how much effort it is for you to integrate a range bar creating Code Inside of my existing EA 

Are you asking if it is difficult for me personally or are you asking in general terms?

In general terms, the amount of effort depends on your level of expertise at coding! For a good coder it can be relatively easy, but for someone with limited knowledge and experience at coding, it will be difficult!

PS! By "relatively easy", I don't mean a quick and simple piece of code. It can take some time and there is quite a bit of code involved, but for a good coder that knows what he is doing, it will not be difficult for him/her.

Reason: