dex_SolarWind





//+------------------------------------------------------------------+
//|                                                dex_SolarWind.mq4 |
//|                                        Copyright © 2006, akadex. |
//|                                                           tohell |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, akadex"
#property link      "tohell"
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Gray
#property indicator_color2 Aqua
#property indicator_color3 Red
#property indicator_level1 0

extern int period=12;
extern int price=6; 
extern int smoothperiod=3; 
extern int TypeMA=3;

double buffer[],MA1buffer[],MA2buffer[],Value[],Fish[];
double MaxH,MinL,Price;
int i;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
{
   IndicatorBuffers(4);
  SetIndexStyle(0,DRAW_HISTOGRAM,0,2);
  SetIndexLabel(0,"Trend");
  SetIndexBuffer(0,buffer);
  SetIndexStyle(1,DRAW_NONE);
  SetIndexBuffer(1,MA1buffer);
  SetIndexStyle(2,DRAW_LINE,0,1);
  SetIndexLabel(2,"Exit "+smoothperiod);
  SetIndexBuffer(2,MA2buffer);
  SetIndexBuffer(3,Value);

   
   string short_name="dex_SolarWind";
   IndicatorShortName(short_name);
   return(0);
}
int deinit()
{
   return(0);
}

int start()
{
	int    limit;
	int    counted_bars = IndicatorCounted();
	if (counted_bars>0)
		counted_bars--;
	else
	counted_bars = 1;
	limit = Bars - counted_bars;
	
	for (i=limit; i>=0; i--)
	{
   switch (price)
     {
     case 1: Price = Open[i]; break;
     case 2: Price = Close[i]; break;
     case 3: Price = High[i]; break;
     case 4: Price = Low[i]; break;
     case 5: Price = (High[i]+Low[i]+Close[i])/3; break;
     case 6: Price = (Open[i]+High[i]+Low[i]+Close[i])/4; break;
     case 7: Price = (Open[i]+Close[i])/2; break;
    default: Price = (High[i]+Low[i])/2; break;
     }
   // Îïðåäåëÿåì ìèíèìóì è ìàêñèìóì çà èññëåäóåìûé ïåðèîä
   MaxH = High[Highest(NULL,0,MODE_HIGH,period,i)];
   MinL = Low[Lowest(NULL,0,MODE_LOW,period,i)];
   
   // Âû÷èñëÿåì çíà÷åíèÿ
   Value[i] = 0.33*2*((Price-MinL)/(MaxH-MinL)-0.5) + 0.67*Value[i+1];     
   buffer[i] = 0.5*MathLog((1+Value[i])/(1-Value[i]))+0.5*Fish[i+1];
   }
	for (i=limit; i>=0; i--)
	{
   MA1buffer[i]=iMAOnArray(buffer,0,smoothperiod,0,TypeMA,i);
	}
	for (i=limit; i>=0; i--)
	{
   MA2buffer[i]=iMAOnArray(MA1buffer,0,smoothperiod,0,TypeMA,i);	
	}
   return(0);
}





Sample





Analysis



Market Information Used:

Series array that contains open prices of each bar
Series array that contains close prices for each bar
Series array that contains the highest prices of each bar
Series array that contains the lowest prices of each bar


Indicator Curves created:

Implements a curve of type DRAW_HISTOGRAM

Implements a curve of type DRAW_NONE
Implements a curve of type DRAW_LINE

Indicators Used:

Moving average indicator


Custom Indicators Used:

Order Management characteristics:

Other Features: