Signal MA Above Below 3
Info
The Signal MA Above Below 3 is a Library for MetaTrader 5 that this library is an advanced version of the previous one. What's new in version 3:The currentbarsizeparameter enables the setting of the current bar size, calculated as close-open.
Usage
This tool is typically used for enhancing chart analysis and decision making.
Platform
This Library works exclusively on MetaTrader 5 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL5/Libraries folder via File ? Open Data Folder in MetaTrader 5.
How to Install and Use Signal MA Above Below 3
1. Storage: Place library files in the MQL/Libraries directory to ensure they are accessible to your projects.
2. Implementation: Include the library in your code using the #import directive, ensuring you match the exact function names and parameters.
3. Compilation: Ensure the library is present in the directory before you compile your main EA or script, as the compiler links them during this phase.
4. Management: Keep libraries organized in sub-folders if you manage many custom functions to maintain a clean project structure.
Frequently Asked Questions
Q: What is a library file used for? A: Libraries store reusable code modules, allowing you to centralize common logic used by multiple EAs or indicators.
Q: Is a library executable? A: No, libraries are non-executable files containing functions; they must be imported into an EA, indicator, or script to function.
Q: Can I update a library while the platform is running? A: You should compile your EA or script after updating a library to ensure the latest code changes are integrated.
What this tool does
This library is an advanced version of the previous one.
Typical Use Case
This Library excels in automated trading and technical analysis on MetaTrader 5.
Compatible Platform & Setup
This Library works on MetaTrader 5. Place the file in the MQL5/Libraries folder and restart the terminal.
Description & Settings
Related: channel proximity engine: advanced signal generation - another powerful library for MetaTrader 5 traders.
This library is an advanced version of the previous one.Also recommended: Inner Bar Breakthrough Trend Following Trading Signal Module - similar library with strong performance on MetaTrader 5.
What's new in version 3:
The
currentbarsize
parameter enables the setting of the current bar size, calculated as close-open.
The
previousbarsize
parameter represents the size of the previous bar, also calculated as close-open.
When the current price is above the indicator, both bars should be bullish. Conversely, when the price is below the indicator, both bars should be bearish. These parameters (
currentbarsize
and
previousbarsize
) act as protective filters for position opening.
Signal Module Configuration
To utilize the signal module, connect the time series in the constructor. This provides access to the
m_close
and
m_open
objects of the respective classes, declared at a higher level in
expertbase.mqh
.
These objects are manipulated within the
csignalma::longcondition
and
csignalma::shortcondition
functions.
Position Opening Examples
Here's how to open positions when
reverse
is set to false:
- Fig. 1: SignalMAAboveBelow 3 - Opening a buy position
- Fig. 2: SignalMAAboveBelow 3 - Opening a sell position
Signal Module Parameters
-
reverse
: Flag to reverse signals.
-
periodma
: Moving average indicator's averaging period.
-
shift
: Horizontal shift of the moving average indicator.
-
method
: Smoothing type for the moving average indicator.
-
applied
: Price type used for moving average calculation.
-
typeoftrade
: Trading signal type (0 for buy, 1 for sell, 2 for both).
-
currentbarsize
: Size of the current bar, calculated as close-open.
-
previousbarsize
: Size of the previous bar, calculated as close-open.
The test expert advisor,
testsignalmaabovebelow3.mq5
, uses default parameters without optimization. Enabling operation on every tick in the expert advisor can lead to more intriguing results, as it allows for quicker processing of the condition when the current bar size matches or slightly exceeds the
currentbarsize
parameter.
You may also like: Trade Signal Module Based on Brain Trend1 Indicator - excellent alternative for library users on MetaTrader 5.
Source Code
/
.......
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.