MTF_MACD_OsMA_L

Author: Copyright � 2007, SOK
MTF_MACD_OsMA_L
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
MTF_MACD_OsMA_L
//+-----------------------------------------------------------------------+
//|                                        MTF_MACD_OsMA_L                |
//|                                                 Copyright © 2007, SOK |
//|                                              http://SOK.LiteForex.net |
//|                        www.metaquotes.net/ mtf / www.forex-tsd.com ik |
//+-----------------------------------------------------------------------+
#property copyright "Copyright © 2007, SOK"
#property link      "http://sok.liteforex.net"
//----
#property indicator_separate_window
#property indicator_buffers 5
#property indicator_color1 LimeGreen
#property indicator_color2 Magenta
#property indicator_color3 Blue
#property indicator_color4 Red
#property indicator_color5 Brown
#property indicator_width1 2
#property indicator_width2 2
//----
extern int TimeFrame=0;
extern int FastEMA = 12;
extern int SlowEMA = 26;
extern int SignalSMA = 9;
extern int AplyingPrice = 0;

double ExtMapBuffer0[];
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   SetIndexStyle(0, DRAW_LINE);
   SetIndexBuffer(0, ExtMapBuffer0);
   SetIndexStyle(1, DRAW_LINE);
   SetIndexBuffer(1, ExtMapBuffer1);
//--
   SetIndexStyle(2, DRAW_HISTOGRAM);
   SetIndexBuffer(2, ExtMapBuffer2);
   SetIndexStyle(3, DRAW_HISTOGRAM);
   SetIndexBuffer(3, ExtMapBuffer3);
   SetIndexStyle(4, DRAW_LINE);
   SetIndexBuffer(4, ExtMapBuffer4);

//--

   IndicatorShortName("MTF_OsMACD[" + FastEMA + ", " + SlowEMA + ", " + 
                      SignalSMA + "]TF ("+TimeFrame+")"); 
//--  
   SetIndexLabel(0,"MTF_OsMACD,OsMA[" + FastEMA + ", " + SlowEMA + ", " + 
                      SignalSMA + "]TF ("+TimeFrame+")");
   SetIndexLabel(1,"MTF_OsMACD,OsMA[" + FastEMA + ", " + SlowEMA + ", " + 
                      SignalSMA + "] TF ("+TimeFrame+")");
   SetIndexLabel(2,"MTF_OsMACD,MACD[" + FastEMA + ", " + SlowEMA + ", " + 
                      SignalSMA + "]TF ("+TimeFrame+")");
   SetIndexLabel(3,"MTF_OsMACD,MACD[" + FastEMA + ", " + SlowEMA + ", " + 
                      SignalSMA + "] TF ("+TimeFrame+")");
   SetIndexLabel(3,"MTF_OsMACD,Signal,[" + FastEMA + ", " + SlowEMA + ", " + 
                      SignalSMA + "] TF ("+TimeFrame+")");
  
      return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator start function                                  |
//+------------------------------------------------------------------+
int start() 

  {
   datetime TimeArray[];
   int    i,shift,limit,y=0,counted_bars=IndicatorCounted();
     
   ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame); 
   
   limit=Bars-counted_bars+TimeFrame/Period();
   for(i=0,y=0;i<limit;i++) {
     if (Time[i]<TimeArray[y]) {y++;}   
 
 ExtMapBuffer0[i] = iCustom(NULL, TimeFrame, "MACD_OsMA_M",FastEMA, SlowEMA, SignalSMA, 
                                AplyingPrice,  0,y);
 ExtMapBuffer1[i] = iCustom(NULL, TimeFrame, "MACD_OsMA_M",FastEMA, SlowEMA, SignalSMA, 
                                AplyingPrice,  1,y);
 
 ExtMapBuffer2[i] = iCustom(NULL, TimeFrame, "MACD_OsMA_M",FastEMA, SlowEMA, SignalSMA, 
                                AplyingPrice,  3,y);
 ExtMapBuffer3[i] = iCustom(NULL, TimeFrame, "MACD_OsMA_M",FastEMA, SlowEMA, SignalSMA, 
                                AplyingPrice,  4,y);
 ExtMapBuffer4[i] = iCustom(NULL, TimeFrame, "MACD_OsMA_M",FastEMA, SlowEMA, SignalSMA, 
                                AplyingPrice,  6,y);

 
 
 
 
 
 
 
   }
   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 ---