Download TARZAN MT4 Indicator

Tarzan is a trend indicator based on moving averages and RSI.

Input parameters:

-Time Frame = 60; the period of the diagram can be any of the following sizes:

1 – 1 minute;
5 – 5 minutes;
15 – 15 minutes;
30 – 30 minutes;
60 – 1 hour;
240 – 4 hours;
1440 – 1 day;
10080 – 1 week;
43200 – 1 month;
0 (zero) – Period of the current chart.

-RSI=5; period of RSI indicator.

-Applied RSI=0; the used price. There can be any of price constants:

0 – Close price;
1 – Open price;
2 – High price;
3 – Low price;
4 – Average price, (high+low) /2;
5 – Typical price, (high+low+close) /3;
6 – Weighed price of closing, (high+low+close+close) /4.

-MA=50; period of Moving Average indicator.
-Method MA=0; – a method of averaging. Can be any of meanings(importance) of methods sliding average (Moving Average):

0 – Simple moving average;
1 – Exponentially smoothed moving average;
2 – Smoothed moving average;
3 – Linearly weighed moving average.

-Koridor = 5; a threshold of an envelope.

How To Trade With Tarzan:

Buy Signal: When Tarzan indicator (square) turns to green.

 

Sell Signal: When Tarzan indicator (square) turns to red.

 

[php]

//+——————————————————————+
//| TARZAN.mq4 |
//| Yuriy Tokman (YTG) |
//| [email protected] |
//+——————————————————————+
#property copyright “Yuriy Tokman (YTG)”
#property link “[email protected]

#property indicator_separate_window

#property indicator_buffers 6
#property indicator_color1 Yellow
#property indicator_color3 Aqua
#property indicator_color4 Aqua
#property indicator_color5 Lime
#property indicator_color6 Red
#property indicator_width1 3
#property indicator_level1 15.0
#property indicator_level2 85.0
//—-+
extern string EA_forex_FREE = “http://soft4forex.com”;
//—-+
extern int TimeFrame = 60;//دهًèîن مًàôèêà ىîوهٍ لûٍü ë‏لûى èç ٌëهنَ‏ùèُ âهëè÷èي:1 – 1 ىèيٍَà,5 – 5 ىèيٍَ, 15 – 15 ىèيٍَ, 30 – 30 ىèيٍَ, 60 – 1 ÷àٌ, 240 – 4 ÷àٌà, 1440 – 1 نهيü, 10080 – 1 يهنهëے, 43200 – 1 ىهٌےِ, 0(يîëü) – دهًèîن ٍهêَùهمî مًàôèêà
extern int RSI=5;//دهًèîن ًٌَهنيهيèے نëے âû÷èٌëهيèے èينهêٌà.
extern int applied_RSI=0;//بٌïîëüçَهىàے ِهيà. جîوهٍ لûٍü ë‏لîé èç ِهيîâûُ êîيٌٍàيٍ: 0 – ضهيà çàêًûٍèے, 1 – ضهيà îٍêًûٍèے, 2 – جàêٌèىàëüيàے ِهيà, 3 – جèيèىàëüيàے ِهيà, 4 – رًهنيےے ِهيà, (high+low)/2, 5 – زèïè÷يàے ِهيà, (high+low+close)/3, 6 – آçâهّهييàے ِهيà çàêًûٍèے, (high+low+close+close)/4
extern int MA=50;//دهًèîن ًٌَهنيهيèے نëے âû÷èٌëهيèے ٌêîëüçےùهمî ًٌهنيهمî.
extern int method_MA=0;//جهٍîن ًٌَهنيهيèے. جîوهٍ لûٍü ë‏لûى èç çيà÷هيèé ىهٍîنîâ ٌêîëüçےùهمî ًٌهنيهمî (Moving Average):0 – دًîٌٍîه ٌêîëüçےùهه ًٌهنيهه, 1 – فêٌïîيهيِèàëüيîه ٌêîëüçےùهه ًٌهنيهه, 2 – رمëàوهييîه ٌêîëüçےùهه ًٌهنيهه,3 – ثèيهéيî-âçâهّهييîه ٌêîëüçےùهه ًٌهنيهه
extern int koridor = 5;//دîًîم êîيâهًٍà
//—- buffers
double BU0[];
double BU1[];
double BU2[];
double BU3[];
double BU4[];
double BU5[];
//+——————————————————————+
//| Custom indicator initialization function |
//+——————————————————————+
int init()
{
//—- indicators
IndicatorShortName(“TARZAN “+GetNameTF(TimeFrame)+” “+RSI+”/”+MA);
SetIndexBuffer(0, BU0);
SetIndexStyle(0, DRAW_LINE);
SetIndexBuffer(1, BU1);
SetIndexStyle(1,DRAW_NONE);
//—-
SetIndexBuffer(2, BU2);
SetIndexStyle(2, DRAW_LINE);
SetIndexBuffer(3, BU3);
SetIndexStyle(3,DRAW_LINE);
//—-
SetIndexBuffer(4, BU4);
SetIndexStyle(4, DRAW_ARROW);
SetIndexArrow(4,110);

SetIndexBuffer(5, BU5);
SetIndexStyle(5,DRAW_ARROW);
SetIndexArrow(5,110);GetAvtor();
//—-
return(0);
}
//+——————————————————————+
//| Custom indicator deinitialization function |
//+——————————————————————+
int deinit()
{
//—-
GetDellName();
//—-
return(0);
}
//+——————————————————————+
//| Custom indicator iteration function |
//+——————————————————————+
int start()
{
//—-
int limit,b_sh;
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars–;
limit=Bars-counted_bars;GetYTG();
//—-
for(int i=0; i<limit; i++)
{
b_sh=iBarShift(Symbol(),TimeFrame,Time[i]);
BU0[i] = iRSI(Symbol(),TimeFrame,RSI,applied_RSI,b_sh);
}
//—-
int koef = 1;
if(TimeFrame>0)koef = TimeFrame/Period();
//—-
for(i=0; i<limit; i++)
{
BU1[i] = iMAOnArray(BU0,0,MA*koef,0,method_MA,i);
BU2[i] = iMAOnArray(BU0,0,MA*koef,0,method_MA,i)+koridor;
BU3[i] = iMAOnArray(BU0,0,MA*koef,0,method_MA,i)-koridor;
}
//—-
for(i=0; i<limit; i++){
if(BU0[i]>BU1[i]) BU4[i]= iMAOnArray(BU0,0,MA*koef,0,method_MA,i);
else BU5[i]= iMAOnArray(BU0,0,MA*koef,0,method_MA,i);
}
//—-
return(0);
}
//+——————————————————————+
string GetNameTF(int TimeFrame=0) {
if (TimeFrame==0) TimeFrame=Period();
switch (TimeFrame) {
case PERIOD_M1: return(“M1”);
case PERIOD_M5: return(“M5”);
case PERIOD_M15: return(“M15”);
case PERIOD_M30: return(“M30”);
case PERIOD_H1: return(“H1”);
case PERIOD_H4: return(“H4”);
case PERIOD_D1: return(“Daily”);
case PERIOD_W1: return(“Weekly”);
case PERIOD_MN1: return(“Monthly”);
default: return(“UnknownPeriod”);
}
}
//—-+
void GetYTG()
{
static int count = 0;
count++;if(count>2)count = 0;
color color_Y = Red;
color color_T = Lime;
color color_G = Blue;
if(count==1){color_Y = Crimson;color_T = LimeGreen;color_G = DodgerBlue;}
if(count==2){color_Y = OrangeRed;color_T = ForestGreen;color_G = RoyalBlue;}

Label(“ytg_Y”,”Y” ,3,40,20,25,”Arial Black”,color_Y);
Label(“ytg_T”,”T” ,3,25,5,25,”Arial Black”,color_T);
Label(“ytg_G”,”G” ,3,13,32,25,”Arial Black”,color_G);
}
//—-+
void Label(string name_label,string text_label,int corner = 2,int x = 3,int y = 15,int font_size = 10,string font_name = “Arial”,color text_color = LimeGreen )
{
if (ObjectFind(name_label)!=-1) ObjectDelete(name_label);
ObjectCreate(name_label,OBJ_LABEL,0,0,0,0,0);
ObjectSet(name_label,OBJPROP_CORNER,corner);
ObjectSet(name_label,OBJPROP_XDISTANCE,x);
ObjectSet(name_label,OBJPROP_YDISTANCE,y);
ObjectSetText(name_label,text_label,font_size,font_name,text_color);
}
//—-+
void GetDellName (string name_n = “ytg_”)
{
string vName;
for(int i=ObjectsTotal()-1; i>=0;i–)
{
vName = ObjectName(i);
if (StringFind(vName,name_n) !=-1) ObjectDelete(vName);
}
}
//—-+
void GetAvtor()
{
string char[256]; int i;
for (i = 0; i < 256; i++) char[i] = CharToStr(i);
string txtt =

char[69]+char[65]+char[32]+char[102]+char[111]+char[114]+char[101]+char[120]
+char[32]+char[70]+char[82]+char[69]+char[69]+char[58]+char[32]+char[104]
+char[116]+char[116]+char[112]+char[58]+char[47]+char[47]+char[115]+char[111]
+char[102]+char[116]+char[52]+char[102]+char[111]+char[114]+char[101]+char[120]
+char[46]+char[99]+char[111]+char[109];
Label(“label”,txtt,2,3,15,10);
}
//—-+

[/php]

Click Here to Download

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *