This category contains 7 posts

MQL5: Getting your EA to manage its own orders with others around

Before we get data about a position, we need to ‘select’ it first. ‘Selecting’ a position “copies data about a position into the program environment, and further calls of PositionGetDouble(), PositionGetInteger() and PositionGetString() return the earlier copied data. This means that the position itself may no longer exist (or its volume, direction, etc. has changed), … Continue reading

MQL5: Getting indicator values – default indicator function versus iCustom()

Posting this as a repository for myself as I can’t remember what I wrote yesterday much less a few months ago. This script illustrates 2 things: 1. Getting indicator values in MQL5 is more laborious than in MQL4 if you only need 1 value 2. Calling a default indicator function versus iCustom() Know that iMACD() … Continue reading

Getting Fibonacci prices from the percentage level

Getting a price at a Fibonnaci percentage level is a straightforward mathematical calculation. We just need to define 3 things: 1. Price at 100% 2. Price at 0% 3. Percentage to return Price at This is a script illustrating all the calculation needed: You just need these 2 lines to to obtain your required price … Continue reading

MQL: Making your extern inputs as a dropdown list of fixed options

A quick script illustrating making your extern inputs as a dropdown list of fixed options. This is what will be seen.

MQL: Get maximum value in an array

Simple script illustrating getting the maximum value in an array. Code identical for MQL4 and MQL5. MT4 output: MT5 output:



Flag Counter