Guarda come scaricare robot di trading gratuitamente
Ci trovi su Facebook!
Unisciti alla nostra fan page
Script interessante?
Pubblica il link!
lasciare che altri lo valutino
Ti è piaciuto lo script? Provalo nel Terminale MetaTrader 5
Sistemi Esperti

Beginner Programming: Moving Average Crossover with and without Martingale functionality - sistema esperto per MetaTrader 5

Visualizzazioni:
7576
Valutazioni:
(8)
Pubblicato:
2024.06.10 09:35
Aggiornato:
2024.06.10 18:11
Freelance MQL5 Hai bisogno di un robot o indicatore basato su questo codice? Ordinalo su Freelance Vai a Freelance


All of the functions used in the Expert Advisor are found in the ImportantFunctions.mqh include file.

There are 2 Expert Advisors, both using the price crossing the moving average as their entry signal, with a simple difference: one uses Martingale when losses occur, and the other does not.

I don't recommend using any of the EAs with a live account, they are made for demonstration purposes only.

Simple Moving Average EA Inputs:

  • MAPeriod: The period of the Moving Average indicator.
  • LotSize: The lot size used to enter trades.
  • TPPoints: Take profit points.
  • SLPoints: Stop loss points.

Moving Average EA with Martingale Inputs:

  • MAPeriod: The period of the Moving Average indicator.
  • StartingLot: The lot size used to enter the first trade; this value will increase after a loss.
  • MaxLot: The maximum lot size. The StartingLot can be increased until this value.
  • TPPoints: Take profit points. This will increase after a loss.
  • SLPoints: Stop loss points. This will increase after a loss.
  • LotMultiplier: The lot size will be multiplied by this value after a loss if it has not reached the MaxLot value yet.
  • TPMultiplier: The Take profit and Stop loss will both increase by this amount after a loss, providing a recovery edge not only through position sizing but also because of the bigger TP.

The code contains comments, and I've made a YouTube video explaining everything you need to understand.

Thanks for reading!

Moving Average without Martingale


Moving Average With Martingale

Delete all objects on chart (main window and sub window) with drag and drop Delete all objects on chart (main window and sub window) with drag and drop

It will delete all objects on the chart when the compiled executable is dragged onto the chart

Trap News MT5 Trap News MT5

Script For Trap News High Impact

MovingAverages.mqh Part I MovingAverages.mqh Part I

MovingAverages.mqh Part I A multi timeframe version is available with colors for orientation, for developers or profitable traders for free. Offer under conditions. Other multi timeframe indicators are also available.

Screenshots with keyboard key press Screenshots with keyboard key press

Capture widescreen screenshots by pressing the 's' hotkey on the keyboard