How to disable trade?

 

Hi All the MQL4 Experts,

I am new to this forum although I have been creating my EAs and Custom Indicators. I have one EA right now I used to display my account status like PipValue, Exposure, Margin Percent,... to help me make decision whether I Buy/Sell more or Close Buy/Sell tickets. Now I need to add one more feature: prevent me to open more order. This is what I can not in help file how to dissable trade in EA. I apreciate if any experts can help a litle bit.

Thank you very much.

Cuong

 

If you search the forum, you will find that the question (about how to limit the number of orders your EA makes) gets asked very, VERY frequently.


CB

 
cloudbreaker wrote >>

If you search the forum, you will find that the question (about how to limit the number of orders your EA makes) gets asked very, VERY frequently.

CB

Thank you for replying CB,

I have searched the forum but I can not find the solution so I asked. The problem is I didn't make it clear in my last post.

Here is the situation: I gave someone my account login, my EA and tell him to trade using that EA with certain rules. The EA helps him to make decision and warn him not to open more trades in certain conditions. But he is not always follow the rule. So now I need to find a way to prevent him doing that (manually open more trades).

I hope this is clearer. Thank you very much for helping me.

By reading the thread "Have you seen such a picture?" I am amazed by the skill of you and many people here have regarding to programing in MT4.

Regards,

Cuong

 
vccuong:
... I gave someone my account login, my EA and tell him to trade using that EA with certain rules. The EA helps him to make decision and warn him not to open more trades in certain conditions. But he is not always follow the rule. So now I need to find a way to prevent him doing that (manually open more trades).

You cant intercept the order, only deal with it after the fact

You could have an EA running on a VPS that monitored the account that would close excess orders (but costing the spread each time)

The manually placed orders will have a Magic Number of zero

IMHO - its not a good situation to try & fix

As often is the case, change the problem, by tking 'him' out of the loop!

Good Luck

-BB-

 

Yea - agree with BB. Either take him out of the loop or let him do whatever he wants with his own money.

To take him out of the loop:

- Change the passwords and give him the investor password only.

- YOU run the EA on a computer that you have access to with the main password.

- He can see the trades being placed, but he has no capability to do any trading.


CB

 

Thank you very much for your reply CB and BB,

If there is no way to do it in MT4, I have to find a different approach outside MT4. But my plan is to have others (more than one person) to trade manually using my EA as a guidance and restrict (or force to close all,...) the manual operation. This is like computer game, the platform and EA create an environment for players to play to achieve best results . Then I will let them get the bonus if they "play" well. Both benefit ffrom the model.

I am thinking about something out of MT4, may be AutoIt can help?

I know there are many experts in this forum. Appreciate your help.

Regards,

Cuong

 

I'm still struggling to understand why you wish to do what you're trying to do - so this may be a bit off beam.


Have you thought of using a Magic Number to identify all orders opened by your EA, then having the EA close all orders which do not have that Magic Number?


Does that sound like what you're wanting?


CB

 
cloudbreaker wrote >>

I'm still struggling to understand why you wish to do what you're trying to do - so this may be a bit off beam.

Have you thought of using a Magic Number to identify all orders opened by your EA, then having the EA close all orders which do not have that Magic Number?

Does that sound like what you're wanting?

CB

I am sorry CB.

The reason is my EA have not been smart enough to pick out the right entry and exit points. It "paint" a picture in different timeframes and from that a person can pretty easy to know where to enter or exit. So my system need both the EA and human interaction (semi-auto system). If I can transfer all the prediction skill/knowledge into the EA then I won't need this feature of preventing trader to manually open more trades.

If I have to close all orders which do not have the Magic Number I want, I have to pay the spread with no benefit. The EA has to prevent that kind of orders to be able to open.

May be disable the keyboard and mouse for a while until the serious condition is over....

Regards,

Cuong

 
vccuong wrote >>

I am sorry CB.

The reason is my EA have not been smart enough to pick out the right entry and exit points. It "paint" a picture in different timeframes and from that a person can pretty easy to know where to enter or exit. So my system need both the EA and human interaction (semi-auto system). If I can transfer all the prediction skill/knowledge into the EA then I won't need this feature of preventing trader to manually open more trades.

If I have to close all orders which do not have the Magic Number I want, I have to pay the spread with no benefit. The EA has to prevent that kind of orders to be able to open.

May be disable the keyboard and mouse for a while until the serious condition is over....

Regards,

Cuong

I have found a way and am following that direction: create an dll to disable mouse, it will then be linked to EA to be called in certain conditions.

 

"I have found a way and am following that direction: create an dll to disable mouse, it will then be linked to EA to be called in certain conditions"

Please how did you do it? Will dll work from the vps server or the the mt4.

I, very much interested in this topic.

 
realdream #: Will dll work from the vps server

No