Forum

Reading client set volume with MQL5?

In Metatrader 5, the client can set a specific volume in the One-Click trading widget (and presumably somewhere else), and new orders will default to that number of contracts. My question is, where can I read that parameter (i.e. the volume the user set) in MQL5? I'm having trouble finding that

Have to pass array as reference, but it's a variable I cannot pass as reference?

Help me get out of this conundrum: In OnCalculate, I wish to pass the volume[] array to a custom function . However, I get the comical situation above; the custom function asks for arrays to be passed as reference, and yet OnCalculate doesn't allow me to pass volume[] as reference because it's a

MQL5: Creating a rectangle anchored in price for Y and chart corner for X

As far as my knowledge goes, MT5 has two ways of creating rectangle objects , OBJ_RECTANGLE and OBJ_RECTANGLE_LABEL (plus CCanvas rectangle, but that's another story): one shall be anchored in the chart data, the other must be anchored in the chart dimensions, fixing its position. What if I want to