PivotDyna





//+------------------------------------------------------------------+
//|                                         Äèíàìè÷åñêèé Pivot       |
//|                                         ë¸êñóñ - Conversion only |
//+------------------------------------------------------------------+

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 White
//---- input parameters
extern int Formula=0;

//---- buffers
double Pivot[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
{
  SetIndexBuffer(0,Pivot);
  SetIndexStyle (0,DRAW_SECTION);
	SetIndexEmptyValue(0,0.0);

  return(0);
}
int deinit() { return(0); }
//+------------------------------------------------------------------+
int start()
{
// Ñòðîèì Pivot è Res/Supp ïî FibonacciTrader Journal Issue 6 
  int i,shift;
  double FP,FH,FL;

//  if(Period()>60) return(0);

  for(shift=Bars-1; shift>=0; shift--)
  {
    Pivot[shift]=0;
    if (TimeHour(Time[shift])==0 && TimeMinute(Time[shift])==0 ) //íà÷àëî äíÿ 
  	{ 
      i=1; 
		  while(TimeDay(Time[shift+i])==TimeDay(Time[shift+i+1])) { i++; }

  		FH=High[Highest(NULL,0,MODE_HIGH,i,shift)];
      FL= Low[ Lowest(NULL,0,MODE_LOW, i,shift)];

  		FP=(FH+FL+Close[shift+1+Formula]+Close[shift+1+Formula])/4; //Çíà÷åíèå PivotPoint 
  		Pivot[shift]=FP;
    }

  	if(shift==0)
  	{ 
  		i=1; 
  		while(TimeDay(Time[0])==TimeDay(Time[i])) { i++; }

  		FH=High[ Highest(NULL,0,MODE_HIGH,i,i)];
  		FL=Low[ Lowest(NULL,0,MODE_LOW,i,i)]; 

  		FP=(FH+FL+Close[0]+Close[0])/4; //Çíà÷åíèå PivotPoint 
  		Pivot[0]=FP; 
  	} 
  }

  return(0);
}
//+------------------------------------------------------------------+



Sample





Analysis



Market Information Used:

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


Indicator Curves created:



Indicators Used:



Custom Indicators Used:

Order Management characteristics:

Other Features: