Cumulative position price - page 2 12 New comment Icham Aidibe 2014.05.02 23:07 #11 Malacarne: Why don't you simply use trade.Sell( ... ) with it's own parameters ?You don't need to create a void function for that... well. i'm a newbie i just discovered mql5. plus, i may call this function many times, in many circumstances so ... for the param, no idea ? Rodrigo Malacarne 2014.05.02 23:14 #12 blouf: well. i'm a newbie i just discovered mql5. plus, i may call this function many times, in many circumstances so ... for the param, no idea ?Please take a look at this link. Alain Verleyen 2014.05.03 00:14 #13 blouf: I want to call it from another function and be allowed to pass how much lot i want : Sell(0.01); EDIT : if no param use a default valuevoid Sell(double Lots=0.01) { double Bid = SymbolInfoDouble(Symbol(), SYMBOL_BID); Trade.PositionOpen(_Symbol, ORDER_TYPE_SELL, Lots, Bid, 0, 0, OrderComment); } Icham Aidibe 2014.05.03 01:38 #14 angevoyageur: Then if i use Sell(0.02) it will bypass lots' default value right ? Rogerio Figurelli 2014.05.03 05:41 #15 blouf: Then if i use Sell(0.02) it will bypass lots' default value right ?Right, Sell(0.02) will set Lots=0.02, and Sell() will set Lots=0.01 12 New comment
Why don't you simply use trade.Sell( ... ) with it's own parameters ?
You don't need to create a void function for that...
well. i'm a newbie i just discovered mql5. plus, i may call this function many times, in many circumstances so ... for the param, no idea ?
I want to call it from another function and be allowed to pass how much lot i want : Sell(0.01);
EDIT : if no param use a default value
Then if i use Sell(0.02) it will bypass lots' default value right ?