10Min_012_v1
Download scriptThis trading tool is designed as a multi-layered technical analysis indicator for the MetaTrader platform. Its primary objective is to identify high-probability trend reversals or momentum shifts by requiring four different technical conditions to align simultaneously before signaling a trade.
Instead of relying on a single metric, the script evaluates market data through the following logical layers:
1. Moving Average Crossovers
The foundation of the logic rests on the relationship between two types of moving averages: the Linear Weighted Moving Average (LWMA) and the Simple Moving Average (SMA). The script looks for a specific "crossing" event where these two averages intersect, which typically signifies a change in the medium-term price momentum.
2. Relative Strength Index (RSI) Filtering
Once a moving average crossover is detected, the tool filters the signal using the Relative Strength Index (RSI). It doesn't just look at the current RSI value; it analyzes the immediate historical trend of the RSI over several previous periods. This ensures that the momentum is moving in the desired direction and hasn't already peaked or exhausted itself.
3. Stochastic Oscillator Verification
The logic then layers in a Stochastic Oscillator check. This acts as a secondary confirmation of momentum. The script compares the "Main" line against the "Signal" line to ensure that the internal velocity of the price movement supports the direction suggested by the moving averages and RSI.
4. MACD Signal Confirmation
The final "gatekeeper" for a signal is the MACD (Moving Average Convergence Divergence). The script specifically checks the position of the MACD Signal line relative to the zero level. This provides a macro-level confirmation, ensuring that the trade aligns with the broader market sentiment.
Summary of Trade Signals
The script produces two distinct types of visual alerts on the chart:
- Bullish Signals (Buy): Triggered when the LWMA crosses above the SMA while the RSI shows upward momentum, the Stochastic lines confirm positive velocity, and the MACD Signal is in positive territory.
- Bearish Signals (Sell): Triggered when the LWMA crosses below the SMA while the RSI shows downward momentum, the Stochastic lines confirm negative velocity, and the MACD Signal is in negative territory.
By requiring all these conditions to be met at once, the logic aims to filter out "false signals" or market noise, providing traders with a more refined entry point based on multiple points of confirmation.
/*-----------------------------+
| |
| Shared by www.Aptrafx.com |
| |
+------------------------------*/
//+------------------------------------------------------------------+
//| 10 Minute trader |
//+------------------------------------------------------------------+
#property copyright "Ron T"
#property link "http://www.lightpatch.com"
#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 White // arrow up for moving average
#property indicator_color2 White // arrow down for moving average
#property indicator_color3 Aqua // box for stoch
#property indicator_color4 Red // box for rsi
#property indicator_color5 White // box for macd
#property indicator_color6 White // dot for early stoch cross
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
double ExtMapBuffer5[];
double ExtMapBuffer6[];
// User Input
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//|------------------------------------------------------------------|
int init()
{
// 233 up arrow
// 234 down arrow
// 159 big dot
// 168 open square
SetIndexStyle(0,DRAW_ARROW);
SetIndexBuffer(0, ExtMapBuffer1);
SetIndexArrow(0,233); //up
SetIndexStyle(1,DRAW_ARROW);
SetIndexBuffer(1, ExtMapBuffer2);
SetIndexArrow(1,234); //down
SetIndexStyle(2,DRAW_ARROW);
SetIndexBuffer(2, ExtMapBuffer3);
SetIndexArrow(2,168); //open square
SetIndexStyle(3,DRAW_ARROW);
SetIndexBuffer(3, ExtMapBuffer4);
SetIndexArrow(3,168); //open square
SetIndexStyle(4,DRAW_ARROW);
SetIndexBuffer(4, ExtMapBuffer5);
SetIndexArrow(4,168); //open square
SetIndexStyle(5,DRAW_ARROW);
SetIndexBuffer(5, ExtMapBuffer6);
SetIndexArrow(5,159); //dot
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
int i;
for( i=0; i<Bars; i++ ) ExtMapBuffer1[i]=0;
for( i=0; i<Bars; i++ ) ExtMapBuffer2[i]=0;
for( i=0; i<Bars; i++ ) ExtMapBuffer3[i]=0;
for( i=0; i<Bars; i++ ) ExtMapBuffer4[i]=0;
for( i=0; i<Bars; i++ ) ExtMapBuffer5[i]=0;
for( i=0; i<Bars; i++ ) ExtMapBuffer6[i]=0;
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
double wma=0, wma_p=0; // linear Weighted Moving Average & Previous
double sma=0, sma_p=0; // Simple Moving Average & Previous
double stochm=0, stochm_p=0; // STOCHastic Main & Previous
double stochs=0, stochs_p=0; // STOCHastic Signal
double macdm=0; // Moving Average Convergance Divergance Main
double macds=0; // Moving Average Convergance Divergance Signal
double rsi=0; // Relative Strength Indicator
double rsi1=0, rsi2=0; // 1st 2 periods of past history
double rsi3=0, rsi4=0; // 2nd 2 periods
int pos=Bars-100; // leave room for moving average periods
while(pos>=0)
{
wma_p=wma; // save previous calculations
wma=iMA(Symbol(),0,10,0,MODE_LWMA,PRICE_CLOSE,pos);
sma_p=sma; // save previous calculations
sma=iMA(Symbol(),0,20,0,MODE_SMA,PRICE_CLOSE,pos);
stochm_p=stochm;
stochm=iStochastic(Symbol(),0,10,6,6,0,1,0,pos);
stochs_p=stochs;
stochs=iStochastic(Symbol(),0,10,6,6,0,1,1,pos);
rsi=iRSI(Symbol(),0,28,PRICE_CLOSE,pos);
rsi1=iRSI(Symbol(),0,28,PRICE_CLOSE,pos+1);
rsi2=iRSI(Symbol(),0,28,PRICE_CLOSE,pos+2);
rsi3=iRSI(Symbol(),0,28,PRICE_CLOSE,pos+3);
rsi4=iRSI(Symbol(),0,28,PRICE_CLOSE,pos+4);
macdm=iMACD(Symbol(),0,24,52,18,0,0,pos);
macds=iMACD(Symbol(),0,24,52,18,0,1,pos);
// RISING stochastic cross
// if (stochm_p>stochm && stochs_p<stochs && stochs>stochm)
// FALLING stochastic cross
// if (stochm_p<stochm && stochs_p>stochs && stochs<stochm)
if ( wma_p < sma_p && wma > sma )
{
if (rsi > 52 && ( rsi1<48 || rsi2<48 || rsi3<48 ) ) //blue
{
if (stochm > stochs) //red
{
if (macds > 0) //white
{
ExtMapBuffer1[pos]=wma - 0.0011;
}
}
}
}
//if (rsi > 55 ) //white dot
// {
// ExtMapBuffer6[pos]=wma + 0.0013;
// }
if ( wma_p > sma_p && wma < sma )
{
if (rsi < 48 && ( rsi1>52 || rsi2>52 || rsi3>52 ) )
{
if (stochm < stochs)
{
if (macds < 0)
{
ExtMapBuffer1[pos]=wma + 0.0011;
}
}
}
}
pos--;
}
return(0);
}
//+------------------------------------------------------------------+
Comments