hi, I just noticed the indicator EMA_Prediction.mq4 contains a serious bug.
I spent all day yesterday marking my nice chart with vertical lines so that I would know when something important occured.
I put this indicator on and then took it off the chart... bad idea... all my lines are gone... I know it's my fault for not looking at the code before running but just in case there are some others who don't proof-read before running, I thought I'd give you the heads up.
So just to recap...
EMA_Prediction.mq4 will delete all your Vertical Lines on the chart when you remove it or whenever else metatrader calls the deinit() function
my suggestion to the author would be to incorporate code similar to this:
Code:
// will delete all objects that contain aID_Prefix
void deleteObjects(string aID_Prefix) {
int nObjects = ObjectsTotal();
for (int i=nObjects; i>=0; i--) {
string objName = ObjectName(i);
if(StringFind(objName, aID_Prefix, 0) >= 0)
ObjectDelete(objName);
}
}
and to give his vlines all the same prefix that wouldn't conflict with those of another script... e.g. "EMA_PREDICTION_VLINE_"
[DISCLAIMER: use this code at your own risk. I am not responsible for any code I create. However, it seems to work for me so far just fine. Just be aware if you are too lenient with the aID_Prefix it will delete alot of objects... e.g. aIDPrefix="a" would delete all those CONTAINING "a". If you want to only delete those starting with "a" then I would suggest changing the StringFind's >=0 to just 0. Although I have not tested that modification, it should work]