When posting code sections, please use the SRC button (located at the top of the comment entry area next to the camera icon).
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
could someone please help me in coding this:
double lotsoptimized(){
double lot;
if(stoploss>0)lot=AccountBalance()*(risk/100)/(stoploss*pt/MarketInfo(Symbol(),MODE_TICKSIZE)
*MarketInfo(Symbol(),MODE_TICKVALUE));
else lot=NormalizeDouble((AccountBalance()/lotsize)
*minlot*risk,lotdigits);
return(lot);
}
into the file for risk management so that
2% Per Trade Risk Formula
Account size x 2% = Risk Amount
$10,000 X 2% = $200
If you had a $10,000 account balance and 200 pip stop and selected 2% risk per trade, you would be able to trade only 0.1 lots because 0.1 lots stopped out at the 200 pips stop loss would be $200 or 2%