Watch how to download trading robots for free

Find us on Facebook!
Join our fan page

Access the CodeBase from your MetaTrader 5 terminal

Couldn't find the right code? Order it in the Freelance section

How to Write an Expert Advisor or an Indicator

MQL4 Source Code Library for MetaTrader 4

The largest library features codes of free trading Expert Advisors, technical indicators and scripts. With the available applications you can trade in automated mode and analyze price dynamics. Use the library of codes to learn more about financial market sentiments.

Download free applications, test them and run in your MetaTrader 4. You can access them from the MetaTrader 4 platform and the MetaEditor development environment.

To post a new code, please log in or register
latest|best

Short description.

MT4 Expert Advisor based on the CCI indicator

This indicator is ZigZag based on Bill Williams Aligator

The GMT Time on chart indicator is written for users who like to see GMT Time on-screen. For convenience, This indicator code is written clearly and simple. Update 1: 16-5-2020 *Input font color *Input font size

Close your positions in profit virtually

Fully operational ea for real/demo accounts or educational purpose

The V Sync Chart Lite indicator is written for demonstration purposes and shows how it is possible to synchronize the object

Standart MACD Indicator but All Parameters like as FastMA, SlowMA and SignalMA parameters can be changed

It's a triangular arbitrage system (three pairs correlation system) to use 3 currencies to make 3 pairs to open hedge orders on those. The expert starts opening six orders for each ring (3 plus and 3 minus) and waits to move prices in one direction to make a grid of orders.

Simple Script to disable the Autotrading for the EA on the chart. If you just want to use the DLL, check the code and comment/uncomment the necessary

The Correlation Indicator provides a smoothed bar to bar correlation value.

Trend indicator (separate window)

Hi, so I just made a little code here that will help out a lot of coders that hate doing this (I count myself in it haha). It's made to calculate the lot size of a position based on the risk input and the account size+currency.

Trend indicator

Free utility for manual orders placement.

This EA can detect trades in your MT4 account and transmit them via web

Simple oscillator with a histogram.

Simply select one of the main currencies (AUD, CAD, CHF, EUR, GBP, JPY, NZD, USD) as "Currency" in the settings.

Power of USD indicator shows actual strength of currency USD calculated of 7 pairs that contain USD. Indicator can be used for strategies based on mean reversion and/or correlation. Included pairs: EUR USD, AUD USD, NZD USD, GBP USD, USD JPY, USD CAD, USD CHF.

Power of NZD indicator shows actual strength of currency NZD calculated of 7 pairs that contain NZD. Indicator can be used for strategies based on mean reversion and/or correlation. Included pairs: EUR NZD, GBP NZD, AUD NZD, NZD USD, NZD CAD, NZD JPY, NZD CHF.

Power of JPY indicator shows actual strength of currency JPY calculated of 7 pairs that contain JPY. Indicator can be used for strategies based on mean reversion and/or correlation. Included pairs: USD JPY, EUR JPY, GBP JPY, AUD JPY, CAD JPY, NZD JPY, CHF JPY.

Power of GBP indicator shows actual strength of currency GBP calculated of 7 pairs that contain GBP. Indicator can be used for strategies based on mean reversion and/or correlation. Included pairs: EUR GBP, GBP USD, GBP JPY, GBP AUD, GBP CAD, GBP NZD, GBP CHF.

Power of CHF indicator shows actual strength of currency CHF calculated of 7 pairs that contain CHF. Indicator can be used for strategies based on mean reversion and/or correlation. Included pairs: EUR CHF, USD CHF, GBP CHF, CAD CHF, AUD CHF, NZD CHF, CHF JPY.

Power of EUR indicator shows actual strength of currency EUR calculated of 7 pairs that contain EUR. Indicator can be used for strategies based on mean reversion and/or correlation. Included pairs: EUR USD, EUR GBP, EUR JPY, EUR AUD, EUR CHF, EUR CAD, EUR NZD.

Power of CAD indicator shows actual strength of currency CAD calculated of 7 pairs that contain CAD. Indicator can be used for strategies based on mean reversion and/or correlation. Included pairs: USD CAD, AUD CAD, CAD JPY, EUR CAD, GBP CAD, NZD CAD, CAD CHF.

Power of AUD indicator shows actual strength of currency AUD calculated of 7 pairs that contain AUD. Indicator can be used for strategies based on mean reversion and/or correlation. Included pairs: EUR AUD, GBP AUD, AUD USD, AUD CAD, AUD NZD, AUD JPY, AUD CHF.

Non Lag Relative Strength Index for MT4 Eliminates unnecessary preliminary calculations on the built-in RSI.

This code extracts tick data from the broker's server and refreshes the 28 charts of the 8 commonly traded currencies in MT4.

This code closes when your position is based on dollars

This will create an offline chart for the ticks.

Indicator that displays the "strength" of each of the 8 major currencies (USD, EUR, GBP, CHF, AUD, CAD, JPY and NZD) based on the moving average trend of all 28 pairs that they are part of.

Stochastic MACD (metatrader 4 version)

Best Direction Indicator. Red Line means the market UP. Blue Line means the market Down.

Arrow for input and Smile for output.

A ready made expert adviser template to use for further development

Trend flex x 2 (metatrader 4 version)

This is Multi Currency Expert Advisor Template that can trade according to symbol list (default 6 symbols). For Example, Ichimoku Chinkou Span is used for entry logic. // Main input parameters input double Lots = 0.01; // Basic lot size input int StopLoss= 50; //Stoploss (in Pips) input int TakeProfit=100; //TakeProfit (in Pips) input int TrailingStop = 15; // Trailing Stop (in points) input int TrailingStep = 5;// Trailing Step (in points) input int Magic=1; // Magic Number input int Slippage = 100; // Tolerated slippage in brokers' pips string symbol[] = { "AUDUSD","USDCAD","USDCHF","EURUSD","GBPUSD","USDJPY"};

TrendFlex indicator based on February 2020 TASC article published by John Ehlers - metatrader 4 version

Reflex indicator (based on February 2020 TASC article by John Ehlers - metatrader 4 version)

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192