Thread: How to code?
View Single Post
  #114 (permalink)  
Old 06-21-2006, 05:28 PM
Spider4896's Avatar
Spider4896 Spider4896 is offline
Member
 
Join Date: Apr 2006
Posts: 69
Spider4896 is on a distinguished road
Question

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~

Last edited by Spider4896; 06-22-2006 at 01:11 AM. Reason: Adding response
Reply With Quote