InvestorsHub Logo

simplegreen

08/30/13 5:09 PM

#121815 RE: Qui-Gon Kagi #121814



//+------------------------------------------------------------------+
//| MA_Shade.mq4 |
//| oromek |
//| oromeks@gmail.com |
//+------------------------------------------------------------------+
#property copyright "oromek"
#property link "oromeks@gmail.com"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Blue
#property indicator_width1 3
#property indicator_width2 3

extern int MA1_Period=21;
extern int MA2_Period=50;
extern string MA_Method_Help="0-SMA, 1-EMA, 2-SMMA, 3-LWMA";
extern int MA_Method=1;

double MA1, MA2;
double MA1_Buffer[], MA2_Buffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_DOT);
SetIndexBuffer(0,MA1_Buffer);

SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_DOT);
SetIndexBuffer(1,MA2_Buffer);
//---- indicators
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

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

int limit=Bars-counted_bars;
if(counted_bars>0) limit++;

for(int i=1; i<limit; i++)
{
MA1=iMA(NULL,0,MA1_Period,0,MA_Method,PRICE_CLOSE,i);
MA2=iMA(NULL,0,MA2_Period,0,MA_Method,PRICE_CLOSE,i);

MA1_Buffer=MA1;
MA2_Buffer=MA2;
}
//----

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

simplegreen

08/30/13 5:12 PM

#121816 RE: Qui-Gon Kagi #121814

OK Qui...just posted the script for you.I did a little indie building quite some time ago but it escapes me on what the process is now so I'm no help in that department.This version of the Ma_Shade is excellent so I think you will really like it