Skip to content

FX-Git

Metatrader, R and Python for Happi Online Traders

  • Home
  • Python, R for Trading
    • Articles
    • RStudio (External)
  • Pricing
  • Telegram
  • Login
  • Timeline
  • Home
  • Python, R for Trading
    • Articles
    • RStudio (External)
  • Pricing
  • Telegram
  • Login
  • Timeline

Tag Archives: signal

  • Home
  • Posts tagged "signal"

Monte Carlo Analysis of Two Metatrader Signal Providers

Introduction

TL;DR

We perform a comparative analysis of two Metatrader Signal Providers. The initial Monte Carlo Analysis shows that the first signal provider has a significantly higher return. However, we will show you that an extended MCA, which account for slippages, changes the ranking of the signal providers and ensures a realistic simulation and analysis of returns.

Stylized Facts

  • When evaluating a signal provider, a higher average profit ensures a sufficient buffer for slippages.

  • An extended Monte Carlo Analysis, which account for slippages, ensures a realistic simulation and analysis of returns.

  • As we will show below, an extended MCA may change the ranking of the signal providers, which in turn affects your portfolio.

Step 1 - Get Statistics

In order to perform a Monte Carlo Analysis ["MCA"] of a Signal Provider, we require several inputs:

  • Total Trades

  • Avg Profit ($)

  • Avg Loss ($)

  • Win Percentage

Let us do a comparative analysis of Automated Robot 1 ["AR1"] and Automated Trading Robot 2 ["ATR2"].

Statistics of AR1

  • Total Trades: 311

  • Avg Profit ($): 7.92

  • Avg Loss ($): -7.48

  • Win Percentage (decimal): 0.9389

Statistics of ATR2

  • Total Trades: 657

  • Avg Profit ($): 10.79

  • Avg Loss ($): -8.29

  • Win Percentage (decimal): 0.9452

Trade Simulation

The MCA function requires a time series of returns (zoo object) as input, hence we need to simulate the returns, given the statistics above.

The function monteSimulateReturnsZoo() returns a time series of returns (zoo object) and accepts FIVE inputs:

  • tradesNum - a integer for total trades

  • pAvgNum - a double for average profit in dollars

  • lAvgNum - a double for average loss in dollars

  • wPctNum - a double for winning percentage in decimal

  • initNum - a double for initial capital in dollars (default: 10000)

Type the following command in R to simulate returns for both AR1 and ATR2:

 > AR1Zoo <- monteSimulateReturnsZoo( 311, 7.92, -7.45, 0.9389 )
 > ATR2Zoo <- monteSimulateReturnsZoo( 657, 10.79, -8.29, 0.9452 )

Step 2 - Monte Carlo Analysis

A Monte Carlo Analysis is a series of random walk forward returns that shows a set of possible outcomes. Each line represents a possible return of a client who follows the given signal provider. Hence, if there are a hundred lines, then these represents 100 possible returns of each client.

Advantages

We use MCA to look at the worst and average lines from all possible returns to evaluate a signal provider.

For example, from the worst case line, we can estimate the worst case drawdown of our portfolio. If this percentage is too high for our risk appetite, then we should not follow the signal.

Next, we look at the average line, where we can expect to get a similar return for our portfolio. Hence, we should estimate our initial capital to ensure a significant average profit, net of fees. In other words, if the average net profit isn't sufficient, then we should not follow the signal or we could increase our initial capital.

Disadvantages

As the MCA is a series of random walk forward returns, each set may not cover all possible outcomes in the universe. Hence, when we look at the worst or average lines from a set, we are only looking within a subset of the whole universe.

The output of the MCA is only as good as the inputs. We perform an Extended MCA to allow for slippages, which affect the outcomes.

MCA in R

