Thread: How to code?
View Single Post
  #113 (permalink)  
Old 06-20-2006, 05:06 AM
Gavner Gavner is offline
Junior Member
 
Join Date: Apr 2006
Location: Boston
Posts: 8
Gavner is on a distinguished road
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
Reply With Quote