Don't you think that sometimes it's necessary to automatically remove EA from chart?
Just to be sure that in case of some error or big loss or anything else it won't make any
other trades which would harm your account.
Very popular solution is that there exist some boolean type viariable like "allowTrading" which is being checked
before any order is send to the market. However, it means that our EA which made something wrong is still working!
On one forum I found another solution which uses windows api (via dll call). It's just:
PostMessageW( WindowHandle( Symbol(), Period()), WM_COMMAND, 33050, 0);
[there are two versions, you should use that with "W" as MetaQuotes changed defauld encoding. Well, in fact both versions works, but you know, just to be sure].
Calling this function will completely remove EA from chart and then you can be sure that it won't harm your account. I attached an example so you can check how it works (remeber to allow dll call).
I you are intereseted in another solutions visit caterpillarfx.com and check our free demonstration EA!
Just to be sure that in case of some error or big loss or anything else it won't make any
other trades which would harm your account.
Very popular solution is that there exist some boolean type viariable like "allowTrading" which is being checked
before any order is send to the market. However, it means that our EA which made something wrong is still working!
On one forum I found another solution which uses windows api (via dll call). It's just:
PostMessageW( WindowHandle( Symbol(), Period()), WM_COMMAND, 33050, 0);
[there are two versions, you should use that with "W" as MetaQuotes changed defauld encoding. Well, in fact both versions works, but you know, just to be sure].
Calling this function will completely remove EA from chart and then you can be sure that it won't harm your account. I attached an example so you can check how it works (remeber to allow dll call).
I you are intereseted in another solutions visit caterpillarfx.com and check our free demonstration EA!
Attached File(s)
testDelete.mq4
2 KB
|
125 downloads
Check CaterpillarFX