Codes

Daily Profit Function for MetaTrader 5

A simple and easy to understand function that calculates todays profit, written to the Expert Journal

Forum

HLINE object not able to use opacity?

Hi guys, I've created a set of HLINEs on my chart, which i'm able to modify as expected. Except when it comes to opacity, it just seems to be ignored. In this example, there is no change of colour whatsoever: for ( int x= 5 ;x>= 1 ;x--) { double dhigh = iHigh ( _Symbol , PERIOD_D1 , x);

Receiving different losses on the same position size, with the same stop loss

Hi Guys, I was coding a dollar value lot calculator when i realised that the losses from my positions were different, even though the lot sizes and stop losses were set to the same Point value . Can someone explain why this might be? It's making the testing of the calculator a little tricky! In

Changing a HLine Scale Color

Hello, I have some HLINE objects on my chart that i'm having difficulty seeing in the scale section of the chart due to their colour. Attached is an example, showing 4 different lines. As you can see, the white lines are visible easily, the green is ok, but the blue is very difficult to read due to

Do i need an Array or List?

Hi everyone, I'm new to MQL5, so apologies if it's been posted before. I want to create either a list, or an array, where i can add/store double values, and be able to reference them. My confusion is that i don't know if i should use a collection, a list, or an array. And I've tried to do all three

How to create a Moveable Button

Hi guys, I know this is possible, but i cant figure it out. I want to click on a button to select it, and whilst it's selected, be able to move it on the Y axis. In this code example, i'm able to move it when the left button is held down, but that's regardless of it being selected or not. i.e. it

Middle Mouse button - Now unrecognised

Hi Guys, I have a function tied to my middle mouse button. Up until about an hour ago my middle button function was working, now it's not being recognised at all. I've got the following code to recognise any chart events to print their respective ID's out: if (id== CHARTEVENT_MOUSE_MOVE ) {