Search This Blog

Sunday

DiNapoli's indicators

DinapoliTargets - Objectives DiNapoli

Objectives DiNapoli

Indicator for MT4

//+------------------------------------------------------------------+ //+----------------------------------------------- -------------------+
//| DinapoliTargets.mq4 | / / | DinapoliTargets.mq4 |
//| mishanya_fx@yahoo.com | / / | Mishanya_fx@yahoo.com |
//| | / / | |
//+------------------------------------------------------------------+ //+----------------------------------------------- -------------------+

#property copyright "mishanya" # property copyright "mishanya"
#property link "mishanya_fx@yahoo.com" # property link "mishanya_fx@yahoo.com"

#property indicator_chart_window # property indicator_chart_window
#property indicator_buffers 1 # property indicator_buffers 1
#property indicator_color1 Blue # property indicator_color1 Blue
//---- input parameters //---- Input parameters
extern int barn=300; extern int barn = 300;
extern int Length=6; extern int Length = 6;
//---- buffers //---- Buffers
double ExtMapBuffer1[]; double ExtMapBuffer1 [];
//double ExtMapBuffer2[]; / / double ExtMapBuffer2 [];
//+------------------------------------------------------------------+ //+----------------------------------------------- -------------------+
//| Custom indicator initialization function | / / | Custom indicator initialization function |
//+------------------------------------------------------------------+ //+----------------------------------------------- -------------------+
int init() int init ()
{ (
//---- indicators //---- Indicators
SetIndexEmptyValue(0,0.0); SetIndexEmptyValue (0,0.0);
//SetIndexDrawBegin(0, barn); / / SetIndexDrawBegin (0, barn);
//SetIndexStyle(0,DRAW_SECTION); / / SetIndexStyle (0, DRAW_SECTION);
SetIndexBuffer(0,ExtMapBuffer1); SetIndexBuffer (0, ExtMapBuffer1);

//----
return(0); return (0);
} )
//+------------------------------------------------------------------+ //+----------------------------------------------- -------------------+
//| Custor indicator deinitialization function | / / | Custor indicator deinitialization function |
//+------------------------------------------------------------------+ //+----------------------------------------------- -------------------+
int deinit() int deinit ()
{ (

ObjectDelete("Start line"); ObjectDelete ( "Start line");
ObjectDelete("Stop line"); ObjectDelete ( "Stop line");
ObjectDelete("Target1 line"); ObjectDelete ( "Target1 line");
ObjectDelete("Target2 line"); ObjectDelete ( "Target2 line");
ObjectDelete("Target3 line"); ObjectDelete ( "Target3 line");
return(0); return (0);
} )
//+------------------------------------------------------------------+ //+----------------------------------------------- -------------------+
//| Custom indicator iteration function | / / | Custom indicator iteration function |
//+------------------------------------------------------------------+ //+----------------------------------------------- -------------------+
int start() int start ()
{ (
int counted_bars=IndicatorCounted(); int counted_bars = IndicatorCounted ();
int shift,Swing,Swing_n,uzl,i,zu,zd,mv; int shift, Swing, Swing_n, uzl, i, zu, zd, mv;
double PointA,PointB,PointC,Target1,Target2,Target3,Fantnsy,CrazyDream,Start,Stop; double PointA, PointB, PointC, Target1, Target2, Target3, Fantnsy, CrazyDream, Start, Stop;
double LL,HH,BH,BL,NH,NL; double LL, HH, BH, BL, NH, NL;
double Uzel[10000][3]; double Uzel [10000] [3];
string text; string text;
// loop from first bar to current bar (with shift=0) / / Loop from first bar to current bar (with shift = 0)
Swing_n=0;Swing=0;uzl=0; Swing_n = 0; Swing = 0; uzl = 0;
BH =High[barn];BL=Low[barn];zu=barn;zd=barn; BH = High [barn]; BL = Low [barn]; zu = barn; zd = barn;

for (shift=barn;shift>=0;shift--) { for (shift = barn; shift> = 0; shift -) (
LL=10000000;HH=-100000000; LL = 10000000; HH =- 100000000;
for (i=shift+Length;i>=shift+1;i--) { for (i = shift + Length; i> = shift +1; i -) (
if (Low[i]< ll="Low[i];} if (Low [i]
if (High[i]>HH) {HH=High[i];} if (High [i]> HH) (HH = High [i];)
} )


if (Low[shift] if (Low [shift] HH){ HH) (
Swing=2; Swing = 2;
if (Swing_n==1) {zu=shift+1;} if (Swing_n == 1) (zu = shift +1;)
if (Swing_n==-1) {zd=shift+1;} if (Swing_n ==- 1) (zd = shift +1;)
} else { ) Else (
if (Low[shift] if (Low [shift]
if (High[shift]>HH) {Swing=1;} if (High [shift]> HH) (Swing = 1;)
} )

if (Swing!=Swing_n && Swing_n!=0) { if (Swing! = Swing_n & & Swing_n! = 0) (
if (Swing==2) { if (Swing == 2) (
Swing=-Swing_n;BH = High[shift];BL = Low[shift]; Swing =- Swing_n; BH = High [shift]; BL = Low [shift];
} )
uzl=uzl+1; uzl = uzl +1;
if (Swing==1) { if (Swing == 1) (
Uzel[uzl][1]=zd; Uzel [uzl] [1] = zd;
Uzel[uzl][2]=BL; Uzel [uzl] [2] = BL;
} )
if (Swing==-1) { if (Swing ==- 1) (
Uzel[uzl][1]=zu; Uzel [uzl] [1] = zu;
Uzel[uzl][2]=BH; Uzel [uzl] [2] = BH;
} )
BH = High[shift]; BH = High [shift];
BL = Low[shift]; BL = Low [shift];
} )

if (Swing==1) { if (Swing == 1) (
if (High[shift]>=BH) {BH=High[shift];zu=shift;}} if (High [shift]> = BH) (BH = High [shift]; zu = shift;))
if (Swing==-1) { if (Swing ==- 1) (
if (Low[shift]<=BL) {BL=Low[shift]; zd=shift;}} if (Low [shift] <= BL) (BL = Low [shift]; zd = shift;))
Swing_n=Swing; Swing_n = Swing;
} )
for (i=1;i<=uzl;i++) { for (i = 1; i <= uzl; i + +) (
//text=DoubleToStr(Uzel[i][1],0); / / text = DoubleToStr (Uzel [i] [1], 0);
//text=; / / text =;
mv=StrToInteger(DoubleToStr(Uzel[i][1],0)); mv = StrToInteger (DoubleToStr (Uzel [i] [1], 0));
//ExtMapBuffer1[mv]=Uzel[i][2]; / / ExtMapBuffer1 [mv] = Uzel [i] [2];
} )

PointA = Uzel[uzl-2][2]; PointA = Uzel [uzl-2] [2];
PointB = Uzel[uzl-1][2]; PointB = Uzel [uzl-1] [2];
PointC = Uzel[uzl][2]; PointC = Uzel [uzl] [2];

Comment(PointA," ",PointB," ",PointC); Comment (PointA, "", PointB, "", PointC);

Target1=NormalizeDouble((PointB-PointA)*0.618+PointC,4); Target1 = NormalizeDouble ((PointB-PointA) * 0.618 + PointC, 4);
Target2=PointB-PointA+PointC; Target2 = PointB-PointA + PointC;
Target3=NormalizeDouble((PointB-PointA)*1.618+PointC,4); Target3 = NormalizeDouble ((PointB-PointA) * 1.618 + PointC, 4);
Fantnsy=NormalizeDouble((PointB-PointA)*2.618+PointC,4); Fantnsy = NormalizeDouble ((PointB-PointA) * 2.618 + PointC, 4);
CrazyDream=NormalizeDouble((PointB-PointA)*4.618+PointC,4); CrazyDream = NormalizeDouble ((PointB-PointA) * 4.618 + PointC, 4);
if (PointB if (PointB
{ (
Start= NormalizeDouble((PointB-PointA)*0.318+PointC,4)-(Ask-Bid); Start = NormalizeDouble ((PointB-PointA) * 0.318 + PointC, 4) - (Ask-Bid);
Stop=PointC+2*(Ask-Bid); Stop = PointC +2 * (Ask-Bid);
} )
if (PointB>PointC) if (PointB> PointC)
{ (
Start= NormalizeDouble((PointB-PointA)*0.318+PointC,4)+(Ask-Bid); Start = NormalizeDouble ((PointB-PointA) * 0.318 + PointC, 4) + (Ask-Bid);
Stop=PointC-2*(Ask-Bid); Stop = PointC-2 * (Ask-Bid);
} )


if (ObjectFind("Start Line") != 0) if (ObjectFind ( "Start Line")! = 0)
{ (
ObjectCreate("Start line",OBJ_HLINE,0,Time[0],Start); ObjectCreate ( "Start line", OBJ_HLINE, 0, Time [0], Start);
ObjectSet("Start line",OBJPROP_COLOR,Honeydew); ObjectSet ( "Start line", OBJPROP_COLOR, Honeydew);
ObjectSet("Start line",OBJPROP_WIDTH,1); ObjectSet ( "Start line", OBJPROP_WIDTH, 1);
ObjectSet("Start line",OBJPROP_STYLE,STYLE_DOT); ObjectSet ( "Start line", OBJPROP_STYLE, STYLE_DOT);
} )
else
{ (
ObjectMove("Start line", 0,Time[0],Start); ObjectMove ( "Start line", 0, Time [0], Start);
} )

if (ObjectFind("Stop Line") != 0) if (ObjectFind ( "Stop Line")! = 0)
{ (
ObjectCreate("Stop line",OBJ_HLINE,0,Time[0],Stop); ObjectCreate ( "Stop line", OBJ_HLINE, 0, Time [0], Stop);
ObjectSet("Stop line",OBJPROP_COLOR,Red); ObjectSet ( "Stop line", OBJPROP_COLOR, Red);
ObjectSet("Stop line",OBJPROP_WIDTH,1); ObjectSet ( "Stop line", OBJPROP_WIDTH, 1);
ObjectSet("Stop line",OBJPROP_STYLE,STYLE_DOT); ObjectSet ( "Stop line", OBJPROP_STYLE, STYLE_DOT);
} )
else
{ (
ObjectMove("Stop line", 0,Time[0],Stop); ObjectMove ( "Stop line", 0, Time [0], Stop);
} )

if (ObjectFind("Target1 Line") != 0) if (ObjectFind ( "Target1 Line")! = 0)
{ (
ObjectCreate("Target1 line",OBJ_HLINE,0,Time[0],Target1); ObjectCreate ( "Target1 line", OBJ_HLINE, 0, Time [0], Target1);
ObjectSet("Target1 line",OBJPROP_COLOR,Green); ObjectSet ( "Target1 line", OBJPROP_COLOR, Green);
ObjectSet("Target1 line",OBJPROP_WIDTH,1); ObjectSet ( "Target1 line", OBJPROP_WIDTH, 1);
ObjectSet("Target1 line",OBJPROP_STYLE,STYLE_DOT); ObjectSet ( "Target1 line", OBJPROP_STYLE, STYLE_DOT);
} )
else
{ (
ObjectMove("Target1 line", 0,Time[0],Target1); ObjectMove ( "Target1 line", 0, Time [0], Target1);
} )

if (ObjectFind("Target2 Line") != 0) if (ObjectFind ( "Target2 Line")! = 0)
{ (
ObjectCreate("Target2 line",OBJ_HLINE,0,Time[0],Target2); ObjectCreate ( "Target2 line", OBJ_HLINE, 0, Time [0], Target2);
ObjectSet("Target2 line",OBJPROP_COLOR,Yellow); ObjectSet ( "Target2 line", OBJPROP_COLOR, Yellow);
ObjectSet("Target2 line",OBJPROP_WIDTH,1); ObjectSet ( "Target2 line", OBJPROP_WIDTH, 1);
ObjectSet("Target2 line",OBJPROP_STYLE,STYLE_DOT); ObjectSet ( "Target2 line", OBJPROP_STYLE, STYLE_DOT);
} )
else
{ (
ObjectMove("Target2 line", 0,Time[0],Target2); ObjectMove ( "Target2 line", 0, Time [0], Target2);
} )

if (ObjectFind("Target3 Line") != 0) if (ObjectFind ( "Target3 Line")! = 0)
{ (
ObjectCreate("Target3 line",OBJ_HLINE,0,Time[0],Target3); ObjectCreate ( "Target3 line", OBJ_HLINE, 0, Time [0], Target3);
ObjectSet("Target3 line",OBJPROP_COLOR,DarkOrchid); ObjectSet ( "Target3 line", OBJPROP_COLOR, DarkOrchid);
ObjectSet("Target3 line",OBJPROP_WIDTH,1); ObjectSet ( "Target3 line", OBJPROP_WIDTH, 1);
ObjectSet("Target3 line",OBJPROP_STYLE,STYLE_DOT); ObjectSet ( "Target3 line", OBJPROP_STYLE, STYLE_DOT);
} )
else
{ (
ObjectMove("Target3 line", 0,Time[0],Target3); ObjectMove ( "Target3 line", 0, Time [0], Target3);
} )
return(0); return (0);
} )
//+------------------------------------------------------------------+ //+----------------------------------------------- -------------------+

Уровни Динаполи Din_fibo_high Dinapoli Levels Din_fibo_high

Одна из версий канала ДиНаполи One version of the channel DiNapoli



Индикатор под МТ4 Indicator for MT4
 //+------------------------------------------------------------------------------------+ //+----------------------------------------------- -------------------------------------+
//| Din_fibo_high.mq4 | / / | Din_fibo_high.mq4 |
//| unknown author, get from kaizer, conversed by Rosh | / / | Unknown author, get from kaizer, conversed by Rosh |
//| link to kaizer: http://forum.alpari-idc.ru/profile.php?mode=viewprofile&u=4196161 | / / | Link to kaizer: http://forum.alpari-idc.ru/profile.php?mode=viewprofile&u=4196161 |
//| http://forexsystems.ru/phpBB/index.php| / / | Http://forexsystems.ru/phpBB/index.php |
//+------------------------------------------------------------------------------------+ //+----------------------------------------------- -------------------------------------+

#property copyright "unknown author, get from kaizer, conversed by Rosh" # property copyright "unknown author, get from kaizer, conversed by Rosh"
#property link "http://forexsystems.ru/phpBB/index.php" # property link "http://forexsystems.ru/phpBB/index.php"

#property indicator_chart_window # property indicator_chart_window
#property indicator_buffers 2 # property indicator_buffers 2
#property indicator_color1 Blue # property indicator_color1 Blue
#property indicator_color2 Yellow # property indicator_color2 Yellow
//---- input parameters //---- Input parameters
extern int Ch_Period=3; extern int Ch_Period = 3;
extern double Ratio=0.786; extern double Ratio = 0.786;
extern bool SetAllBars=false; extern bool SetAllBars = false;
//---- buffers //---- Buffers
double ExtMapBuffer1[]; double ExtMapBuffer1 [];
double ExtMapBuffer2[]; double ExtMapBuffer2 [];
double tvBuffer[]; double tvBuffer [];
int hh,ll,first,counterPeriod; int hh, ll, first, counterPeriod;
double tv,MaH,MaL; double tv, MaH, MaL;
//+------------------------------------------------------------------+ //+----------------------------------------------- -------------------+
//| Проверим - разделитель диапазона или нет | / / | Check - separator band or not |
//+------------------------------------------------------------------+ //+----------------------------------------------- -------------------+
bool isDelimeter(int _Period, int _shift) bool isDelimeter (int _Period, int _shift)
{ (
bool result=false; Bool result = false;
//----
switch (_Period) Switch (_Period)
{ (
case 5:result=(TimeMinute(Time[_shift])==0)&&(TimeHour(Time[_shift])==0); break; case 5: result = (TimeMinute (Time [_shift]) == 0) & & (TimeHour (Time [_shift]) == 0); break;
case 15:result=(TimeMinute(Time[_shift])==0)&&(TimeHour(Time[_shift])==0); break; case 15: result = (TimeMinute (Time [_shift]) == 0) & & (TimeHour (Time [_shift]) == 0); break;
case 30:result=(TimeMinute(Time[_shift])==0)&&(TimeHour(Time[_shift])==0); break; case 30: result = (TimeMinute (Time [_shift]) == 0) & & (TimeHour (Time [_shift]) == 0); break;
case 60:result=(TimeMinute(Time[_shift])==0)&&(TimeHour(Time[_shift])==0); break; case 60: result = (TimeMinute (Time [_shift]) == 0) & & (TimeHour (Time [_shift]) == 0); break;
case 240:result=(TimeDayOfWeek(Time[_shift])==1)&&(TimeHour(Time[_shift])==0); break; case 240: result = (TimeDayOfWeek (Time [_shift]) == 1) & & (TimeHour (Time [_shift]) == 0); break;
case 1440:result=(TimeDay(Time[_shift])==1)||((TimeDay(Time[_shift])==2 && TimeDay(Time[_shift+1])!=1))||((TimeDay(Time[_shift])==3 && TimeDay(Time[_shift+1])!=2)); break; case 1440: result = (TimeDay (Time [_shift]) == 1 )||(( TimeDay (Time [_shift]) == 2 & & TimeDay (Time [_shift +1])! = 1 ))||(( TimeDay (Time [_shift]) == 3 & & TimeDay (Time [_shift +1])! = 2)); break;
case 10080:result=TimeDay(Time[_shift])<=7 && TimeMonth(Time[_shift])==1; break; case 10080: result = TimeDay (Time [_shift]) <= 7 & & TimeMonth (Time [_shift]) == 1; break;
default: Print("Недопустимый период!!!"); default: Print ( "Invalid time !!!");
} )
//----
return(result); Return (result);
} )
//+------------------------------------------------------------------+ //+----------------------------------------------- -------------------+
//| Установим MaH и MaL на границе диапазона | / / | Install MaH and on the border of the range MaL |
//+------------------------------------------------------------------+ //+----------------------------------------------- -------------------+
void SetHnL(int _shift) void SetHnL (int _shift)
{ (
//----
int i=_shift+1; Int i = _shift +1;
counterPeriod=0; CounterPeriod = 0;
while (counterPeriod While (counterPeriod
{ (
while (tvBuffer[i]==0.0 && i While (tvBuffer [i] == 0.0 & & i
counterPeriod++; CounterPeriod + +;
i++; I + +;
} )
i--; I -;
hh=Highest(NULL,0,MODE_HIGH,i-_shift,_shift+1); Hh = Highest (NULL, 0, MODE_HIGH, i-_shift, _shift +1);
ll=Lowest(NULL,0,MODE_LOW,i-_shift,_shift+1); Ll = Lowest (NULL, 0, MODE_LOW, i-_shift, _shift +1);
tv=NormalizeDouble((High[hh]+Low[ll]+Close[_shift+1])/3.0,Digits); tv = NormalizeDouble ((High [hh] + Low [ll] + Close [_shift +1]) / 3.0, Digits);
MaH=tv+NormalizeDouble((High[hh]-Low[ll])/2.0*Ratio,Digits); MaH = tv + NormalizeDouble ((High [hh]-Low [ll]) / 2.0 * Ratio, Digits);
MaL=tv-NormalizeDouble((High[hh]-Low[ll])/2.0*Ratio,Digits); MaL = tv-NormalizeDouble ((High [hh]-Low [ll]) / 2.0 * Ratio, Digits);
tvBuffer[_shift]=tv; TvBuffer [_shift] = tv;
ExtMapBuffer1[_shift]=MaH; ExtMapBuffer1 [_shift] = MaH;
ExtMapBuffer2[_shift]=MaL; ExtMapBuffer2 [_shift] = MaL;
SetMovingHnL(i, _shift); SetMovingHnL (i, _shift);

//----
return; Return;
} )
//+------------------------------------------------------------------+ //+----------------------------------------------- -------------------+
//| Установим MaH и MaL внутри диапазона | / / | Install MaH and MaL within the range |
//+------------------------------------------------------------------+ //+----------------------------------------------- -------------------+
void SetMovingHnL(int _DelimeterBar,int CurBar) void SetMovingHnL (int _DelimeterBar, int CurBar)
{ (
double delta; Double delta;
//----
delta=(tvBuffer[_DelimeterBar]-tvBuffer[CurBar])/(_DelimeterBar-CurBar); delta = (tvBuffer [_DelimeterBar]-tvBuffer [CurBar ])/(_ DelimeterBar-CurBar);
//----
return; Return;
} )
//+------------------------------------------------------------------+ //+----------------------------------------------- -------------------+
//| Установим MaH и MaL на правом краю | / / | Install MaH MaL and on the right side of |
//+------------------------------------------------------------------+ //+----------------------------------------------- -------------------+
void SetValuesNullBar(int _shift) void SetValuesNullBar (int _shift)
{ (
//----
int i=_shift; Int i = _shift;
while (tvBuffer[i]==0.0) i++; While (tvBuffer [i] == 0.0) i + +;
for (int j=i-1;j>_shift;j--) For (int j = i-1; j> _shift; j -)
{ (
ExtMapBuffer1[j]=0.0; ExtMapBuffer1 [j] = 0.0;
ExtMapBuffer2[j]=0.0; ExtMapBuffer2 [j] = 0.0;
} )
i=_shift; I = _shift;
counterPeriod=0; CounterPeriod = 0;
while (counterPeriod While (counterPeriod
{ (
while (tvBuffer[i]==0.0 && i While (tvBuffer [i] == 0.0 & & i
counterPeriod++; CounterPeriod + +;
i++; I + +;
} )
i--; I -;
hh=Highest(NULL,0,MODE_HIGH,i-_shift,_shift); Hh = Highest (NULL, 0, MODE_HIGH, i-_shift, _shift);
ll=Lowest(NULL,0,MODE_LOW,i-_shift,_shift); Ll = Lowest (NULL, 0, MODE_LOW, i-_shift, _shift);
tv=NormalizeDouble((High[hh]+Low[ll]+Close[_shift])/3.0,Digits); tv = NormalizeDouble ((High [hh] + Low [ll] + Close [_shift]) / 3.0, Digits);
MaH=tv+NormalizeDouble((High[hh]-Low[ll])/2.0*Ratio,Digits); MaH = tv + NormalizeDouble ((High [hh]-Low [ll]) / 2.0 * Ratio, Digits);
MaL=tv-NormalizeDouble((High[hh]-Low[ll])/2.0*Ratio,Digits); MaL = tv-NormalizeDouble ((High [hh]-Low [ll]) / 2.0 * Ratio, Digits);
ExtMapBuffer1[_shift]=MaH; ExtMapBuffer1 [_shift] = MaH;
ExtMapBuffer2[_shift]=MaL; ExtMapBuffer2 [_shift] = MaL;
//SetMovingHnL(j, _shift); / / SetMovingHnL (j, _shift);
//----
return; Return;
}//-------------------------------------------------------------------+ }//----------------------------------------------- --------------------+
//| Custom indicator initialization function | / / | Custom indicator initialization function |
//+------------------------------------------------------------------+ //+----------------------------------------------- -------------------+
int init() int init ()
{ (
//---- indicators //---- Indicators
IndicatorBuffers(3); IndicatorBuffers (3);
if (SetAllBars) If (SetAllBars)
{ (
SetIndexStyle(0,DRAW_LINE); SetIndexStyle (0, DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1); SetIndexBuffer (0, ExtMapBuffer1);
SetIndexLabel(0,"MaH"); SetIndexLabel (0, "MaH");
SetIndexEmptyValue(0,0.0); SetIndexEmptyValue (0,0.0);

SetIndexStyle(1,DRAW_LINE); SetIndexStyle (1, DRAW_LINE);
SetIndexBuffer(1,ExtMapBuffer2); SetIndexBuffer (1, ExtMapBuffer2);
SetIndexLabel(1,"MaL"); SetIndexLabel (1, "MaL");
SetIndexEmptyValue(1,0.0); SetIndexEmptyValue (1,0.0);
} )
else Else
{ (
SetIndexStyle(0,DRAW_SECTION); SetIndexStyle (0, DRAW_SECTION);
SetIndexBuffer(0,ExtMapBuffer1); SetIndexBuffer (0, ExtMapBuffer1);
SetIndexLabel(0,"MaH"); SetIndexLabel (0, "MaH");
SetIndexEmptyValue(0,0.0); SetIndexEmptyValue (0,0.0);

SetIndexStyle(1,DRAW_SECTION); SetIndexStyle (1, DRAW_SECTION);
SetIndexBuffer(1,ExtMapBuffer2); SetIndexBuffer (1, ExtMapBuffer2);
SetIndexLabel(1,"MaL"); SetIndexLabel (1, "MaL");
SetIndexEmptyValue(1,0.0); SetIndexEmptyValue (1,0.0);
} )

SetIndexBuffer(2,tvBuffer); SetIndexBuffer (2, tvBuffer);
SetIndexEmptyValue(2,0.0); SetIndexEmptyValue (2,0.0);

//----
return(0); Return (0);
} )
//+------------------------------------------------------------------+ //+----------------------------------------------- -------------------+
//| Custor indicator deinitialization function | / / | Custor indicator deinitialization function |
//+------------------------------------------------------------------+ //+----------------------------------------------- -------------------+
int deinit() int deinit ()
{ (
//----

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

//----
if (Period()==10080) return; If (Period () == 10080) return;
if (counted_bars<0)> If (counted_bars <0)>
if (counted_bars>0) limit=Bars-counted_bars; If (counted_bars> 0) limit = Bars-counted_bars;
if (counted_bars==0) If (counted_bars == 0)
{ (
// найти первый и второй разделитель и установить limit / / Find the first and second divider and set the limit
cnt=Bars-1; Cnt = Bars-1;
while (!isDelimeter(Period(),cnt)) cnt--; While (! IsDelimeter (Period (), cnt)) cnt -;
first=cnt; First = cnt;
cnt--; Cnt -;
counterPeriod=0; CounterPeriod = 0;
while (counterPeriod While (counterPeriod
{ (
while (!isDelimeter(Period(),cnt)) cnt--; While (! IsDelimeter (Period (), cnt)) cnt -;
cnt--; Cnt -;
counterPeriod++; CounterPeriod + +;
} )
cnt++; Cnt + +;
hh=Highest(NULL,0,MODE_HIGH,first-cnt,cnt+1); hh = Highest (NULL, 0, MODE_HIGH, first-cnt, cnt +1);
ll=Lowest(NULL,0,MODE_LOW,first-cnt,cnt+1); Ll = Lowest (NULL, 0, MODE_LOW, first-cnt, cnt +1);
tv=NormalizeDouble((High[hh]+Low[ll]+Close[cnt+1])/3.0,Digits); tv = NormalizeDouble ((High [hh] + Low [ll] + Close [cnt +1]) / 3.0, Digits);
MaH=tv+NormalizeDouble((High[hh]-Low[ll])/2.0*Ratio,Digits); MaH = tv + NormalizeDouble ((High [hh]-Low [ll]) / 2.0 * Ratio, Digits);
MaL=tv-NormalizeDouble((High[hh]-Low[ll])/2.0*Ratio,Digits); MaL = tv-NormalizeDouble ((High [hh]-Low [ll]) / 2.0 * Ratio, Digits);
tvBuffer[cnt]=tv; TvBuffer [cnt] = tv;
ExtMapBuffer1[cnt]=MaH; ExtMapBuffer1 [cnt] = MaH;
ExtMapBuffer2[cnt]=MaL; ExtMapBuffer2 [cnt] = MaL;
limit=cnt-1; Limit = cnt-1;
} )
//----
for (int shift=limit;shift>=0;shift--) For (int shift = limit; shift> = 0; shift -)
{ (
if (isDelimeter(Period(),shift)) SetHnL(shift);// else SetMovingHnL(shift); if (isDelimeter (Period (), shift)) SetHnL (shift); / / else SetMovingHnL (shift);
if (shift==0) SetValuesNullBar(shift); If (shift == 0) SetValuesNullBar (shift);
} )

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

No comments: