Quote:
|
Originally Posted by Gavner
Hey-
Set an external double like:
extern double RiskFraction=0.1;
Then in the "start(" add:
double Lots=(MathRound(AccountFreeMargin()*RiskFraction/10.0)/100);
....
OrderSend(Symbol(),OP_BUY,Lots,Ask,0,0,0,"EA Name",MagicNum,0,Green);
.1 means risk 10% of your account.
Good luck  ,
Gavner
|
This is what i was looking for, for my EA.
Also, is there a part of code which will limit how many trades will be opened based on the Avaliable Margin.
Example: It will continue to open trades until 50% of the available Margin balance is used?
Thanks!
Spider~