VininI_Cyber_Cycle_V2_My3[1]

Download script
Author: Copyright � 2008, Victor Nicolaev
VininI_Cyber_Cycle_V2_My3[1]

This technical tool is designed to analyze market trends by identifying underlying cycles and signal strengths through a multi-layered mathematical process. Instead of simply looking at raw price movements, the script transforms market data into a normalized format to better highlight cyclical behavior over time.

How the Logic Works

1. Data Normalization and Selection The tool begins by selecting a specific type of price data (such as Open, Close, High, Low, or averages like Typical Price) from the chart. To ensure the analysis is consistent regardless of the asset's actual value, it performs a "Normalization" step. It compares current prices against the opening range of the previous month to create a relative scale. This allows the indicator to interpret price movements proportionally across different markets.

2. Smoothing the Market Noise Raw market data can be erratic. To find a clearer picture, the script applies a weighted smoothing technique. It calculates a rolling average that gives specific importance to current and recent historical prices. By blending these figures, the tool filters out minor "noise" and creates a cleaner data stream used for the next stage of analysis.

3. Cycle Detection and Calculation Once the price is smoothed, the logic moves into cycle detection. It calculates a specific mathematical curve that tracks the momentum of the market's oscillations. This involves comparing current smoothed values against past data points to determine the direction and speed of the trend. The result is converted into a numerical value that fluctuates within a set range (typically between -1.0 and 1.0).

4. Signal Generation The final step translates these complex calculations into visual signals for the trader:

  • Buy Signals: When the calculated cycle value reaches a high threshold (above 0.5), the tool identifies this as a "Buy" zone, highlighting positive momentum in green.
  • Sell Signals: When the cycle value drops below a low threshold (below -0.5), the tool identifies this as a "Sell" zone, highlighting negative momentum in red.

In summary, the script takes raw price data, normalizes it to a standard scale, smooths out the fluctuations to find a hidden trend, and then provides clear visual cues when that trend reaches significant levels of strength.

Price Data Components
Series array that contains open prices of each bar
Miscellaneous
Implements a curve of type %1
4 Views
0 Downloads
0 Favorites
VininI_Cyber_Cycle_V2_My3[1]
//+------------------------------------------------------------------+
//|                                                     VininI_Cyber |
//|                                Copyright © 2009, Victor Nicolaev |
//|                                            e-mail: vinin@mail.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, Victor Nicolaev"
#property link      "e-mail: vinin@mail.ru"

#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Yellow
#property indicator_color2 Green
#property indicator_color3 Red
#property indicator_level1  -0.5
#property indicator_level2   0
#property indicator_level3   0.5
#property indicator_minimum -1.05
#property indicator_maximum  1.05

//---- input parameters 

extern double alpha=0.01;
extern double betta=1.0;
extern int price_mode=4;
extern double NormalizePrice=100; // âåëè÷èíà ê êîòîðîé ïðèâîäÿòñÿ öåíû 
//---- buffers 

double Cycle[];
double Smonth[];
double iCycle[];
double Buy[];
double Sell[];
double Koef=1;
//+------------------------------------------------------------------+ 
//| Custom indicator initialization function | 
//+------------------------------------------------------------------+ 
int init() { 
   IndicatorBuffers(5);
   SetIndexBuffer(0, iCycle); 
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(1, Buy); 
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(2, Sell); 
   SetIndexStyle(2,DRAW_LINE);

   SetIndexBuffer(3, Smonth);
   SetIndexBuffer(4, Cycle);  
  
   IndicatorShortName("VininI_Cyber_Cycle_Norm_Price");
   
   return(0); 
}  

int deinit() { return(0); } 


//+------------------------------------------------------------------+ 
//| Custom indicator iteration function | 
//+------------------------------------------------------------------+ 
int start() { 
   int counted_bars = IndicatorCounted(); 

   if (counted_bars < 0) return(-1); 
   if (counted_bars > 0) counted_bars--;
   
   int limit=Bars - counted_bars;
   for(int i = limit; i >= 0; i--)    {
      Smonth[i]=(Price(i)+2.0*Price(i+1)+2.0*Price(i+2)+Price(i+3))/6.0;
   }
   for(i = limit; i >= 0; i--)    {
      Cycle[i]=betta*((1.0-0.5*alpha)*(1.0-0.5*alpha)*(Smonth[i]-2.0*Smonth[i+1]+Smonth[i+2])+2.0*(1.0-alpha)*Cycle[i+1]-(1.0-alpha)*(1.0-alpha)*Cycle[i+2]);
      iCycle[i]=(MathExp(2.0*Cycle[i])-1.0)/(MathExp(2.0*Cycle[i])+1.0);
      if (iCycle[i]>= 0.5) {Buy[i]=iCycle[i];Buy[i+1]=iCycle[i+1];}
      if (iCycle[i]<=-0.5) {Sell[i]=iCycle[i];Sell[i+1]=iCycle[i+1];}
   }

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

double Price(int pos){
   //----------ìàñøòàáèðóþùèé ìíîæèòåëü öåíû èç öåíû íà íà÷àëî ïðîøëîãî ìåñÿöà
   double Range = iOpen(Symbol(),PERIOD_MN1,1);
   Koef = NormalizePrice/Range;
   switch (price_mode){
      case PRICE_CLOSE: return(Koef*Close[pos]);
      case PRICE_OPEN: return(Koef*Open[pos]);
      case PRICE_HIGH: return(Koef*High[pos]);
      case PRICE_LOW: return(Koef*Low[pos]);
      case PRICE_MEDIAN: return(Koef*(High[pos]+Low[pos])/2.0); 
      case PRICE_TYPICAL: return(Koef*(High[pos]+Low[pos]+Close[pos])/3.0);
      case PRICE_WEIGHTED: return(Koef*(High[pos]+Low[pos]+Close[pos]+Close[pos])/4.0);
   }
}

Comments