Author: Copyright � 2006, GwadaTradeBoy
Sidus_v2

This technical indicator is designed to provide visual signals on a trading chart by analyzing the relationship between different moving averages. It helps traders identify potential momentum shifts and price trend changes through a combination of smoothing lines and directional markers.

Core Visual Components

The script populates the chart with several distinct visual elements:

  • Trend Lines: It displays four primary moving average lines. These represent the smoothed price action over different timeframes, helping to differentiate between short-term fluctuations and longer-term trends.
  • Directional Arrows: The script identifies specific "cross-over" moments where these averages intersect. It places upward-facing arrows to indicate potential buying opportunities and downward-facing arrows to signal potential selling opportunities.
  • Dynamic Offsets: To ensure the visual markers do not clutter the price candles, the script automatically adjusts the distance of the arrows based on the specific timeframe you are viewing (e.g., it shifts further away on higher timeframes like Daily or Weekly charts).

Trading Logic and Signals

The indicator operates by monitoring two specific types of movements:

1. Momentum Crosses The tool tracks the interaction between two fast-moving averages (the WMA5 and WMA8). When these two lines cross each other, it indicates a shift in short-term momentum. If the faster line crosses above the slower one, an upward signal is generated; if it crosses below, a downward signal is triggered.

2. Tunnel Breakouts The script also monitors a "tunnel" formed by longer moving averages. It looks for instances where the shorter moving averages break through the boundaries of this larger trend tunnel.

  • An Upward Signal is triggered when a moving average breaks above the upper boundary of the trend tunnel, suggesting an aggressive bullish move.
  • A Downward Signal is triggered when a moving average falls below the lower boundary of the trend tunnel, suggesting a bearish breakdown.

Summary for the User

In simple terms, this script acts as a "filter" for price action. Instead of making you guess where the trend is going, it waits for specific mathematical confirmations—either a shift in immediate momentum or a breakout of a larger trend boundary—and then places an arrow on your screen to highlight those specific moments for potential trade entries.

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
9 Views
1 Downloads
0 Favorites
Sidus_v2
//+------------------------------------------------------------------+
//|                                                        Sidus.mq4 |
//|                                  Copyright © 2006, GwadaTradeBoy |
//|                                            racooni_1975@yahoo.fr |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, GwadaTradeBoy"
#property link      "racooni_1975@yahoo.fr"

#property indicator_chart_window
//----Section #property
#property indicator_buffers 7
#property indicator_color1 Red
#property indicator_color2 Red
#property indicator_color3 Aqua
#property indicator_color4 Yellow
#property indicator_color5 Green
#property indicator_color6 Red
#property indicator_color7 Red

//---- Indicateurs
double EMA18, EMA28, WMA5, WMA8, tuncross;
double EMA18Current, EMA18Previous, EMA28Current, EMA28Previous;
double WMA5Current, WMA5Previous, WMA8Current, WMA8Previous;
extern double digit=0;
int    nShift;

