How to control Maximun active trades on an MT4 EA

rolom

Trader
Sep 30, 2024
6
0
7
Panama
Hi, somewhere on internet I find the MT4 EA call it silva.mq4 wich can be used to control how many trades can active on an EA.

Even I reviewed set data wich is magic number and # of desire trades. It won control the number of trades and my EA continue taking more trades that I want.
Does any body can help me with an script or and EA that can control the number of trades taking by an MT4 EA?
 
Last edited:
Hi, somewhere on internet I find the MT4 EA call it silva.mq4 wich can be used to control how many trades can active on an EA.

Even I reviewed set data wich is magic number and # of desire trades. It won control the number of trades and my EA continue taking more trades that I want.
Does any body can help me with an script or and EA that can control the number of trades taking by an MT4 EA?
//----

it would help if you posted that silva ea so we could see.....

there are 3 common options...... the first is the best......

1. recode your ea to only allow only your maximum trades and no more.......

2. manually turn off auto trading....... either by running a script...... or simply clicking the algo trade button..... this means you would need to be present......

3. code a stand alone ea that will toggle algo trading off once the maximum trades are open...... let that run on another chart...... very few know how to to that......

the absolute best method is 1.......h
 
In addition to what @hayseed said, it's important to note that one EA cannot stop another EA from taking new trades without disabling autotrading for the entire platform. At best, it can close new trades when their number increases above the set threshold. Anyway, it would help to understand what your setup is and what your goals are.
 
Hi, thanks for your prompt answer.
Attached pls find the file.
Aggre with You best option is number one, but number 3 can be also a solution, best if there is also a stand alone ea to toggle algo trading on once for example trades open are = 1.

Rgds rolom
//----

it would help if you posted that silva ea so we could see.....

there are 3 common options...... the first is the best......

1. recode your ea to only allow only your maximum trades and no more.......

2. manually turn off auto trading....... either by running a script...... or simply clicking the algo trade button..... this means you would need to be present......

3. code a stand alone ea that will toggle algo trading off once the maximum trades are open...... let that run on another chart...... very few know how to to that......

the absolute best method is 1.......h

//----

it would help if you posted that silva ea so we could see.....

there are 3 common options...... the first is the best......

1. recode your ea to only allow only your maximum trades and no more.......

2. manually turn off auto trading....... either by running a script...... or simply clicking the algo trade button..... this means you would need to be present......

3. code a stand alone ea that will toggle algo trading off once the maximum trades are open...... let that run on another chart...... very few know how to to that......

the absolute best method is 1.......h
 

Attachments

Last edited:
Hi, thanks for your prompt answer.
Attached pls find the file.
Aggre with You best option is number one, but number 3 can be also a solution, best if there is also a stand alone ea to toggle algo trading on once the minimun trades are open.

Rgds rolom
That EA doesn't control anything on its own. It just shows the code that can be used in your own EA to control that.
If you want a stand-alone EA that disables autotrading when a certain number of trades is reached, you can check our Account Protector:
https://www.earnforex.com/metatrader-expert-advisors/Account-Protector/
 
Hi, thanks for your prompt answer.
Attached pls find the file.
Aggre with You best option is number one, but number 3 can be also a solution, best if there is also a stand alone ea to toggle algo trading on once for example trades open are = 1.

Rgds rolom
//-----

that is something i wrote...... just as an example for someone, perhaps silva, on how to count trades......

the idea is to use the int CountMagicNumber(int number) function to return the total trades and then allow or not further trades being placed with that magic number......

it has of no real practical value other than an code example......h
 
//----

it would help if you posted that silva ea so we could see.....

there are 3 common options...... the first is the best......

1. recode your ea to only allow only your maximum trades and no more.......

2. manually turn off auto trading....... either by running a script...... or simply clicking the algo trade button..... this means you would need to be present......

3. code a stand alone ea that will toggle algo trading off once the maximum trades are open...... let that run on another chart...... very few know how to to that......

the absolute best method is 1.......h
Hi, is there anybody can help me with option 3: A mt4 ea that will toggle algo trading off once the maximum trades are open.
Tks.
 
Hi, is there anybody can help me with option 3: A mt4 ea that will toggle algo trading off once the maximum trades are open.
Tks.
See my post above. However, please be aware that turning autotrading off when a certain number of trades is reached will prevent your main EA from closing the trades as well. Some EAs don't need to close their trades manually (as they rely purely on SL and TP), but some do close their trades and they need algo trading to be enabled for that.
 
//----

it would help if you posted that silva ea so we could see.....

there are 3 common options...... the first is the best......

1. recode your ea to only allow only your maximum trades and no more.......

2. manually turn off auto trading....... either by running a script...... or simply clicking the algo trade button..... this means you would need to be present......

3. code a stand alone ea that will toggle algo trading off once the maximum trades are open...... let that run on another chart...... very few know how to to that......

the absolute best method is 1.......h
Post automatically merged:

Hi, I am looking for someone who code a stand alone ea that will allow macimun x number of trades and close trades and toggle algo trading off once X minutes has passed since older trade was open.
 
Post automatically merged:

Hi, I am looking for someone who code a stand alone ea that will allow macimun x number of trades and close trades and toggle algo trading off once X minutes has passed since older trade was open.
//----

hey rolom...... i have moved to mq5 and no longer have mq4 on any computer...... nor do i have an account with any broker that offers mq4......

it sounds like you just need a function that can be added to your existing ea which will deny trades once your conditions are met.......

do you have an existing ea your using that need those conditions added......h
 
//----

hey rolom...... i have moved to mq5 and no longer have mq4 on any computer...... nor do i have an account with any broker that offers mq4......

it sounds like you just need a function that can be added to your existing ea which will deny trades once your conditions are met.......

do you have an existing ea your using that need those conditions added......h
Hi,
I Still use MT4 on Roboforex I ant testing 3 diferent EA all in MT4

I want is a diferent MT4 EA that allows to choose how may trades can remain open at same time and also if the older trades complete more than XX minutes the EA close all trades and togle auto trading OFF ( with yes / nor Option)

Regards,
rolom02