Well when developing your EA you should include some options which will affect how many lots to trade or you can just have as fixed lots and the user can change that at their will. There is no in built function for calculating lot sizes.
extern double Lots = 0.1; extern int Slippage = 5; // Adjust for 5 point brokers // If you then use the following for buy's OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, StopLoss, TakeProfit, comment, magic, 0, CLR_NONE); // and for sell's OrderSend(Symbol(), OP_Sell, Lots, Bid, Slippage, StopLoss, TakeProfit, comment, magic, 0, CLR_NONE);
Or
double Lots; Lots = CalcLots(); double CalcLots() { // Calculations to work out lots according to Money management return (Lots); }
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
Hey Every1,
I need to find out what options we have in MQL for working with volumes/sizes. We do get the best market bit and ask prices, but how do we find what amount is the user willing to buy or sell?
Regards,
Master