The xCustomEA Advisor on the PipFinite Trend PRO. Automatic EA

MetaTrader Market: How to buy an advisor on mql5.com? How to rent? How to update? How to install it?
Partial Close and Trailing. Partial closing of positions on rollbacks
MetaTrader Market: How to buy an advisor on mql5.com? How to rent? How to update? How to install it?
Partial Close and Trailing. Partial closing of positions on rollbacks

Description

An example of programming a strategy for the PipFinite Trend PRO indicator and trading using our universal trading system Exp – The xCustomEA.

In this article, we will analyze in detail the custom Indicator PipFinite Trend PRO, downloaded from the MQL5 Market.

Let us analyze the ways of working with the Indicator and options for calling it in our Expert Advisor Exp – The xCustomEA.

Start

When developing the Exp – The xCustomEA Expert Advisor, we knew that most of our users do not learn how to program!

But do you need to have programming knowledge to trade on the Indicator?

We have done everything to make using our Expert Advisor easy and affordable.

Programming an Expert Advisor on the Indicator for 20 minutes? Easy!

Especially if the entire program code has long been executed flawlessly.

In our instructions for Exp – The xCustomEA, we have written the steps for programming strategies most clearly!

The first Indicator that we will use in our example, we have chosen not by chance.

The fact is that in the MQL5 Market, there are a lot of indicators for MT5 and MT4.

But we chose one of the most popular indicators on the market, which has 1000 reviews and is distributed for the MT4 and MT5 terminals.

The author of the Indicator also began to hide signal buffers and even wrote the numbers of these buffers! What is very important when developing an Expert Advisor on the Indicator?

PipFinite Trend PRO

To start working with the Indicator, we need to install it in our terminals!

How do you install the Indicator from the MQL5 Market?

Go to the indicator page for MT5 https://www.mql5.com/en/market/product/26889

Go to the indicator page for MT4 https://www.mql5.com/en/market/product/26888

Press the Download TRIAL or Free DEMO button.

We confirm the loading of the Indicator in our MetaTrader terminal.

Confirmation of Indicator loading in MetaTrader terminal
PipFinite Trend PRO Indicator in MetaTrader terminal

After downloading the Indicator from the MQL5 Market, it will appear in the Indicators \ Market folder of your MetaTrader terminal.

Indicator folder in MetaTrader terminal showing PipFinite Trend PRO

To test the Indicator, you need to right-click on the Indicator and select Test.

Indicator test option in MetaTrader

The Strategy Tester should open, where our Indicator will be selected.

Strategy Tester window in MetaTrader with Indicator selected

Definition of Signal Buffers

After that, we need to determine which signal buffers the Indicator uses to display information about the signals.

We need buffer numbers.

Initially, I tried to determine the buffer numbers myself, but it took a lot of time because the buffer numbers are not standard!

After reading the instructions for the Indicator, I found that the author did the right thing. He wrote the number of buffers for the Expert Advisor to work with. Much respect for this!

Indicator buffer numbers as per instructions

To find out the number of buffers for signals, we need to run the Indicator in the Visualization mode and open the Data Window.

Indicator running in Visualization mode with Data Window open

With these numbers, we can continue working!

I want to note that all buffers start at 0!

In this case, the BUY signal buffer is number 8.

The buffer for SELL signals is number 9.

This Indicator is very beneficial for our example because we can use two types of programming Expert Advisors on the Indicator:

  1. Signal programming in our Indicator Exp – The xCustomEA for signals (xCustomEA)
  2. Installing PipFinite Trend PRO as the main Indicator without separate programming (xArrow)

xArrow Work on the Indicator without Programming

Let’s start with the simplest direct indication of the PipFinite Trend PRO custom Indicator as xArrow.

So, as we know the number of buffers for the signals and also know that the Expert Advisor sets the arrows on the signal, the following process of setting up our Expert Advisor will take 10 seconds:

xCustomEA setup example with PipFinite Trend PRO
Easy installation guide for Expert Advisor

Opening Positions Signals

