MQL4 - automated forex trading   /  

Code Base

Code Base  Indicators  3D Oscilator To post a new code, please log in or register

This library is for
MetaTrader 4
Download MT 4 - 3.5 Mb

Mobile trading!
Buy a license and be mobile in your trading!

Name:
3D Oscilator
Author: Collector (2006.07.11 11:39)
Rating: 1
Downloaded: 2418
Download:
 3D Oscilator.mq4 (3.1 Kb) View


    Oscillator that signals about trend turn. When the blue line meets the red one top-down, Sell. When it meets the red line bottom-up, Buy.





2 comments  To post a new comment, please log in or register

This indicator seem like my outdated '1Damitrix', very simple and powerfull.

03.01.2007 01:03 musanto
The working version :

//+------------------------------------------------------------------+
//|                                                 3D Oscilator.mq4 |
//|                                                                  |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Author - Luis Damiani. Ramdass - Conversion only"
 
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Blue
//---- input parameters
 
extern int D1RSIPer=13;
extern int D2StochPer=8;
extern int D3tunnelPer=8;
extern double hot=0.4;
extern int sigsmooth=4;
extern int CountBars=300;
 
//---- buffers
double sig1n[];
double sig2n[];
 
double sk,sk2,ss;
int cs;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   IndicatorBuffers(2);
//---- indicator line
   SetIndexStyle(0,DRAW_LINE);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(0,sig1n);
   SetIndexBuffer(1,sig2n);
//----
   cs = MathMax(D1RSIPer,MathMax(D2StochPer,D3tunnelPer));
   ss=sigsmooth;
   if (ss<2) ss=2;
   sk = 2.0 / (ss + 1.0);
   sk2= 2.0 / (ss*0.8+1.0);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| 3D Oscilator                                                     |
//+------------------------------------------------------------------+
int start()
  {
   if(Bars<=cs) return(0);
   if (CountBars>Bars) CountBars=Bars;
   SetIndexDrawBegin(0,Bars-CountBars+cs);
   SetIndexDrawBegin(1,Bars-CountBars+cs);
   int i,i2;//counted_bars=IndicatorCounted();
   double rsi,maxrsi,minrsi,storsi,E3D,sig1,sig2;
 
//----
for(i=CountBars; i>=0; i--)
{
      
   maxrsi=0;  
   minrsi=100;
 
   for (i2=i+D2StochPer;i2>=i; i2--)
      {
      rsi=iRSI(NULL,0,D1RSIPer,PRICE_CLOSE,i2);
      if (rsi>maxrsi) maxrsi=rsi;
      if (rsi<minrsi) minrsi=rsi;
      }
 
   if (maxrsi-minrsi!=0.0) storsi=((rsi-minrsi)/(maxrsi-minrsi)*200-100);
   E3D=hot*iCCI(NULL,0,D3tunnelPer,PRICE_TYPICAL,i)+(1-hot)*storsi;
   sig1n[i]=sk*E3D+(1-sk)*sig1;
   sig2n[i]=sk2*sig1+(1-sk2)*sig2;
   sig1=sig1n[i];
   sig2=sig2n[i];
 
}
   return(0);
  }
//+------------------------------------------------------------------+


11.08.2006 19:37 ramdass