Solar_Wind_clean_Xalert

Download script
Solar_Wind_clean_Xalert

The Solar Wind Clean XXX is a technical analysis tool designed to help traders identify momentum shifts and trend directions by smoothing out market noise. Unlike standard indicators that can sometimes react too quickly to minor price fluctuations, this script uses a sophisticated mathematical approach to "clean" the data, making it easier to see the underlying trend.

How the Logic Works

1. Price Range Analysis The tool begins by examining a specific look-back period (defined by the user) to identify the highest high and the lowest low within that window. It then calculates the current price's relative position within that range. By determining where the current price sits between these extremes, it establishes a baseline of immediate market movement.

2. Normalization and Transformation To make the data more readable, the script applies a normalization process. It converts the raw price data into a standardized value. This is followed by a specific mathematical transformation (known as a Fisher Transform logic) which helps to linearize the data. In simpler terms, this step helps to highlight "overextended" moves and brings irregular price spikes back into a manageable scale, making the resulting visual more consistent.

3. Smoothing for Clarity Once the primary data is transformed, the script applies an Exponential Moving Average (EMA). This acts as a filter; it removes the "jitter" from the calculations to ensure that the lines moving on your chart represent sustained trends rather than momentary noise. The result is a smoother visual representation that helps traders focus on the primary flow of the market.

4. Visual Representation and Signals The indicator renders its results in a separate window as a histogram:

  • Green Histograms: Represent positive momentum or upward movement.
  • Red Histograms: Represent negative momentum or downward movement.

5. Automated Alerts The logic includes an automated notification system that monitors the "Zero Line." When the smoothed indicator crosses from negative to positive, it signals a potential bullish shift (Crossing zero line up). Conversely, when it crosses from positive to negative, it signals a potential bearish shift (Crossing zero line down). If enabled, the script will provide a real-time alert with the specific time and currency pair for these transitions.

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1It issuies visual alerts to the screen
13 Views
0 Downloads
0 Favorites
Solar_Wind_clean_Xalert
//+------------------------------------------------------------------+
//| Solar wind clean XXX(based on Solar wind clean  (FisherTransform)|
//| revised by Mladen    Copyright © 2005, MetaQuotes Software Corp. |
//| ForexTSD mladen nittany  mod fxbs  ki http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property  copyright "Copyright © 2005,  MetaQuotes Software Corp."
#property  link      "http://www.metaquotes.net/ www.ForexTSD.com"

//---- indicator settings

#property  copyright ""
#property  link      ""

#property  indicator_separate_window
#property  indicator_buffers 2
#property  indicator_color1  Lime
#property  indicator_color2  Red
 
extern bool AlertON=true;
extern int period    = 10;
extern int smoozing  = 2;

double         ExtBuffer0[];
double         ExtBuffer1[];
double         ExtBuffer2[];
double         Value[];
double         ExtBuffer3[];
int flagval1 = 0;
int flagval2 = 0;


int init()
{
   IndicatorBuffers(5);
   SetIndexBuffer(0,ExtBuffer1);
   SetIndexBuffer(1,ExtBuffer2);
   SetIndexBuffer(2,ExtBuffer0);
   SetIndexBuffer(3,Value);
   SetIndexBuffer(4,ExtBuffer3);

   SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexStyle(1,DRAW_HISTOGRAM);

   
//---  mod to show currency pair and Period by nittany1 forex-tsd
//     IndicatorShortName("SOLAR WIND Clean("+Symbol()+","+period+")");
 
   IndicatorShortName("SOLARWIND CleanX ("+period+")("+smoozing+")");
   IndicatorDigits(Digits+1);


   return(0);
}


int start()
{

   int   limit;
   int   counted_bars=IndicatorCounted();

   if(counted_bars>0) counted_bars--;
           limit=Bars-counted_bars;

   for(int i=limit; i>=0; i--)
   {  
      double MaxH  = High[iHighest(NULL,0,MODE_HIGH,period,i)];
      double MinL  = Low [iLowest( NULL,0,MODE_LOW, period,i)];
      double price = (High[i]+Low[i])/2;
      if (MaxH!=MinL)
              Value[i] = 0.33*2*((price-MinL)/(MaxH-MinL)-0.5);

 
      else  Value[i] = 0.00;
            Value[i] = MathMin(MathMax(Value[i],-0.999),0.999); 
            ExtBuffer0[i]=0.5*MathLog((1+Value[i])/(1-Value[i]));

     }     

         for( i=limit; i>=0; i--)
     {
    
            ExtBuffer3[i]=iMAOnArray(ExtBuffer0,0,smoozing,0,MODE_EMA,i);


      //
      //
      //
      //
      //
      
      if(ExtBuffer3[i]<0)
      {
         ExtBuffer2[i]=ExtBuffer3[i];
         ExtBuffer1[i]=0.0;
      }
      else
      {
         ExtBuffer1[i]=ExtBuffer3[i];
         ExtBuffer2[i]=0.0;
      }
      
      if ((ExtBuffer1[i] > 0) && (ExtBuffer2[i+1] < 0.0))
      {
         if (i == 1 && flagval1==0)
         {
           flagval1=1;
           flagval2=0;
           if (AlertON) Alert("Crossing zero line up\n Time=",TimeToStr(TimeCurrent(),TIME_DATE)," ",TimeHour(TimeCurrent()),":",TimeMinute(TimeCurrent()),"\n Symbol=",Symbol()," Period=",Period());
         }
      }
      else if ((ExtBuffer2[i] < 0) && (ExtBuffer1[i+1] > 0.0))
      {
         if (i == 1 && flagval2==0)
         {
           flagval2=1;
           flagval1=0;
           if (AlertON) Alert("Crossing zero line down\n Time=",TimeToStr(TimeCurrent(),TIME_DATE)," ",TimeHour(TimeCurrent()),":",TimeMinute(TimeCurrent()),"\n Symbol=",Symbol()," Period=",Period());
         }
      }
      
   }
   return(0);
}

Comments