Help for Ea

 

I am using martingale Ea, but i want add one funtion for him,


eg: I have $10.000 and when my Equity >= 12000 close all orders or Equity <= 8000 Closeallorders


Anybody can help me ? Thanks

 

It is easy job, you just change a little bit on your original code. there are standard functions available to be used.

1) check Equity using

double AccountEquity( )

2)using if clause to determine the condition

3)using loop while or for to select all orders

3)close selected orders using

bool OrderClose( int ticket, double lots, double price, int slippage, color Color=CLR_NONE)

but let me tell you something, in that way you mentioned can't help you make profit at all when using martingale Ea. you will find there are good periods followed by a big balance (or equity) drop to 8000 or less and never start again.

i think you want control the risk to 20% instead of $8000. in this way you will find a long good periods followed by a big drop (say 20%) again and again. the final result must be 0 or less.

 
Thanks i will try, i am newbie in mql4 i you help is great.
Reason: