indiTraders - Forum for the Active Indian Trader  

Go Back   indiTraders - Forum for the Active Indian Trader > Tools > Software > MetaTrader

GFDL
Reply
 
Bookmark and Share LinkBack (1) Thread Tools Display Modes
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 21-05-2013, 04:53 PM
Kreangast Kreangast is offline
Newbie
 
Join Date: Apr 2013
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Kreangast is on a distinguished road
Default Modify the MT4 indicators Thank you to!

Modify the MT4 indicators Thank you to!


#property indicator_chart_window
#property indicator_buffers 5
//---- input parameters
extern int TimeFramePeriod;
extern int N=100;
//
extern double CustoMA1;
extern double CustoMA2;
extern double CustoMA3;
extern double CustoMA4;
extern double high20;
extern double low20;
//
#property indicator_color1 Red
#property indicator_color2 Lime
#property indicator_color3 Orange
#property indicator_color4 Red
//--- buffers
double CustoMA1[];
double CustoMA2[];
double CustoMA3[];
double CustoMA4[];
double tr[];
//
int init() {
SetIndexStyle(0, DRAW_LINE);
SetIndexBuffer(0, CustoMA1);
SetIndexStyle(1, DRAW_LINE);
SetIndexBuffer(1, CustoMA2);
SetIndexStyle(2, DRAW_LINE);
SetIndexBuffer(2, CustoMA3);
SetIndexStyle(3, DRAW_LINE);
SetIndexBuffer(3, CustoMA4);
SetIndexStyle(4, DRAW_LINE);
SetIndexBuffer(4,tr);
return (0);
}
//---- buffers
double buff[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
//int init()
//{
//if (Bars < MIN_BARS_REQUIRED) return(-1);
//IndicatorDigits(Digits);
//SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2);
//SetIndexBuffer(0, buff);
//string paramDesc = "("+getPeriodDesc(TimeFramePeriod) + ", "")";
//IndicatorShortName("" + paramDesc);
// Set Index Labels
//SetIndexLabel(0, "" + paramDesc);
//----
//return(0);
}

//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int start()
{
int Limit;
int counted_bars=IndicatorCounted();
//----
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
int limit=Bars-counted_bars;
int i=0;
for (i=Mathmin(Bars-5,Limit);i>=0;i--);
tr[i]=MathMax(MathMax(High[i]-Low[i],MathAbs(Close[i+1]-High[i])),MathAbs(Close[i+1]-Low[i]));
higt20=H=HHV(H,N);
low20=L=LLV(L,N);
//
MA1=H-tr[i]*0.1;
MA2=H-tr[i]*0.2;
MA3=L+tr[i]*0.1;
MA4=L+tr[i]*0.2;
//
CustoMA1=REF(MA1,BarsSince(higt20));
CustoMA2=REF(MA2,BarsSince(higt20));
CustoMA3=REF(MA3,BarsSince(low20));
CustoMA4=REF(MA4,BarsSince(low20));
//
Plot(CustoMA1,"TREND",colorRed);
Plot(CustoMA2,"TREND",colorLime);
Plot(CustoMA3,"TREND",colorOrange);
Plot(CustoMA4,"TREND",colorRed);

//----
return(0);

//+------------------------------------------------------------------+
string getPeriodDesc(int aNumMinutes)
{
switch(aNumMinutes)
{
case PERIOD_M1 : return("M1");
case PERIOD_M15: return("M15");
case PERIOD_M30: return("M30");
case PERIOD_H1 : return("H1");
case PERIOD_H4 : return("H4");
case PERIOD_D1 : return("D1");
case PERIOD_W1 : return("W1");
case PERIOD_MN1: return("MN1");
case 0: return("Chart");
default: return("M" + aNumMinutes);
}
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
double getDeMarker(int aShift)
{
return(iDeMarker(NULL, TimeFramePeriod, 13, iBarShift(NULL, TimeFramePeriod, Time[aShift])));
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
for(int shift=Bars-1;shift>=0;shift--)
{
buff[shift]=getDeMarker(shift);
}
return(0);
}
//+------------------------------------------------------------------+

Sorry ! Paste the code here
Kreangast
2013/5/21
//AmiBroker Code...
CustoMA1=REF(MA1,BarsSince(higt20));
CustoMA2=REF(MA2,BarsSince(higt20));
CustoMA3=REF(MA3,BarsSince(low20));
CustoMA4=REF(MA4,BarsSince(low20));
//
Plot(CustoMA1,"TREND",colorRed);
Plot(CustoMA2,"TREND",colorLime);
Plot(CustoMA3,"TREND",colorOrange);
Plot(CustoMA4,"TREND",colorRed);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

indiTraders - Forum for the Active Indian Trader > Tools > Software > MetaTrader


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


LinkBacks (?)
LinkBack to this Thread: http://www.inditraders.com/metatrader/8275-modify-mt4-indicators-thank-you.html
Posted By For Type Date
indiTraders - Forum for the Active Indian Trader This thread Refback 14-04-2014 04:55 AM

GFDL

All times are GMT +5.5. The time now is 10:33 PM.


vBulletin Copyright by vBulletin

Content Relevant URLs by vBSEO 3.3.2