For MT4, we specify the name Market\\PipFinite Trend PRO

For MT5, we specify the name Market\\PipFinite Trend PRO MT5

Parameter SignalTypeIndicator = xArrow

Next, we need to specify the number of buffers to open positions!

The author of the Indicator has kindly provided these numbers, and we can easily see them in the Market Review:

  1. SignalBufferforBUY = 8
  2. SignalBufferforSELL = 9

All other default settings!

It looks like this:

  1. SignalNameIndicator = Market\\PipFinite Trend PRO MT5
  2. SignalTypeIndicator = 2
  3. TF_IndSigToTrade1 = 0
  4. OWNSIGNAL_shift = 1
  5. SIGNALStrategyInputs =
  6. SignalBufferforBUY = 8
  7. SignalBufferforSELL = 9

We checked the work of the Expert Advisor and determined that the Expert Advisor is trading on our Indicator for sure!

Expert Advisor trading on PipFinite Trend PRO Indicator

The results of the Expert Advisor’s work on the PipFinite Trend PRO Indicator will be presented below!

Closing Positions Signals

Closing positions signals in MetaTrader using PipFinite Trend PRO
for MT4, we specify the name Market\\PipFinite Trend PRO
for MT5, we specify the name Market\\PipFinite Trend PRO MT5
  1. CloseNameIndicator = Market\\PipFinite Trend PRO MT5
  2. CloseTypeIndicator = xArrow
  3. CloseTimeFrame = 0
  4. Close_shift = 1
  5. CloseStrategyInputs =
  6. CloseBufferforBUY = 9
  7. CloseBufferforSELL = 8

Next, we need to specify the number of buffers for closing positions!

The author of the Indicator has kindly provided these numbers, and we can easily see them in the Market Review:

  1. CloseBufferforBUY = 9
  2. CloseBufferforSELL = 8

As you can see, to close positions based on Indicator signals, it is enough to swap the numbers of buffers (By default, our Expert Advisor returns signals and closes positions using the opposite signal, but if you have special buffers to complete by certain rules, you can use them).

Closing positions using buffer numbers in MetaTrader

All other default settings!

Trend Signal Filtering

Trend signal filtering using PipFinite Trend PRO Indicator

For MT4, we specify the name Market\\PipFinite Trend PRO

For MT5, we specify the name Market\\PipFinite Trend PRO MT5

  1. FilterNameIndicator = Market\\PipFinite Trend PRO MT5
  2. FilterTypeIndicator = 2
  3. FILTER_TF_IndSigToTrade1 = 0
  4. FILTERSIGNAL1_shift = 1
  5. FILTERStrategyInputs =
  6. FilterBufferforBUY = 10
  7. FilterBufferforSELL = 11

Next, we need to specify the number of buffers for filtering positions!

The author of the Indicator has kindly provided these numbers, and we can easily see them in the Market Review:

  1. FilterBufferforBUY = 10
  2. FilterBufferforSELL = 11

These values are similar to the values when opening positions. They can be used with other indicators.

For example, to use one Indicator to indicate and to filter signals, showing this Indicator with filters.

The author specifies these filters as UpTrend and DnTrend lines.

UpTrend and DnTrend filter lines in PipFinite Trend PRO Indicator

All other default settings!

StopLoss and TakeProfit from the Indicator

StopLoss and TakeProfit settings in PipFinite Trend PRO Indicator

For MT4, we specify the name Market\\PipFinite Trend PRO

For MT5, we specify the name Market\\PipFinite Trend PRO MT5

  1. SLTPNameIndicator = Market\\PipFinite Trend PRO MT5
  2. SLTPTypeIndicator = 1
  3. SLTPTimeFrame = 0
  4. SLTP_shift = 1
  5. SLTPStrategyInputs =
  6. SLTPBufferforBUY_StopLoss = -1
  7. SLTPBufferforSELL_StopLoss = -1
  8. SLTPBufferforBUY_TakeProfit = 13
  9. SLTPBufferforSELL_TakeProfit = 13