The function MonteGrowReturns() returns a Monte object and accepts SEVEN inputs:

  • rawZoo - a zoo object of time series returns

  • setNum - an integer of number of lines

  • sizeNum - an integer of block size, where blocks are kept together (default: 1)

  • initNum - a double for initial capital in dollars (default: 10000)

  • replaceBln - a boolean for sampling replacement (default: TRUE)

  • summary - a boolean for summary (default: TRUE)

  • debug - a boolean for debugging (default: FALSE)

Type the following command in R to perform MCA for both AR1 and ATR2:

 > AR1Monte <- MonteGrowReturns(AR1Zoo, 100)
 > ATR2Monte <- MonteGrowReturns(ATR2Zoo, 100)
 > plot(AR1Monte)
 > plot(ATR2Monte)

Note: At writing, there appears to be an error in the summary, hence we set summary to FALSE. Otherwise, we should accept all other default values.

Results

 # Summary of AR1
 Initial equity balance    : 10000.00 
 Absolute maximum drawdown :   -51.33 ( -0.4%) [set = 99]
 Absolute median drawdown  :   -25.87 ( -0.2%)
 Absolute minimum drawdown :   -14.90 ( -0.1%) [set = 88]
 Maximum equity balance    : 12341.67 ( 23.4%) [set = 70]
 Median equity balance     : 12157.23 ( 21.6%)
 Minimum equity balance    : 11960.57 ( 19.6%) [set = 99]

The MCA plot of AR1 (shown below) appears to have higher returns (between 19.6% and 23.4% over 10 months) for all its possible outcomes, compared to the returns for the MCA plot of ATR2.

Step 3 - Get Extended Statistics

In order to perform a more accurate MCA, we need to account for slippages, hence we require further inputs:

  • Worst Broker Slippage (pip)

  • Total Profit ($) = Gross Profit ($) + Gross Loss ($)

  • Total Profit (pip) = Gross Profit (pip) + Gross Loss (pip)

  • Pip to Dollar (decimal)

We calculate the Pip to Dollar conversion factor as follows:

   Pip to Dollar = Total Profit (pip) / Total Profit ($)
  • Worst Broker Slippage ($)

We calculate the Worst Broker Slippage ($) as follows:

   Worst Broker Slippage ($) = Pip to Dollar * Worst Broker Slippage (pip)
   Adjusted Avg Profit ($)   = Avg Profit ($) - Worst Broker Slippage ($)
   Adjusted Avg Loss ($)     = Avg Loss ($) - Worst Broker Slippage ($)
  • Percent Decrease (decimal)

After adjusting both the average profit and loss for slippage, it follows that the winning percentage should decrease. However, we don't have the exact number of profitable trades that are less than slippage, e.g. profit of 1.54 will be a loss after slippage of 1.74.

We estimate the Percentage Decrease (decimal) as follows:

   Percentage Decrease (decimal)     = Worst Broker Slippage ($) / Avg Profit ($)
   Adjusted Win Percentage (decimal) = Win Percentage * (1 - Percentage Decrease)

Extended Statistics of AR1

  • Worst Broker Slippage (pip): 21.7

  • Total Profit ($) = 2313.92 - 141.48 = $2,172.44

  • Total Profit (pip) = 27607 - 548 = 27,049

  • Pip to Dollar (decimail) = 2172.44 / 27049 = 0.080315

  • Worst Broker Slippage ($) = 0.080315 * 21.7 = $1.74

  • Percentage Decrease (decimal) = 1.74 / 7.92 = 0.22

Adjusted Statistics of AR1

  • Adj Avg Profit ($): 7.92 - 1.74 = 6.18

  • Adj Avg Loss ($): -7.48 - 1.74 = -9.22

  • Adj Win Percentage (decimal) = (1 - 0.22) * 0.9389 = 0.7323

Extended Statistics of ATR2

  • Worst Broker Slippage (pip): 21.7

  • Total Profit ($) = 6701.56 - 298.58 = 6402.98

  • Total Profit (pip) = 50848 - 1469 = 49379

  • Pip to Dollar (decimal) = 6402.98 / 49379 = 0.12967

  • Worst Broker Slippage ($) = 0.12967 * 21.7 = 2.81

  • Percentage Decrease (decimal) = 2.81 / 10.79 = 0.26

