MovingAverages.mqh Part II by Wiliam210 – indicator MetaTrader 5

Moving Averages Part II by William210
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 multi timeFrame indicator codes or not, in CodeBase or on the Marketplace, free or purchasable, by searching for “William210”. Why this code? This indicator shows you how

Easy to use Hedging Class for MQL5 by Peter Mueller – library MetaTrader 5

Easy to use Hedging Class for MQL5 by Peter Mueller - library for MetaTrader 5
Input Parameters: OrderDistancePoints : Determines the distance in points from the current ask price for placing buy orders and from the bid price for placing sell orders. TPPoints : Specifies the take profit target in points. Startlotsize : Sets the initial lot size for trades. Gainperlot : Defines the desired gain per lot size. The

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

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

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

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)

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;