fama2check
Download scriptThis script serves as a specialized monitoring tool designed to provide real-time data visualization for the "fama2" technical indicator on the MetaTrader platform. Its primary purpose is to extract and display specific numerical values from the market's price history to help traders better understand current trends.
How the Logic Works
The core functionality of this script relies on retrieving multiple distinct data points from a secondary custom indicator. Here is a breakdown of the process:
- Data Extraction: The script communicates with an external tool called "fama2." It looks back at a predefined range of historical price bars (set by the user) to pull information.
- Multi-Point Analysis: Instead of just looking at one single price point, the logic captures eight different data values (referred to as b1 through b8). These values represent various layers of calculation from the underlying indicator, likely representing different sensitivities or historical shifts in market momentum.
- Real-Time Updates: The script continuously scans the most recent market activity. Every time the price moves, it refreshes these eight values to ensure the information being displayed is current.
- Visual Output: The final step of the logic takes all those complex numerical calculations and converts them into a simple, readable text list. This list appears directly on your trading chart as a comment or overlay.
User Experience
For the user, this means you don't have to manually interpret complex mathematical formulas. The script does the "heavy lifting" of pulling data from the secondary indicator and organizes it into a clean, easy-to-read summary on your screen, allowing for quicker observation of market dynamics.
//+------------------------------------------------------------------+
//| famacheck.mq4 |
//| |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, robmrj"
#property link "http:"
//---- input parameters
extern int Range1 = 10;
extern int MaxBars = 1000;
extern int FastMA1 = 3;
extern int SlowMA1 = 30;
extern int filter1 = 20;
extern int n1 = 2;
extern int h1 = 10;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
double b1, b2, b3, b4, b5, b6, b7, b8;
// There are only 2 buffers in fama indicator
b1 = iCustom(Symbol(), 0, "fama2", Range1, MaxBars, FastMA1, SlowMA1, filter1, n1, h1, 0, 0);
b2 = iCustom(Symbol(), 0, "fama2", Range1, MaxBars, FastMA1, SlowMA1, filter1, n1, h1, 1, 0);
b3 = iCustom(Symbol(), 0, "fama2", Range1, MaxBars, FastMA1, SlowMA1, filter1, n1, h1, 2, 0);
b4 = iCustom(Symbol(), 0, "fama2", Range1, MaxBars, FastMA1, SlowMA1, filter1, n1, h1, 3, 0);
b5 = iCustom(Symbol(), 0, "fama2", Range1, MaxBars, FastMA1, SlowMA1, filter1, n1, h1, 4, 0);
b6 = iCustom(Symbol(), 0, "fama2", Range1, MaxBars, FastMA1, SlowMA1, filter1, n1, h1, 5, 0);
b7 = iCustom(Symbol(), 0, "fama2", Range1, MaxBars, FastMA1, SlowMA1, filter1, n1, h1, 6, 0);
b8 = iCustom(Symbol(), 0, "fama2", Range1, MaxBars, FastMA1, SlowMA1, filter1, n1, h1, 7, 0);
string scomment= "-----------------------------";
scomment = scomment + "\n" + "b1: " + b1;
scomment = scomment + "\n" + "b2: " + b2;
scomment = scomment + "\n" + "b3: " + b3;
scomment = scomment + "\n" + "b4: " + b4;
scomment = scomment + "\n" + "b5: " + b5;
scomment = scomment + "\n" + "b6: " + b6;
scomment = scomment + "\n" + "b7: " + b7;
scomment = scomment + "\n" + "b8: " + b8;
Comment (scomment);
//----
return(0);
}
//+------------------------------------------------------------------+
Comments