Is it possible to generate images in MQL5 ?

 

Hello there,

I do believe I might have hit a wall with Mql5, I am in need to generate an image at runtime so that it can be passed to a AI model and based of the results continue with the execution of the program, I would like to have this functionality integrated in the EA/Indicator so that it would be possible to test the overall program in the strategy tester. So far I was not able to find any solution, that would not involve to make a call to functions prohibited in the tester ( like web requests or network functions ). The main priority is to be able to use the tester. 

Any suggestions ? Is it even possible ?

 
Jacopo Mendoza Betances:

Hello there,

I do believe I might have hit a wall with Mql5, I am in need to generate an image at runtime so that it can be passed to a AI model and based of the results continue with the execution of the program, I would like to have this functionality integrated in the EA/Indicator so that it would be possible to test the overall program in the strategy tester. So far I was not able to find any solution, that would not involve to make a call to functions prohibited in the tester ( like web requests or network functions ). The main priority is to be able to use the tester. 

Any suggestions ? Is it even possible ?

I have been thinking about a similar task, and taking screenshots is quite impractical. So my approach would be to actually render the image myself, using OHLC data. It would require some adjustments, but that's a possible way to go.

On the other hand, why render the image in the first place, and not feed the OHLC directly into the NN. Depending on the NN structure in use, it should be possible to get similar results.
 
 

I almost forgot about this post.

I kinda found a solution, an ugly one, I set up a python service that basically act as watcher on a file that every time it gets modified create the image based of the value in the file itself, then the image gets input into the model, and then write the result in the same file, in the meantime the mql5 program kinda engage in a delay tasks  whose purpose is to wait for the results of the file written by the python script by basically polling the file every '10k' write in a matrix ( this is ugly) for a limited time.

But in the end all of this turned out to be useless since I realized that the results I was obtaining despite having a high accuracy, they were not making any sense. 

Right now I'm refactoring the model and as @Dominik suggested, I'm using a different data for the model. Thanks everybody for the suggestions.