Next, we need to specify the number of buffers to get the TakeProfit values!

The author of the Indicator has kindly provided these numbers, and we can easily see them in the Market Review:

  1. SLTPBufferforBUY_TakeProfit = 13
  2. SLTPBufferforSELL_TakeProfit = 13

Here, we specify the same buffer. The author provides a TakeProfit for the price, and at the time of the new signal, buffer number 13 is filled.

For StopLoss, the author does not specify the buffer number. StopLoss is not provided in this strategy! You can set your Stop Loss in our Expert Advisor’s settings in the Stops section.

The author also pointed out two TakeProfit buffers to us.

Middle at number 12

Far at number 13

We used the long-range TakeProfit. You can specify 12 for the near TakeProfit!

TakeProfit buffer settings in PipFinite Trend PRO Indicator

The result of the closing by TakeProfit indicator:

Closing positions by TakeProfit in MetaTrader

All other default settings!

Testing Expert Advisor PipFinite Trend PRO

After verifying the correctness of the signals, we will run the Expert Advisor test on the Indicator on EURUSD H1 from 2018-01-01 to 2018-09-27.

By the way, we see that the Expert Advisor works almost equally on the two terminals, MT4 and MT5.

Expert Advisor test results on MT4 and MT5 terminals
Expert Advisor test results on EURUSD H1

Findings

We will not conduct numerous tests of this Indicator; you can use our example of working with this Indicator and optimize the parameters of our Expert Advisor with different options for employing functions.

Remember that for the Indicator and Expert Advisor to work on your demo account or live account, you need to buy Exp – The xCustomEA and the PipFinite Trend PRO Indicator for the terminal you will work with!

By buying our Exp – The xCustomEA, you can program any strategy using any indicators!

How do you load the PipFinite Indicator with custom settings in MT5?

Many users want to download PipFinite with custom settings.

In MT5, you can use the SIGNALStrategyInputs parameter and list the parameters, separated by commas!

There are rules for writing parameters. You can read them here: Exp – The xCustomEA Expert Advisor.

EXAMPLE:

Example of SIGNALStrategyInputs parameters
SIGNALStrategyInputs External parameters for the custom Indicator, in SignalTypeIndicator = xArrow mode.
You can specify the external variables of the Indicator as they are written in the settings table, separated by commas!
Important: You must respect the order of variables and the type of variables.
  • int x 110777
  • double xx Be sure to specify with a decimal point. 0.2, 1.1, 0
  • String “x” In MT5: Be sure to specify the string (not numbers). You can write as “X”.
    In MT4: Attention! In the version for MetaTrader4, it is forbidden to transfer string parameters! When passing string parameters, the Indicator may not load correctly!
    “XXX”, “TEST SAME”
  • datetime D’year.month.day’ Mandatory indication of D and single quotes. D’2018.11.08′, D’2015.01.01′
  • color C’red/green/blue’ Mandatory indication of C and single quotes.
    Color enumeration through slash / C’0 / 128/128′, C’0 / 256/0′
  • enum (list, enumeration) x (digit) If your Indicator has a list (selecting a parameter from the list), in the settings, you need to write a number!
    An example of how to do this: eg
    int InpCCIPeriod = 1;
    double InpCCIPeriod2 = 2.0;
    color InpCCIPeriod3 = clrGreen;
    string InpCCIPeriod6 = “text”;
    datetime InpCCIPeriod4 = 2018.11.08;
    bool InpCCIPeriod5 = false;
    Written as: SIGNALStrategyInputs = 1,2.0, C’0 / 128/0 ‘, “text”, D’2018.11.08’, false

How do you use the Indicator PipFinite with custom settings in MT4?

Do many users want to use xCustom with PipFinite settings?

In MT5, you can use the SIGNALStrategyInputs parameter and list the parameters, separated by commas!

Warning! In the version for MetaTrader4, passing string parameters is forbidden! When transferring a string parameter (string), the Indicator may not load correctly!

