Download MetaTrader 5
To add comments, please log in or register
Post web links to other trader's signals and make profit
Automated-Trading
Admin
98900
Automated-Trading 2014.07.31 10:18 

Long position:

A simple script that allows you to open a long position using the current price location with a specified Risk Percentage and Reward Ratio.

Author: Marcus Wyatt

Joshua
120
Joshua 2016.09.22 21:09  
   double percentage   = RiskPercentage / 100;
   
   if(percentage > MAX_PERCENT) percentage = MAX_PERCENT;
   

   
   lots = (final_account_balance*(RiskPercentage/100.0))/(lots_size/leverage);
   //----
   return( lots );

In these lines of code you calculate the percentage and limit this but later in the calculation of lots_size you don't use the limited "percentage" value.

I don't think that this would be correct cause "percentage" is not used in the codesnippet anymore, pls check this. 

/
To add comments, please log in or register