Beginner Programming: Moving Average Crossover with and without Martingale functionality – EA MetaTrader 5

Beginner Programming: Moving Average Crossover with and without Martingale functionality - expert for MetaTrader 5
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 … Read more

MovingAverages.mqh Part I by Wiliam210 – indicator MetaTrader 5

MovingAverages.mqh Part I by Wiliam210
Good morning. If this code malfunctions for whatever reasons, forgetting or MQL5 upgrades, let me know so I can correct it, thank you You can find all my indicator codes in CodeBase or the Marketplace, free or purchasable, by searching for “William210”. What is SimpleMA, ExponentialMA, SmoothedMA, LinearWeightedMA? Smoothing refers to the action of making … Read more

Trailing Stop Management Function – script MetaTrader 5

Trailing Stop Management Function - script for MetaTrader 5
//+——————————————————————+ //|                                       TrailingStopManagement.mq5 | //|                                  Copyright 2023, MetaQuotes Ltd. | //|                                             | //+——————————————————————+ #property copyright “Copyright 2023, MetaQuotes Ltd.” #property link      “” #property version   “1.00” #define _MagicNum  NULL//set magic number input int    Stoplose      =992;// set stoplose value input int    TrailingStop  =986;// set TrailingStop value //+——————————————————————+ //| Script program start function                                    | //+——————————————————————+ void OnStart()   { //—    Management();   } //+——————————————————————+ //+——————————————————————+ //| Management … Read more

Calculate Lot Size and Trailling Stop – EA MetaTrader 5

Calculate Lot Size and Trailling Stop - expert for MetaTrader 5
I. Condition Buy-Sell 2. Backtest 1. Main function for calculate lot size //+——————————————————————+ //| caculate lot sisze Function                      | //+——————————————————————+ double calculate_lotsize(double sl, double price)   {   double lots=0.;   double lotstep= SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_STEP); double ticksize = SymbolInfoDouble(_Symbol,SYMBOL_TRADE_TICK_SIZE);    double tickvalue = SymbolInfoDouble(_Symbol,SYMBOL_TRADE_TICK_VALUE);   double balance= AccountInfoDouble(ACCOUNT_BALANCE);   double point= SymbolInfoDouble(_Symbol,SYMBOL_POINT);   //double  loss=MathRound((MathAbs(price-sl)/ ticksize) * ticksize );   double  loss=MathAbs(price-sl)/point;  m_symbol.NormalizePrice(loss);   double Risk= initial_risk*balance;   if(loss!=0) … Read more

Trailing stop tutorial using ATR indicator – EA MetaTrader 5

Trailing stop tutorial using ATR indicator - expert for MetaTrader 5
I. Main function 1. Using condition buy or sell base on price action. 2. Auto caculate lot size 3. Auto trailling stop by ATR. 4. Backtest result II. Main function code 1. Trailling and count position function //+——————————————————————+ //|Count position and Trailling Functiom                              | //+——————————————————————+ void  count_position(int &count_buy, int &count_sell, double &_atr[])   {       count_buy=0; count_sell=0; … Read more

Lesson 9 Buy sell stop Order – EA MetaTrader 5

Lesson 9 Buy sell stop Order - expert for MetaTrader 5
I. Main function 1. Using condition buy or sell base on price action. 2. Auto caculate lot size 3. Auto trailling stop by ATR. 4. Backtest result II. Main tick function //+——————————————————————+ //| Expert tick function                                             | //+——————————————————————+ void OnTick() {    if(OpenBar(Symbol()))    {    OrderManaging(); // Candle declaration double High[],Low[],open[],close[]; ArraySetAsSeries(High,true);ArraySetAsSeries(Low,true);ArraySetAsSeries(close,true);ArraySetAsSeries(open,true); CopyHigh(Symbol(),timeframe,0,1000,High); CopyLow(Symbol(),timeframe,0,1000,Low); … Read more

Lesson 7 Price action Ket hop Volume VSA – EA MetaTrader 5

Lesson 7 Price action Ket hop Volume VSA - expert for MetaTrader 5
I. Main function 1. Auto caculate lot size 2. Auto trailling ATR 3. Using volume indicator and moving average indicator 4. Condition buy or sell 2. Backtest. II. Main function code 1. Volume indicator declaration //+——————————————————————+ //| Expert initialization function                                   | //+——————————————————————+ int OnInit()   { if(!m_symbol.Name(_Symbol)) return  INIT_FAILED; // Set Trade parameter trade.SetTypeFillingBySymbol(m_symbol.Name()); trade.SetExpertMagicNumber(m_magicnumber); trade.SetDeviationInPoints(Slippage); // … Read more

Delete all objects on chart (main window and sub window) with drag and drop – script MetaTrader 5

Delete all objects on chart (main window and sub window) with drag and drop - script for MetaTrader 5
If there are objects cluttering the chart, sometimes you might want to start afresh without having to delete the entire chart and load another one. This means it may be efficient to drag a script onto the chart in order to clean it. Like a “clear” or “cls” but for objects. The script was meticulously … Read more

Lession 1_ Bullish and Bearllish Candle Tick – EA MetaTrader 5

Lession 1_ Bullish and Bearllish Candle Tick - expert for MetaTrader 5
I. Input parameter: II. Main function: 1.  How to create bullish and bearlish recognition conditions. 2. Only buy sell at new candle 3. Count position and trailling stop auto. 4. Lotsize is fix at input parameter setup. /////////////////////////////////////////////////////////////////////////////////////////////////////////////// Refer information: Link Exness IB Web: Các bạn đăng ký mở tài khoản Exness link IB dưới … Read more