Cyber Cycle Oscillator

Download script
Author: Copyright � 2006, Luis Guilherme Damiani
Cyber Cycle Oscillator

The Cyber Cycle is a sophisticated technical analysis tool designed to provide traders with a clearer view of market trends by filtering out minor price fluctuations. Instead of looking at raw price movements, which can often be "noisy" and confusing, this script uses mathematical smoothing techniques to identify the underlying cycle of the market.

How it Works

The logic behind the Cyber Cycle operates through three distinct stages:

1. Price Selection and Weighting The tool begins by deciding which type of price data to analyze. Depending on your settings, it looks at either the "Median" price (the midpoint between the high and low of a candle) or the "Typical" price (an average of the high, low, and closing prices). Once chosen, the script takes the current price and compares it against the prices of the three preceding candles. It applies a specific weight to these prices—giving more importance to the immediate past—to create a preliminary balanced view of the market's movement.

2. Advanced Smoothing (The Core Engine) This preliminary data is then fed into a multi-layered smoothing process. The script calculates a weighted average that considers the relationship between the current price and the historical prices around it. This helps to "level out" sudden spikes or drops that don't reflect a real change in trend, allowing the indicator to focus on the momentum of the market rather than momentary volatility.

3. Signal Generation Finally, the script generates three distinct visual outputs:

  • The Primary Trend: A smoothed line representing the core cycle of the price action.
  • The Offset Line: A lagged version of the primary trend used to observe the relationship between current movements and recent history.
  • The Signal Line: A final calculation that applies a secondary smoothing factor (based on a customizable "lag" parameter). This line acts as a stabilizer, helping traders identify when the cycle is gaining strength or beginning to shift direction.

Summary for Traders

In simple terms, the Cyber Cycle acts like a high-quality lens for your chart. It takes the messy, erratic movements of live trading and distills them into three smooth lines. By stripping away the "noise" of individual price ticks, it aims to reveal the rhythmic cycle of the market, making it easier to visualize the broader direction of the trend.

Miscellaneous
Implements a curve of type %1
13 Views
0 Downloads
0 Favorites
Cyber Cycle Oscillator
//+------------------------------------------------------------------+
//|                                               Cyber Cycle        |
//|                         Copyright © 2006, Luis Guilherme Damiani |
//|                                      http://www.damianifx.com.br |
//|
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Luis Guilherme Damiani"
#property link      "http://www.damianifx.com.br"

#property indicator_buffers 3
#property indicator_separate_window
//#property indicator_chart_window

#property indicator_color1 Red
#property indicator_color2 LightBlue
#property indicator_color3 Yellow

//---- input parameters
extern double       alpha=0.07;
//extern int       maxbars=2000;
extern double lag_signal2=9;
//extern bool stochfish=true;
//extern int stochfish_window=8;
extern string 
Price_Choice="-----  Typical or Median  --------------";
extern bool is_median=true;

//---- buffers
double ind1[];
double ind2[];
double ind3[];
double AuxBuffer[]; //Smooth

double alpha2;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ind1);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,ind2);
   SetIndexStyle(2,DRAW_LINE);
   SetIndexBuffer(2,ind3);
   SetLevelValue(0,0.0);
//   SetLevelValue(1,-0.8);
   ArrayInitialize(ind1,0.0);
   ArrayInitialize(ind2,0.0);
   ArrayInitialize(ind3,0.0);
   ArrayResize(AuxBuffer,Bars);
   ArrayInitialize(AuxBuffer,0.0);
   alpha2=1/(lag_signal2+1);  
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+

int start()
  {
      double pr0,pr1,pr2,pr3=0;
      
      int    counted_bars=IndicatorCounted();
    
      //---- check for possible errors
      if(counted_bars<0) return(-1);
      int limit=Bars-counted_bars;
  //    if(limit>maxbars)limit=maxbars;      
      //if (limit>Bars-1)limit=Bars-1;   
      //---- 
      for (int i = limit; i>=0;i--)
      {
         if(is_median)
         {
            pr0=(High[i]+Low[i])/2;
            pr1=(High[i+1]+Low[i+1])/2;
            pr2=(High[i+2]+Low[i+2])/2;
            pr3=(High[i+3]+Low[i+3])/2;            
         }
         else
         {
            pr0=(High[i]+Low[i]+Close[i])/3;
            pr1=(High[i+1]+Low[i+1]+Close[i+1])/3;
            pr2=(High[i+2]+Low[i+2]+Close[i+2])/3;      
            pr3=(High[i+3]+Low[i+3]+Close[i+3])/3;      
         }
	      
	      AuxBuffer[i]= (pr0+2*pr1+2*pr2+pr3)/6;
	      
	      ind1[i]=MathPow(1-0.5*alpha,2)*(AuxBuffer[i]-2*AuxBuffer[i+1]+AuxBuffer[i+2])
	              +2*(1-alpha)*ind1[i+1]
	              -MathPow(1-alpha,2)*ind1[i+2];
	      
	      ind2[i]=ind1[i+1];
	      ind3[i]=alpha2*ind1[i]+(1-alpha2)*ind3[i+1];
         
       }
   
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments