can someone please give me some information, or even help me out on this?
//+------------------------------------------------------------------+//| ProjectName |//| Copyright 2012, CompanyName |//| http://www.companyname.net |//+------------------------------------------------------------------+#property indicator chart_window
#property indicator buffers 2#property indicator color1 Lime
#property indicator color2 Red
#define SH BUY 1#define SH SELL -1//---- Входные параметрыexternint AllBars=0;//How many bars should be counted. 0 - all the bars.externint Otstup=17;//Step back.externint SigSize=3;//Step back.externdouble Per=13;//Period.externint Symbol_Sign=159;
externstring Alert_Setting="Alert Setting";
externbool EnableAlert=true;
externbool PushAlert=true;
externbool SoundAlert=true;
externstring SoundFilename="alert.wav";
string nm;
int SH,NB,i,UD,x=0,y=0,a=0,b=0;
double R,SHMax,SHMin;
double BufD[];
double BufU[];
//+------------------------------------------------------------------+//| Функция инициализации |//+------------------------------------------------------------------+intOnInit()
{
ObjectsDeleteAll();
//We will write the number of the bars for which we are counting to the NBif(Bars<AllBars+Per || AllBars==0)
NB=Bars-Per;
else
NB=AllBars;
IndicatorBuffers(2);
IndicatorShortName("Wave_Dots");
//SetIndexStyle(0,DRAW_ARROW,0,SigSize);//SetIndexStyle(1,DRAW_ARROW,0,SigSize);//SetIndexArrow(0,Symbol_Sign);//SetIndexArrow(1,Symbol_Sign);SetIndexBuffer(0,BufU);
SetIndexBuffer(1,BufD);
//SetIndexDrawBegin(0,Bars-NB);//This indicator will be shown for NB bar only//SetIndexDrawBegin(1,Bars-NB);//ArrayInitialize(BufD,0.0);//Give a lot of "zero" to the buffe. Otherwise it will be garbage during the changing of time frame.//ArrayInitialize(BufU,0.0);return INIT SUCCEEDED;
}
//+------------------------------------------------------------------+//| Собсна индикатор |//+------------------------------------------------------------------+intOnCalculate(constint rates_total, // размер входных таймсерийconstint prev_calculated, // обработано баров на предыдущем вызовеconstdatetime &time[], // Timeconstdouble &open[], // Openconstdouble &high[], // Highconstdouble &low[], // Lowconstdouble &close[], // Closeconstlong &tick_volume[], // Tick Volumeconstlong &volume[], // Real Volumeconstint &spread[] // Spread
)
{
int CB=IndicatorCounted();
/* It is the optimization option. We have the function here which restore/return the number of counted bars in very special way.
During the first indicator's call we have 0: it is normal because it was not counted anything,
and then we receive the number of bars minus 1. For example, if the number of bars equal 100,
we will have 99. I did it especially, you may see that NB is the number of bars whioch should be counted.
You know we may throw out this parameter. But for the people who understand we may keep it. So, during the first call
of indicator this NB is the same one but during the 2dn etc calls - reducing the value up to the last bar,
That is 1 or 2 for example*/if(CB<0)
return (-1);
elseif(NB>Bars-CB)
NB=Bars-CB;
for(SH=1; SH<MathMax(NB,2); SH++) //comb out the chart from 1 to NB
{
for(R=0,i=SH; i<SH+10; i++)
{
R+=(10+SH-i)*(High[i]-Low[i]);
}
R/=55;
SHMax = High[Highest(NULL,0,MODE HIGH,Per,SH)];
SHMin = Low[Lowest(NULL,0,MODE LOW,Per,SH)];
if(Close[SH]>SHMax-(SHMax-SHMin)*Otstup/100 && UD!=SH BUY)
{
BufD[SH]=High[SH]+R*0.5;
nm=DoubleToStr(Time[SH], 0);
if(ObjectFind(nm)<0)
{
ObjectCreate(nm, OBJ ARROW, 0, 0,0);
ObjectSet(nm, OBJPROP_TIME1, Time[SH]);
ObjectSet(nm, OBJPROP_PRICE1, BufD[SH]);
ObjectSet(nm, OBJPROP ARROWCODE, 242);
ObjectSet(nm, OBJPROP COLOR, clrRed);
ObjectSet(nm, OBJPROP WIDTH, 3);
}
if(Close[SH]>SHMax-(SHMax-SHMin)*Otstup/100 && UD!=SH BUY)
UD=SH BUY;
if(Close[SH]>SHMax-(SHMax-SHMin)*Otstup/100 && UD!=SH BUY)
y=0;//x=x+1;
}
elseif(Close[SH]<SHMin+(SHMax-SHMin)*Otstup/100 && UD!=SH SELL)
{
BufU[SH]=Low[SH]-R*0.5;
nm=DoubleToStr(Time[SH], 0);
if(ObjectFind(nm)<0)
{
ObjectCreate(nm, OBJ ARROW, 0, 0,0);
ObjectSet(nm, OBJPROP_TIME1, Time[SH]);
ObjectSet(nm, OBJPROP_PRICE1, BufU[SH]);
ObjectSet(nm, OBJPROP ARROWCODE, 241);
ObjectSet(nm, OBJPROP indicator color3 clrLime
ObjectSet(nm, OBJPROP WIDTH, 3);
}
if(Close[SH]<SHMin+(SHMax-SHMin)*Otstup/100 && UD!=SH SELL)
UD=SH SELL;
if(Close[SH]<SHMin+(SHMax-SHMin)*Otstup/100 && UD!=SH SELL)
x=0;//y=y+1;
}
}
string n=_Symbol;
datetime time0=iTime(n,0,0);
staticint next=0;
staticdatetime tm_bar=0;
if(tm_bar==0)
tm_bar=time0;
if(time0!=tm_bar)
{
next=0;
tm_bar=time0;
}
string text="";
if(BufU[1]!=EMPTY VALUE)
{
if(next!=1)
{
text=StringFormat("%s %s BUY - UP DIRECTION",TimeToString(TimeCurrent(),TIME MINUTES),n);
if(EnableAlert)
Alert(text);
if(PushAlert)
SendNotification(text);
if(SoundAlert)
PlaySound(SoundFilename);
next=1;
}
}
if(BufD[1]!=EMPTY VALUE)
{
if(next!=-1)
{
text=StringFormat("%s %s SELL - DOWN DIRECTION",TimeToString(TimeCurrent(),TIME MINUTES),n);
if(EnableAlert)
Alert(text);
if(PushAlert)
SendNotification(text);
if(SoundAlert)
PlaySound(SoundFilename);
next=-1;
}
}
return(0);
}
//+------------------------------------------------------------------+
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
can someone please give me some information, or even help me out on this?