SiDuS_Base
Download scriptThis script is a visual trading tool designed for the MetaTrader platform to help identify potential market trends and entry points by analyzing price momentum. It simplifies complex data into clear visual signals—specifically, arrows that appear on your chart to highlight when certain conditions are met.
How the Logic Works
The tool functions by comparing two different types of moving averages against two distinct benchmarks. To do this, it looks at the "Typical Price" (an average of the current high, low, and closing prices) over various timeframes.
1. The Components:
- Short-Term Indicators: The script calculates two fast-moving averages (representing very recent price action). These are designed to capture quick shifts in momentum.
- Long-Term Benchmarks: The script also calculates two slower, "smoothed" moving averages. These represent the broader trend of the market over a longer period.
2. The Analysis Process: The script constantly scans the historical price data and compares the fast indicators against the slow benchmarks. It looks for specific "confluence," which is when multiple conditions align simultaneously:
- Bullish Signal (Buy Condition): If both of the fast-moving averages are trading significantly above both of the long-term benchmarks, the script recognizes this as strong upward momentum. When this happens, it places a Dark Green arrow below the current price candle.
- Bearish Signal (Sell Condition): Conversely, if both of the fast-moving averages drop significantly below both of the long-term benchmarks, the script identifies a strong downward trend. In these instances, it places a Maroon arrow above the current price candle.
Key Features for the User
- Automatic Scaling: The script automatically detects how many decimal places your specific currency pair uses (e.g., 4-digit vs. 5-digit brokers) to ensure that the arrows are placed at a consistent and readable distance from the candles.
- Visual Clarity: Instead of forcing you to stare at multiple overlapping lines, this tool filters out the "noise" and only alerts you visually when the short-term momentum confirms the direction of the long-term trend.
- Real-Time Monitoring: The logic is designed to recalculate with every new price tick, providing updated signals as the market moves.
//+------------------------------------------------------------------+
//| SiDuS_Base.mq4 |
//| Maximus_genuine |
//| gladmxm@bigmir.net |
//+------------------------------------------------------------------+
#property copyright "Maximus_genuine"
#property link "gladmxm@bigmir.net"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 DarkGreen
#property indicator_color2 Maroon
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
int x=1;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{ if(Digits == 5) x=10;
//---- indicators
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,159);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexEmptyValue(0,0.0);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1,159);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexEmptyValue(1,0.0);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
//----
int limit;
int counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//---- main loop
for(int i=0; i<limit; i++)
{
double w5= iMA(NULL,0,5,0,MODE_LWMA,PRICE_TYPICAL,i+1);
double w8= iMA(NULL,0,8,0,MODE_LWMA,PRICE_TYPICAL,i+1);
double e18=iMA(NULL,0,18,0,MODE_EMA,PRICE_TYPICAL,i+1);
double e28=iMA(NULL,0,28,0,MODE_EMA,PRICE_TYPICAL,i+1);
if( w5>e18 &&
w5>e28 &&
w8>e18 &&
w8>e28
) ExtMapBuffer1[i]=Low[i]-x*20*Point;
//--------------------------------------------
if( w5<e18 &&
w5<e28 &&
w8<e18 &&
w8<e28
) ExtMapBuffer2[i]=High[i]+x*20*Point;
}
return(0);
}
//+---------------------------end_film---------------------------------------+
Comments