//---- buffers
double ExtMapBuffer1[];    //EMA18
double ExtMapBuffer2[];    //EMA28
double ExtMapBuffer3[];    //WMA5
double ExtMapBuffer4[];    //WMA8
double ExtMapBuffer5[];    //Fleche Haut
double ExtMapBuffer6[];    //Fleche Bas
double ExtMapBuffer7[];    //Croix

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
   {
//---- indicators
//---- Styles et couleur des Lignes
      SetIndexStyle(0,DRAW_LINE);
      SetIndexBuffer(0,ExtMapBuffer1);
      SetIndexStyle(1,DRAW_LINE);
      SetIndexBuffer(1,ExtMapBuffer2);
      SetIndexStyle(2,DRAW_LINE);
      SetIndexBuffer(2,ExtMapBuffer3);
      SetIndexStyle(3,DRAW_LINE);
      SetIndexBuffer(3,ExtMapBuffer4);
      SetIndexStyle(3,DRAW_LINE);
//---- Styles et couleur des Fleches      
      SetIndexStyle(4, DRAW_ARROW, 0, 1);    // Fleche vers le haut
      SetIndexArrow(4, 233);
      SetIndexBuffer(4, ExtMapBuffer5);
      SetIndexStyle(5, DRAW_ARROW, 0, 1);    // Fleche vers le bas
      SetIndexArrow(5, 234);
      SetIndexBuffer(5, ExtMapBuffer6);
      SetIndexStyle(6, DRAW_ARROW, 0, 1);    // Croix rouge fin de trade
      SetIndexArrow(6, 251);
      SetIndexBuffer(6, ExtMapBuffer7);
//----       
      switch(Period())
         {
            case     1: nShift = 1;   break;
            case     5: nShift = 3;   break;
            case    15: nShift = 5;   break;
            case    30: nShift = 10;  break;
            case    60: nShift = 15;  break;
            case   240: nShift = 20;  break;
            case  1440: nShift = 80;  break;
            case 10080: nShift = 100; break;
            case 43200: nShift = 200; break;
         }
//----
      return(0);
   }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
   {
//----
   
//----
      return(0);
   }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
   {
      int    i,j,limit,counted_bars=IndicatorCounted();
//----
      if(counted_bars<0) 
         return(-1);
      if(counted_bars>0) 
         counted_bars--;
      limit=Bars-counted_bars;
   
      for(i=0; i<limit; i++)
         {
            EMA18Current=iMA(NULL,0,18,0,MODE_EMA,PRICE_CLOSE,i);
            EMA18Previous=iMA(NULL,0,18,0,MODE_EMA,PRICE_CLOSE,i+1);
            ExtMapBuffer1[i]=EMA18Current;
            EMA28Current=iMA(NULL,0,28,0,MODE_EMA,PRICE_CLOSE,i);
            EMA28Previous=iMA(NULL,0,28,0,MODE_EMA,PRICE_CLOSE,i+1);
            ExtMapBuffer2[i]=EMA28Current;
            WMA5Current=iMA(NULL,0,5,0,MODE_LWMA,PRICE_CLOSE,i);
            WMA5Previous=iMA(NULL,0,5,0,MODE_LWMA,PRICE_CLOSE,i+1);
            ExtMapBuffer3[i]=WMA5Current;
            WMA8Current=iMA(NULL,0,8,0,MODE_LWMA,PRICE_CLOSE,i);
            WMA8Previous=iMA(NULL,0,8,0,MODE_LWMA,PRICE_CLOSE,i+1);
            ExtMapBuffer4[i]=WMA8Current;
//---- Dessin des fleches, future entré en trade
/*            if ((EMA18Current > EMA28Current + digit*Point) &&( EMA18Previous <= EMA28Previous)) // Croisement Tunnel
               {
                  tuncross = EMA18*/
//---- Buy
                  //if (WMA5Current > WMA8Current && WMA5Previous <= WMA8Previous)
                  /*-if (
                  //((EMA18Current > EMA28Current + digit*Point) &&( EMA18Previous <= EMA28Previous)) &&   // Croisement Tunnel
                  //((WMA5Current > WMA8Current + digit*Point) &&( WMA5Previous <= WMA8Previous)) &&       // Croisement WMA
                  //((WMA5Current > EMA18Current+ digit*Point) && ( WMA5Previous <= EMA18Current)) &&       // Croisement Bord1Tunnel WMA5
                  //((WMA5Current > EMA28Current+ digit*Point) && ( WMA5Previous <= EMA28Current)) &&       // Croisement Bord2 Tunnel WMA5
                  ((WMA8Current > EMA18Current+ digit*Point) && ( WMA8Previous <= EMA18Current)) //&&       // Croisement Bord1 Tunnel WMA8
                  //((WMA8Current > EMA28Current+ digit*Point) && ( WMA8Previous <= EMA28Current))        // Croisement Bord2 Tunnel WMA8
                  )*/
                  if((WMA5Current > WMA8Current+  digit*Point )&&(WMA5Previous<=WMA8Previous))  // Croisement WMA5 et WMA8, Lot = 10% de LotsOptimized()
                     {
                        ExtMapBuffer5[i] = Low[i] - nShift*Point;
                     }
                  if((WMA8Current > EMA28Current+ digit*Point) && ( WMA8Previous <= EMA28Current))  // Croisement WMA8  up bord supérieur du tunnel
                     {
                        ExtMapBuffer5[i] = Low[i] - nShift*Point;
                     }
//---- Sell
                  //if(WMA8Current > WMA5Current && WMA8Previous <= WMA5Previous)
                  /*if (
                  //((EMA18Current < EMA28Current + digit*Point) &&( EMA18Previous >= EMA28Previous)) &&   // Croisement Tunnel
                  //((WMA5Current < WMA8Current + digit*Point) &&( WMA5Previous >= WMA8Previous)) &&       // Croisement WMA
                  //((WMA5Current < EMA18Current+ digit*Point) && ( WMA5Previous <= EMA18Current)) &&       // Croisement Bord1Tunnel WMA5
                  //((WMA5Current < EMA28Current+ digit*Point) && ( WMA5Previous <= EMA28Current)) &&       // Croisement Bord2 Tunnel WMA5
                  //((WMA8Current < EMA18Current+ digit*Point) && ( WMA8Previous <= EMA18Current)) &&       // Croisement Bord1 Tunnel WMA8
                  ((WMA8Current < EMA28Current+ digit*Point) && ( WMA8Previous <= EMA28Current))          // Croisement Bord2 Tunnel WMA8
                  )*/
                  if((WMA8Current > WMA5Current+  digit*Point )&&(WMA8Previous<=WMA5Previous))  // Croisement WMA5 et WMA8, Lot = 10% de LotsOptimized()
                     {
                        ExtMapBuffer6[i] = High[i] + nShift*Point;            
                     }
                  if((EMA28Current > WMA8Current+ digit*Point) && ( WMA8Previous >= EMA28Current))  // Croisement WMA8  down bord inférieur du tunnel
                     {
                        ExtMapBuffer6[i] = High[i] + nShift*Point;            
                     }
               /*}*/
         }
//---- Dessin des croix, future sortie en trade
         
//----
      return(0);
   }
//+------------------------------------------------------------------+

Comments