Ultitimate_Oscillator_v1

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
Ultitimate_Oscillator_v1
//+------------------------------------------------------------------+
//|                                       Ultitimate Oscillator.mq4  |
//|                                       Ramdass - Conversion only  |
//+------------------------------------------------------------------+

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Green
//---- input parameters
extern int CountBars=300;
//---- buffers
double WUO[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicator line
   IndicatorBuffers(1);
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,WUO);
//----
   if(CountBars >= Bars)
      CountBars = Bars;
   SetIndexDrawBegin(0,Bars-CountBars+28+1);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Ultitimate Oscillator                                            |
//+------------------------------------------------------------------+
int start()
  {
   int i,counted_bars=IndicatorCounted();
//----
   if(Bars<=28)
      return(0);
//---- initial zero
   if(counted_bars<28)
     {
      for(i=1;i<=28; i++)
         WUO[CountBars-i]=0.0;
     }
//----
   i=CountBars-28-1;
//----
   while(i>=0)
     {
      WUO[i]=(iMA(NULL,0,7,0,MODE_LWMA,MODE_CLOSE,i)+
              iMA(NULL,0,14,0,MODE_LWMA,MODE_CLOSE,i)+
              iMA(NULL,0,28,0,MODE_LWMA,MODE_CLOSE,i))/3;
      i--;
     }
   return(0);
  }
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---