MAcross_Rsi_Sto_Macd_Fx10SetupTM

Download script
Author: palanka � ������������� � ���� ������
MAcross_Rsi_Sto_Macd_Fx10SetupTM

The Fx10 Setup is a technical analysis tool designed to identify potential entry points in financial markets by synchronizing multiple momentum and trend indicators. Instead of relying on a single data point, it looks for "confluence"—a situation where several different mathematical models agree on the direction of the market at the same time.

Core Logic Overview

The script works by scanning price history to find specific moments where two distinct conditions are met: a Trend Confirmation (is the market moving up or down?) and a Momentum Check (is there enough strength behind that movement?). When these factors align, the tool places visual markers (arrows) on the chart to signal potential long (buy) or short (sell) opportunities.

How it Identifies Buy Signals (Long)

For a "Buy" signal to appear, the script verifies three specific criteria simultaneously:

  1. Moving Average Cross: The fast-moving average must be positioned above the slow-moving average, indicating an established upward trend.
  2. Relative Strength Index (RSI): The RSI must be at or above a threshold of 55, confirming that price momentum is tilting toward the upside.
  3. Stochastic & MACD Alignment: Both the Stochastic Oscillator and the MACD (Moving Average Convergence Divergence) must show positive "Up" signals, ensuring that the immediate price velocity supports the trend.

When all three conditions are met, the script places a green arrow below the price candle.

How it Identifies Sell Signals (Short)

Conversely, for a "Sell" signal to appear, the script looks for the opposite alignment:

  1. Moving Average Cross: The fast-moving average must fall below the slow-moving average, indicating a downward trend.
  2. Relative Strength Index (RSI): The RSI must drop to or below a threshold of 45, confirming downward pressure.
  3. Stochastic & MACD Alignment: Both the Stochastic Oscillator and the MACD must show negative "Down" signals, signaling that the price is losing strength and moving lower.

When these conditions align, the script places a red arrow above the price candle.

Key Customization Features

To give users flexibility, the logic includes several adjustable parameters:

  • Scaling Factor: A multiplier allows you to expand or contract the sensitivity of all indicators at once without having to change every individual setting manually.
  • Indicator Periods: You can customize the speeds of the Moving Averages, the RSI timeframe, and the Stochastic settings to suit different trading styles (e.g., faster for day trading or slower for swing trading).
  • Visual Offsets: The script includes a "delay" value that ensures the signal arrows are placed at a clean distance from the price bars, keeping the chart easy to read.
Indicators Used
Moving average indicatorRelative strength indexStochastic oscillatorMACD Histogram
Miscellaneous
Implements a curve of type %1
18 Views
0 Downloads
0 Favorites
MAcross_Rsi_Sto_Macd_Fx10SetupTM
//+------------------------------------------------------------------+
//|                                                     Fx10 setup   |
//|                 Copyright © 2000-2007, MetaQuotes Software Corp. |
//|                                         http://www.metaquotes.ru |
//+------------------------------------------------------------------+
//revised:  Tartan
//mod2008tsd ki
#property copyright "palanka è ïðèìàçàâøèéñÿ ê íåìó Òàðòàí"
#property link      ""
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 LimeGreen
#property indicator_color2 Red
//----
extern double ParmMult=2.0; // multiply the standard parameters by this scale factor

extern int fastMA=5;
extern int fastMAmode=3;
extern int fastMAprice=0;

extern int slowMA=10;
extern int slowMAmode=3;
extern int slowMAprice=0;

extern int RSIperiod=14;

extern int StoK=5;
extern int StoD=3;
extern int StoSl=3;


extern int MacdFastMA=12;
extern int MacdSlowMA=26;
extern int MacdSigMA=9;

extern double del=30;

extern string  note_Price_ = "0C,1O 2H3L,4Md 5Tp 6WghC: Md(HL/2)4,Tp(HLC/3)5,Wgh(HLCC/4)6";
extern string  note_MAmode =  "SMA0 EMA1 SMMA2 LWMA3";

//----
int shift,ks,kl;
bool first=true;
int prevbars=0;
bool RsiUp=false, RsiDown=false;
double signal_long[];
double signal_short[];
bool up=false;
bool down=false;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
  {
   SetIndexBuffer(0,signal_long);
   SetIndexBuffer(1,signal_short);
   IndicatorShortName("Fx10Setup");
   SetIndexEmptyValue(0, 0.0) ;
   SetIndexEmptyValue(1, 0.0) ;
   //
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,241);
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(1,242);
   //
   IndicatorDigits(1);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
   if (prevbars==Bars)
      return(0);
   // check for additional bars loading or total reloading
   if ((Bars < prevbars) || (Bars - prevbars > 1))
      first=true;