Adjusted Statistics of ATR2

  • Adj Avg Profit ($) = 10.79 - 2.81 = 7.98

  • Adj Avg Loss ($) = -8.29 - 2.81 = -11.10

  • Adj Win Percentage (decimal) = (1 - 0.26) * 0.9452 = 0.6987

Trade Simulation

Type the following command in R to simulate returns for both AR1 and ATR2:

 > AdjAR1Zoo <- monteSimulateReturnsZoo( 311, 6.18, -9.22, 0.7323 )
 > AdjATR2Zoo <- monteSimulateReturnsZoo( 657, 7.98, -11.10, 0.6987 )

Step 4 - Extended MCA

Extended MCA in R

Type the following command in R to perform MCA for both adjusted AR1 and ATR2:

 > AdjAR1Monte <- MonteGrowReturns(AdjAR1Zoo, 100)
 > AdjATR2Monte <- MonteGrowReturns(AdjATR2Zoo, 100)
 > plot(AdjAR1Monte)
 > plot(AdjATR2Monte)

Note: At writing, there appears to be an error in the summary, hence we set summary to FALSE. Otherwise, we should accept all other default values.

Result for AR1

 Initial equity balance    : 10000.00 
 Absolute maximum drawdown :  -227.92 ( -2.2%) [set = 41]
 Absolute median drawdown  :   -89.13 ( -0.9%)
 Absolute minimum drawdown :   -48.98 ( -0.5%) [set = 39]
 Maximum equity balance    : 10841.58 (  8.4%) [set = 30]
 Median equity balance     : 10495.86 (  5.0%)
 Minimum equity balance    : 10074.93 (  0.7%) [set = 14]

The extended MCA plot of AR1 appears to show a significant decrease in possible returns (between 0.7% and 8.4% over ten months), compared to its previous MCA returns (250% to 320% over the same period).

Result for AR2

 Initial equity balance    : 10000.00 
 Absolute maximum drawdown :  -322.22 ( -3.0%) [set = 93]
 Absolute median drawdown  :  -122.35 ( -1.1%)
 Absolute minimum drawdown :   -74.47 ( -0.7%) [set = 2]
 Maximum equity balance    : 12490.06 ( 24.9%) [set = 39]
 Median equity balance     : 11892.47 ( 18.9%)
 Minimum equity balance    : 11339.41 ( 13.4%) [set = 3]

Similarly, the extended MCA plot of ATR2 (shown below) appears to show a decrease in possible returns (between 13.4% to 24.9% over ten months), compared to its previous MCA returns (19.6% to 23.4% over the same period).

However, the possible returns of ATR2 (10-25%) are significantly higher than AR1 (1-9%). Hence, we should follow ATR2 signal.

Conclusion

In this article, you performed a comparative analysis of two Metatrader Signal Providers. The initial Monte Carlo Analysis showed that the first signal provider has a significantly higher return. However, the extended MCA, which account for slippages, changes the ranking of the signal providers and ensures a realistic simulation and analysis of returns.

Get the Source Code

You can download the above source code from GitHub repository FX-Git-Pro.

  • 15 Jun, 2020
  • (0) Comments
  • By admin
  • Trading Psychology & Money Management

Building a Signal-based Metatrader Portfolio

TL;DR

The Myfxbook website automatically fetches data from your Metatrader account. This allows you to monitor the overall performance of your account as well as to break down the performance by different signal providers.

URL: http://www.myfxbook.com/members/dennislwm/fxgit/6201375

Copy Signal from MQL5

Choose a Signal

