Skip to main content


Showing posts from May, 2018

Martingale MQL Implementation for MetaTrader 4


Martingale per definition is a gambling system of continually doubling the stakes in the hope of an eventual win that must yield a net profit. It is based on the mathematical statement that:

Sum 2^[0... (k-1)]<2^k, meaning the previous sum is always small than the next 2 exponent.

Originally, the method was used in casinos to overcome loses by taking a double position each time. In trading, the method was adopted by setting a target imaginary stop loss, once crossed, a double size position with the same direction would open. If the position will go back enough, the whole structure would close, otherwise, another double position will open after the target point.

What I would like to present in this post is a raw implementation of the martingale strategy in less than 50 lines of code. It is only for educational purposes, so use it on your own risk. Personally, I am using a modified version of the martingale which has a better risk management feature. Nevertheless, it can giv…

The Ten Commandments for Successful Trading - Part 2

This is the second part of the "The Ten Commandments for Successful Trading" post.

4th Commandment - Choose the right Broker

I can be the best trader in the world, with the best algorithms, risk management paradigms, trading methods etc. But if I won't have the right broker with me, I would be a complete loser! It took me ages, a lot of reading and disappointments until I found the right one for me, in this case it was Darwinex:

They have the tightest spread on EURUSD I could get, even over the weekend when the market is, the spread is 0.7 pips and less compare to other brokers who could reach 2.5+ easily. During trading hours EURUSD spread becomes so tiny that I don't even consider it in my algorithm. Since I only trade EURUSD like the 1st Commandment says, I don't care about the other currencies at all.
Darwinex has a Direct Market Access, meaning they send all of the client orders direct to market with institutional quality spreads and execution speeds of <5ms.…