//----
   prevbars=Bars;
   if (first)
     {
         int limit= MathMax(fastMA,slowMA);
             limit= MathMax(limit,MacdSlowMA);
         if (Bars<=limit * ParmMult)
    
//      if (Bars<=26 * ParmMult)
         return(0);
      first=false;
     }
   shift=Bars;
   while(shift>=0)
     {
      signal_long[shift]=0.0;
      signal_short[shift]=0.0;
//----

      double fast_MA=iMA(NULL, 0, fastMA * ParmMult, 0, fastMAmode, fastMAprice, shift);
      double slow_MA=iMA(NULL, 0, slowMA * ParmMult, 0, slowMAmode, slowMAprice, shift);
//----
      if (fast_MA > slow_MA && kl==0)
        {
         RsiUp=iRSI(NULL, 0, RSIperiod * ParmMult, PRICE_CLOSE, shift)>=55.0;
         //and iRSI(p1, 1) > iRSI(p1, 2)
         double Stoch0=iStochastic(NULL, 0, StoK*ParmMult, StoD*ParmMult, StoSl*ParmMult, MODE_SMA, PRICE_CLOSE, MODE_MAIN, shift);
         // double Stoch1 = iStochastic(NULL, 0, 5*ParmMult, 3*ParmMult, 3*ParmMult, MODE_SMA, PRICE_CLOSE, MODE_MAIN, shift + 1);
         double StochSig0=iStochastic(NULL, 0, StoK*ParmMult, StoD*ParmMult, StoSl*ParmMult, MODE_SMA, PRICE_CLOSE, MODE_SIGNAL, shift);
         bool StochUp=(Stoch0 > StochSig0);
         //and Stoch0 > Stoch1
         //and Stoch0 >= StochHigh
         double MacdCurrent=iMACD(NULL, 0, MacdFastMA*ParmMult, MacdSlowMA*ParmMult, MacdSigMA*ParmMult, PRICE_CLOSE, MODE_MAIN, shift);
         // double MacdPrevious = iMACD(NULL, 0, 12*ParmMult, 26*ParmMult, 9*ParmMult, PRICE_CLOSE, MODE_MAIN, shift + 1);
         double MacdSig0=iMACD(NULL, 0, MacdFastMA*ParmMult, MacdSlowMA*ParmMult, MacdSigMA*ParmMult, PRICE_CLOSE, MODE_SIGNAL, shift);
         bool MacdUp=(MacdCurrent > MacdSig0);
         //and  MacdCurrent > MacdPrevious
         //and MacdCurrent > 50
             if (StochUp && RsiUp && MacdUp)
          {  kl=1;ks=0;
             signal_long[shift]=Low[shift] - del*Point;
          }  else kl=0; 
        }
      else if (fastMA < slowMA && ks==0)
           {
            RsiDown=iRSI(NULL, 0, RSIperiod * ParmMult, PRICE_CLOSE, shift)<=45.0;
            //and iRSI(p1, 2) > iRSI(p1, 1)
            Stoch0=iStochastic(NULL, 0, StoK*ParmMult, StoD*ParmMult, StoSl*ParmMult, MODE_SMA, PRICE_CLOSE, MODE_MAIN, shift);
            // double Stoch1 = iStochastic(NULL, 0, 5*ParmMult, 3*ParmMult, 3*ParmMult, MODE_SMA, PRICE_CLOSE, MODE_MAIN, shift + 1);
            StochSig0=iStochastic(NULL, 0, StoK*ParmMult, StoD*ParmMult, StoSl*ParmMult, MODE_SMA, PRICE_CLOSE, MODE_SIGNAL, shift);
            bool StochDown=(Stoch0 < StochSig0);
            //and Stoch0 < Stoch1
            //and Stoch0 <= StochLow
            MacdCurrent=iMACD(NULL, 0, MacdFastMA*ParmMult, MacdSlowMA*ParmMult, MacdSigMA*ParmMult, PRICE_CLOSE, MODE_MAIN, shift);
            // double MacdPrevious = iMACD(NULL, 0, 12*ParmMult, 26*ParmMult, 9*ParmMult, PRICE_CLOSE, MODE_MAIN, shift + 1);
            MacdSig0=iMACD(NULL, 0, MacdFastMA*ParmMult, MacdSlowMA*ParmMult, MacdSigMA*ParmMult, PRICE_CLOSE, MODE_SIGNAL, shift);
            bool MacdDown=(MacdCurrent < MacdSig0);
            //and  MacdCurrent < MacdPrevious
            //and MacdCurrent < 50
            if (StochDown && RsiDown && MacdDown)
             {  ks=1;kl=0;
                signal_short[shift]=High[shift] + del*Point;
             }  else ks=0;  
           }
      shift--;
     }
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments