Simple Yet Effective Breakout Strategy – EA MetaTrader 5

Simple Yet Effective Breakout Strategy - expert for MetaTrader 5
This breakout strategy is the base for our QAlpha StockTrend product:  You can freely modify/add your own filters to create your own unique version of this strategy. The basic premise of the strategy: Buy/Cover as soon as the price breaks above n bars high Short/sell as soon as the price breaks below n bars low Backtested on

Code blocks for “Counters” like Count “X” time and pass – EA MetaTrader 5

Code blocks for "Counters" like Count "X" time and pass - expert for MetaTrader 5
01. Count “X” Times and then pass. Step 01 – Created a variable for set the count limit. you can use it as an input parameter as well of optimization in your code.  Step 02 – Create another variable to store the counted limit (How many times it has been counted). Step 03 – Once

Basic GridManager Library – library MetaTrader 5

Basic GridManager Library - library for MetaTrader 5
The library contains basic public methods to manage grids: public:                      GridManager(ENUM_GRID_DIRECTION direction, double grid_initial_lot_size, int grid_gap_points, double grid_profit_percent);                     ~GridManager() {};    void              SetGridMagicNumber(ulong magic);    void              SetGridMaxDD(double max_dd_percent);    void              SetGridMultiplier(double lot_multiplier);    void              Start(void);    void              Update(void);    void              CloseGrid();    double            GridPnL();    int               CountPositions(); In above code: MaxDD stands for “maximum allowed drawdown”. This value is disabled by

A Code block to detect A “New Candle/Bar” using bars history (very effective way) – EA MetaTrader 5

A Code block to detect A "New Candle/Bar" using bars history (very effective way) - expert for MetaTrader 5
In previous code I used the time to detect a new bar. This time let’s use the bars count to detect a new bar. it’s way lighter and faster than using the time method. Declare the variables in integer data type to store the bar counts.  Assign the bars count for the “BarsTotal_OnInt” at the

Candle Analysis Report – script MetaTrader 5

Candle Analysis Report - script for MetaTrader 5
This script is designed to perform candle analysis: Data Retrieval: The script retrieves the open, close, high, and low prices of candles for the financial instrument it is running on. Candle Categorization: It categorizes each candle as bullish, bearish, or neutral based on the relationship between its closing and opening prices. Amplitude Calculation: It calculates

Logarithmic Moving Average – indicator MetaTrader 5

Logarithmic Moving Average - indicator for MetaTrader 5
Quoted from Wikipedia: In mathematics, the logarithmic mean is a function of two non-negative numbers which is equal to their difference divided by the logarithm of their quotient. This calculation is applicable in engineering problems involving heat and mass transfer. Use as is or develop further to serve your purpose Logarithmic Moving Average – indicator

Simple Code for Detect A “New Bar or New Candle ” Received – EA MetaTrader 5

Simple Code for Detect  A  "New Bar or New Candle " Received - expert for MetaTrader 5
This code block detects a New Bar or a New Candle when it has received.  the basic principle of the codes is very simple. First the code stores the Time of the previous bar / Candle. (Then add 60 seconds (equals to 1 min. you can add time as you want) to the Time of