Custom MQL code for saving a template
-
At the moment i am creating a robot to automate a bunch of pre-work (setting up charts for me to analyze). Part of this includes the automated saving of the current chart template when a button is pressed.
I found the following code:
bool ChartSaveTemplate(
long chart_id, // Chart ID
const string filename // Filename to save the template
);When putting the above within a custom MQL block and defining ID and name i get the following errors:
'ChartSaveTemplate' - function declarations are allowed on global, namespace or class scope only
Can anyone tell me the correct way of doing this? Thanks
-
Ok, apparently it had to do with me using using the code in the wrong way. Apparently its used this way:
//--- Save the result in a template
ChartSaveTemplate(0,"EURUSDTEST");Not able to remove this topic due to permissions, but perhaps anyone else finds this helpfull..
-
@robertk Thank you for sharing.