Watch how to download trading robots for free
Find us on Twitter!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Libraries

Grid and Martin Gale include file - library for MetaTrader 4

Views:
6037
Rating:
(1)
Published:
2023.07.27 12:03
Updated:
2023.08.15 20:39
Functions.mqh (22.76 KB) view
Grid.mq4 (3.36 KB) view
Strategies.mqh (36.87 KB) view
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

This include file provides programmers with a seamless solution for creating Martin Gale trading strategies effortlessly. The classes GridStrategy and MartinGaleStrategy are derived from the Strategy class, which encompasses various attributes such as Startprice, Lots(Volume available for the strategy), TakeProfit, Stoploss (in monetary terms), and more. While Grid and Martin Gale strategies possess their own unique characteristics, they still share these fundamental attributes.

The Strategy class features an onTick function, which should be called within the OnTick() function of an Expert Advisor. This function handles all aspects of the strategy, including generating buy and sell signals, opening trades based on these signals, and closing trades when the Take Profit or Stop Loss levels are reached. The buy and sell signals are virtual functions within the Strategy class, which are specifically implemented and customized in the Grid and Martin Gale Strategy classes.

Creating and initializing a strategy is a straightforward process. Once a strategy object is created using the new keyword, an initialization step is required. Once initialized, simply calling the onTick function is all that remains, making the creation of these strategies remarkably simple and user-friendly.

With the utilization of this include file, programmers can harness the power of Martin Gale strategies in their trading systems with ease. The streamlined approach and comprehensive functionality of the Strategy class allow for efficient development and implementation of grid and Martin Gale trading strategies.

If you want, you can start strategies based on various signals, for example if you see high/low volatility you can start a Martin Gale/ Grid strategy, so that it only runs until it is closed out for profits. 

Check out the Youtube Video I've made about it:

Grid results

Martin Gale results

Grid Trading Algo Grid Trading Algo

This is a grid trading algorithm idea.

KA-Gold Bot KA-Gold Bot

KA-Gold Bot is an advanced trading advisor specifically designed for gold, utilizing the powerful combination of the Keltner channel strategy and two exponential moving averages (EMAs) - the 10-period EMA and the 200-period EMA. Principle of Operation: The 10-period EMA represents the average price cutting above/below the Keltner band, confirming an uptrend/downtrend. The price being above the 200-period EMA supports the uptrend/downtrend. This indicates that the uptrend/downtrend has been stronger than the previous 10 periods, considering the volatility over the last 50 periods.

Plot History Plot History

Plot trade history levels on the chart for MT4

Gaussian Low Lag Filters Gaussian Low Lag Filters

Gaussian Filter Multi Pole smoother of price data