I need a programmers help adding MM to my EA. I want it to add lots as the account balance increases or decreases so it trades a certian % of account on each position.
so far I have this...
If I set the lot size it takes trades just fine but I cant get it to take trades if I set a percentage.
extern int MagicNumber=10001;
extern double PercentRisk=0;
extern double Lots =0;
extern double StopLoss=0;
extern double TakeProfit=0;
extern int TrailingStop=0;
extern int Slippage=3;
double PipValue = MarketInfo(Symbol(), MODE_TICKVALUE);
Lots = Normalizedouble(AccountBalance() * PercentRisk / StopLoss / PipValue),2);
so far I have this...
If I set the lot size it takes trades just fine but I cant get it to take trades if I set a percentage.
extern int MagicNumber=10001;
extern double PercentRisk=0;
extern double Lots =0;
extern double StopLoss=0;
extern double TakeProfit=0;
extern int TrailingStop=0;
extern int Slippage=3;
double PipValue = MarketInfo(Symbol(), MODE_TICKVALUE);
Lots = Normalizedouble(AccountBalance() * PercentRisk / StopLoss / PipValue),2);