An
extern for the magic number is the way to go.
For
money management 
, I think you should add adnother
extern double called risk. Your lot size calculation would be something like:
Code:
lots = Normalizedouble(AccountFreeMargin() * risk / SL
, 2);
Where
risk is the
extern double and
SL is the stop loss in pips.
The above assumes that
risk is expressed as a fraction (eg: 2% risk would be
0.02 not 2.0) and the stop loss is expressed as five decimals (not four) so 50 pips would be 500 not 50. This brings up the issue of four/five decimal brokers. The best way to deal with this is in your EA, you have the following:
This way, the
SL 
can be expressed properly (eg: 50 pips is 50 not 500) and your lot size calculation would work like:
Code:
lots = Normalizedouble(AccountFreeMargin() * risk / SL
/ pt, 2);
If you also wanted the lot size based on the ATR, try this instead:
Code:
atr = iATR(NULL, 0, 14, 0);
lots = Normalizedouble(AccountFreeMargin() * risk / SL
/ pt / (mt * 10 * atr));
This first calculates the 14 bar ATR and then uses that
volatility 
factor in the lot size calculation.
My math may not be perfect so please debug everything before even backtesting.
Here is an interesting Blog about MQL4 and position sizing. The author does not address the issue of the four or five decimal
broker 
.
Rick