In my manual trading, I like to make things as easy as possible so I've coded a number of scripts to help me place trades and adjust stops etc. However, I've recently coded a couple of very simple EA's to wait for the right time to enter and then place the trade before removing themselves much like a script would. An example of the code from one that opens a trade on the next Heiken Ashi change for example would be:
Code: Select all
if(HATrend ==-1 && HATrend1 ==1)
{
Print("HA_Open: Opening Trade at the switch to a bullish HA trend");
PlaceBuyTrade();
} Code: Select all
// wrap up and remove
if(gBuyTicket!=0)
{
Print("HA_Open: Buy Trade Placed. Expert Removing");
Comment("");
ExpertRemove();
}It seems that ExpertRemove(); has not done a full job of removing it. If I look at the chart there is no evidence of the EA in the top right hand corner and there is no Expert Properties in a right click context menu. However, if I open up the profile file and read the entry for that chart, the EA is shown as loaded!
Does anyone else have any experience of using ExpertRemove and is there something else I should be doing? I did have my computer crash yesterday (which means the profile wasn't saved on exit) which might explain it but I'd assumed that if the EA was in the chart's profile then it should show on the chart?
I've manually deleted it from the profile which has stopped the issue but I thought I'd flag it in case anyone else is using helper EA's or has seen this issue before.
Bruster