HomeSample Page

Sample Page Title


My shopper requested connect the Worth Vary indicator to his buying and selling robotic. Certainly, this permits the usage of totally different Cease Loss and Take Revenue values, in addition to quite a lot of buying and selling logic.

In the event you’re new to this highly effective indicator, you’ll be able to learn extra about it right here: Worth Vary Indicator – Keep updated with value actions.

You can even learn all about utilizing this indicator successfully right here: Buying and selling methods for the “Worth Vary MT5” indicator.

Let’s get again to attaching this indicator to your buying and selling robotic.

Here is a quick information on connect the Worth Vary indicator to your buying and selling robotic

1. Place the Worth Vary indicator in the identical folder as your robotic.

2. When receiving the indicator deal with through the iCustom perform, specify the precise identify of the indicator file (with out “.ex5“):

indiHandle = iCustom(_Symbol, _Period, “Worth Vary MT5”);

3. Within the case of a purchase sign, the buffer incorporates the present bar’s low value. Equally, within the case of a promote sign, the buffer incorporates the present bar’s excessive value. Due to this fact, we have to test whether or not the quantity within the buffer is the same as these costs. Since these are double numbers, they can’t be in contrast precisely; we have to use epsilon.

4. Get costs from the chart. We want the Low and Excessive costs of the identical bar from which we took the sign (the primary bar):

double barLow = iLow(_Symbol, _Period, 1);

double barHigh = iHigh(_Symbol, _Period, 1);

5. Set accuracy (epsilon). Let’s use _Point – the scale of 1 level (e.g., 0.00001). We contemplate numbers equal if the distinction between them is lower than half a degree.

double epsilon = _Point * 0.5;

6. Get knowledge from the primary bar (earlier closed):

if (CopyBuffer(indiHandle, 0, 1, 1, bufferBuy) < 0 || CopyBuffer(indiHandle, 1, 1, 1, bufferSell) < 0) {

    return;

}

7. Put together values for checking the sign:

double buyValue = bufferBuy[0];

double sellValue = bufferSell[0];

8. Examine purchase (UpTrend). The indicator writes Low[i] to the buffer. Checking:

A) The worth just isn’t empty (< DBL_MAX),

B) The worth within the buffer is sort of equal to the Low value.

bool isBuySignal = (buyValue < DBL_MAX) && (MathAbs(buyValue – barLow) < epsilon);

9. Examine promote (DownTrend). The indicator writes Excessive[i] to the buffer. Checking:

A) The worth just isn’t empty (< DBL_MAX),

B) The worth within the buffer is sort of equal to the Excessive value.

bool isSellSignal = (sellValue < DBL_MAX) && (MathAbs(sellValue – barHigh) < epsilon);

That’s it!

You should utilize the Worth Vary indicator with out attaching it to your buying and selling robotic

Do not forget that the Worth Vary indicator has a really handy, customizable notification system for brand spanking new developments, help and resistance ranges, and value ranges on any buying and selling image and timeframe.

Good luck together with your buying and selling!

Vladimir Toropov

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles