top of page

My first Expert Advisor: Gibraltar

  • Autorenbild: Wissam
    Wissam
  • 4. Aug. 2022
  • 2 Min. Lesezeit

I want to present Gibraltar to you. With this algorithm, I first wanted to test my acquired skills in the MQL5 programming language, to familiarize myself with the backtesting, profiling and strategy tester tool from MetaTrader5. I wrote this algorithm for netting- and hedging accounts.


Gibraltar is my first robust algorithm that I created for a symbol on the Forex market.

In the many books, indicators are suggested as tools for trading that either recognize trends, appreciate the direction or even measure their strength. I tested nearly every indicator that MetaTrader 5 offers. I get on well with some and not with others. However, it also depends on the good interplay of indicators. Gibraltar chooses two different indicators and one of it twice. It is based on the "double bollinger band" strategy. He follows a participation strategy by placing orders on the Forex market that have a trend-enhancing effect. The algorithm mostly chooses a smoothed moving average as the stop loss.


After the RSI indicator gives the necessary signal whether a buy or sell order may be placed, the Bollinger Bands make a final decision as to whether the order is placed or not.


The above mentioned decision making always takes place at the opening of a new bar. The lot size is always set to a volume that a certain percentage of the account balance is constantly risked, which is calculated by the distance to the stop loss price (so called money management). In case of any calculation errors, the lot size is set to a fixed volume of 0.1 by default.




The symbol EURGBP is shown in the figure in the H1 period. Two bollinger bands are attached to the chart. The bigger bollinger band (in dark blue) has a deviation of 2. The inner bollinger band has a deviation of 1. The blue / red lines next to the indicator indicate the buy / sell signal of the indicator. You may see the logic behind this signal, although the logic behind the last signal is more complex than in the previous ones.


In addition, a timer is set that only allows trading at certain times. This setting can be set variably - like stop loss, take profit and trailing stop or scalping out positions. These variables were set efficiently in the backtesting of the algorithm and can vary from symbol to symbol. The recommended time periods are M30 to H4.


Finally, I would like to show you the profit generation of this trading algorithm. Gibraltar allows strong losing trades but also strong winning trades. This can be seen in the following account balance Illustration over the time period 03/2019 - 12/2019 on EURGBP, H1-period, starting with a balance of 10.000 €.


Even if this algorithm is certainly not yet perfect, the result of around 10% profit in 10 months can be considered as good. Gibraltar just wins around 22 % of the sell positions but 68 % of the buy positions. He opens about 35-45 orders in a month, which are equaly destributed over the weekdays. 95 percent of the positions are closed after a period of 8 hours (8 candle sticks).



 
 
 

Comments


Post: Blog2_Post

Subscribe Form

Thanks for submitting!

  • LinkedIn

©2020 Wissams FX-trading blog. Erstellt mit Wix.com

bottom of page