There are many variables when choosing a Signal Provider. I have ranked some of these variables from highest to lowest weight for your consideration:

  • Live Account - look only for live accounts. A signal provider that trades a demo account can take unnecessary risks.

  • Reviews - look for positive and high quality user reviews. A higher number of reviews is also a good indicator.

  • Profile Rating - the Signal Provider rating by MQL community. Avoid profiles with very low ratings.

  • Maximum drawdown - ideally the maximum drawdown should be below 40%. A higher number requires a higher tolerance for losses.

  • Maximum consecutive: - look for tolerable consecutive losses. A higher number indicates a higher risk of ruin for your account. A higher number of Maximum consecutive wins is also a good indicator.

  • Slippage - this indicator is important if your Signal provider uses a scalping strategy, i.e. Avg profit is less than 5 pips. Otherwise, this indicator does not make a significant difference.

  • Profit factor - I don't rate this indicator as highly as those indicators above. Having said that, you still need a high profit factor to mitigate slippage, loss connections, and to break even after signal fees.

  • Trades per week - look for between 5 and 15 trades per week. Too few trades can lead to lower performance, but too many trades can indicate a martigale strategy.

  • Avg holding time - I usually prefer more than 8 hours or more. Shorter time usually means a scalping strategy. However, this is a matter of individual preference.

  • Long / short trades - the ratio should ideally be 1:1. However, a 6:4 or 4:6 ratio is still acceptable.

  • Started - look for older signals that shows survivorship, especially during periods of volatility.

  • Price - a higher price may not indicate better quality. However, this has to be affordable as it will affect your monthly profits.

  • Reliability, Number of symbols - don't place too much emphasis on these indicator.

My Automated Robot 1 Signal

  • Revews - 4/4 good reviews with average rating of 4.5 stars

  • Profile Rating: 424 [58 - Openness; 194 - Friends; 291 - Signals provider; 29 - Reviews]

  • Maximum drawdown: 34.5%

  • Maximum consecutive: 8 losses (-4.78 AUD) vs 193 wins (1,649.50 AUD)

  • Slippage - median 4.77 pips vs avg profit 3 pips (RED FLAG)

  • Profit factor: 17.66

  • Trades per week: 5

  • Avg holding time: 11 hours

  • Long / short trades: 176:123 (58.9% vs 41.1%)

  • Started: 23/03/2020

  • Price: 30 USD per month

Feedback Loop

Analysing the actual performance will give some feedback on the above criteria. Hence, this helps us to refine our evaluation for future signal providers.

Fund Your Metatrader Account

Open a Metatrader Account

In order to fund your Metatrader account, you must first open an account. I chose a reputable local broker in Singapore. Obviously, you will need to do some research before choosing a broker.

There are some brokers who offer both MT4 and MT5 platforms, and this would be an added bonus. The reason is rather straightforward, you can copy MT4 signals to your MT4 account, and you can copy MT5 signals to your MT5 account, but you can't copy from MT4 to MT5, and vice versa.

Fund Your Account

You don't have to start big in order to trade signals, as the copied lot sizes can be pro-rated to your account balance.

I suggest starting at $1,000, and then grow your account slowly as you gain more experience and knowledge.

Publish on Myfxbook

The Myfxbook website automatically fetches data from your Metatrader account. This allows you to monitor the overall performance of your account as well as to break down the performance by different signal providers.

URL: http://www.myfxbook.com/members/dennislwm/fxgit/6201375

  • 8 Jun, 2020
  • (0) Comments
  • By admin
  • Signal Trade Copiers
Recent Posts
  • Monte Carlo Analysis of Two Metatrader Signal Providers
  • Building a Telegram Chat with a MT4 Forex Trading Expert Advisor
  • Building a Signal-based Metatrader Portfolio
  • Zero-Lag CurrencySlopeStrength Indicator
Categories
  • Chatbots
  • Signal Trade Copiers
  • Trading Psychology & Money Management
  • Utilities Indicators and Scripts
Tags
copier indicator metatrader montecarloanalysis mt4 mt5 portfolio R signal telegram trading tutorial
Archives
  • June 2020
Login with Patreon

© 2019 All Right Reserved | Arowana WordPress Theme