Therefore, we need to program the MT4 Indicator with its indicator parameters.

STEP 0 in Step MT4 0: Add variables (strictly in the order presented indicator parameters)

e.g.:

string ___1;
int Period_1=30;
double Factor_1=1.00000000;
int Lookback=5000;
string ___6;
int Misc_1=1;
int Misc_2=1;
int Misc_5=1;
int Misc_3=1;
string ___2;
int Show_1=1;
int Show_12=1;
int Show_7=1;
int Show_4=1;
int Show_3=1;
int Show_10=1;
int Show_9=1;
int Show_8=1;
int Show_2=1;
int Size_1=8;
int Show_11=1;
int ChartFG=0;
string ___3;
color Color_bull_1=25600;
color Color_bear_1=128;
color Color_bull_2=65280;
color Color_bear_2=255;
color Color_bull_3=16776960;
color Color_bear_3=65535;
color Color_bull_4=16776960;
int LWidth_bull_4=2;
color Color_bear_4=255;
int LWidth_bear_4=2;
color Color_bull_5=16776960;
int LWidth_bull_5=0;
color Color_bear_5=255;
int LWidth_bear_5=0;
color Color_exit_1=65535;
int LWidth_exit_1=0;
color Color_exit_2=65535;
int LWidth_exit_2=0;
color Color_exit_3=65535;
int LWidth_exit_3=0;
color Color_exit_4=65535;
int LWidth_exit_4=2;
color Color_exit_5=16711935;
int LWidth_exit_5=1;
color Color_3=5197615;
color Color_1=8388608;
color Color_2=5197615;
color Color_7=128;
color Color_win_1=65535;
color Color_loss_1=16711935;
string ___4;
int Show_5=1;
int Show_6=1;
int Size_2=8;
int XCoordinateOffset=8;
int YCoordinateOffset=8;
double YCoordinateSpacing=2.00000000;
double BG_X_Size_Factor=20.00000000;
int Display_1=0;
color Color_4=0;
int Use_1=1;
color Color_6=16777215;
int Use_2=1;
color Color_8=65280;
color Color_9=255;
color Color_10=65535;
color Color_5=5767168;
string ___5;
int Alert_1=1;
int Alert_2=0;
int Alert_3=0;
int Alert_4=0;
string SoundFile="alert.wav";
int Alert_5=0;

So, we need only the first 4 parameters because the other parameters are for drawing (we do not need them). We use only:

string ___1;
int Period_1=30;
double Factor_1=1.00000000;
int Lookback=5000;

Adding these parameters in STEP 5:

It will be like this:

custom_buffer_for_Open_BUY[inum]=iCustom(StrategySymbolString, StrategyTimeFrame, "\\Market\\PipFinite Trend PRO", ___1, Period_1, Factor_1, Lookback, 8, StartCopyI+inum);
custom_buffer_for_Open_SELL[inum]=iCustom(StrategySymbolString, StrategyTimeFrame, "\\Market\\PipFinite Trend PRO", ___1, Period_1, Factor_1, Lookback, 9, StartCopyI+inum);

Now, our Indicator will load the PipFinite Trend PRO Indicator with parameters!

After that, we will use our Indicator.

Therefore, we adjust the Expert Advisor xCustom to work with our new Indicator:

Adjusting Expert Advisor to work with new Indicator

Check that it worked:

Expert Advisor successfully trading with PipFinite Trend PRO Indicator

This post is also available in: English Українська Portuguese Español Deutsch Chinese Русский Français Italiano Türkçe 日本語 한국어

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.


     

    Risk Warning:


    Past trading performance does not guarantee future results.

    Trading foreign exchange on margin carries a high degree of risk and may not be suitable for all investors.

    Be aware that using trading robots involves substantial risk, and you could lose more than your initial investment.

    Please proceed with caution, assess your financial situation carefully, and consider seeking advice from a qualified professional.

    Disclaimer

    This website uses cookies to improve your experience. By using this website you agree to our Data Protection Policy and Disclaimer.
    Read More