Download MetaTrader 5

Can I use a function for lot size in OrderSend() ?

To add comments, please log in or register
Do you want to write a technical indicator? Find solution in MQL5 Reference!
Agent86
914
Agent86 2014.11.09 00:19 
Is this not legal ?

ticket = OrderSend(Symbol(),OP_BUY,martingale(),Ask,3*pips2points,Ask-(StopLoss*pips2dbl),Ask+(TakeProfit*pips2dbl),NULL,MagicNumber,0,Green);

The return value of the martingale() function will be a double

Please advise
honest_knave
Moderator
2182
honest_knave 2014.11.09 00:30  
You'll probably want to make sure that your return value complies with minlot, maxlot and lotstep 
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.11.09 01:03  
Agent86:
Is this not legal ?

ticket = OrderSend(Symbol(),OP_BUY,martingale(),Ask,3*pips2points,Ask-(StopLoss*pips2dbl),Ask+(TakeProfit*pips2dbl),NULL,MagicNumber,0,Green);

The return value of the martingale() function will be a double

Please advise

If it is working, then it should be no problem.
Agent86
914
Agent86 2014.11.09 14:47  
Ok thanks all

I thought that it should be legal but wanted some confirmation to be sure I'm going in the right directing with this function
Thanks again
To add comments, please log in or register