Keith Watford
Keith Watford
4.9 (266)
  • Information
12+ years
experience
5
products
6
demo versions
400
jobs
0
signals
0
subscribers
Keith Watford
Published code Super Trend updated and simpler code
This is just another version of the well known Super Trend indicator. The code is simplified but it has the same output on the chart screen.
· 2 52282 6296
Keith Watford
Added topic Why has this signal/EA/Market product disappeared?????
If you can no longer access a product from MQL5, please understand that we are simply users here on the forum, we are not Admin and we cannot answer your questions. I do not understand why the Service desk keeps telling people to ask in the forum
Keith Watford
Keith Watford
Want an Indicator or Expert to your specifications in MQL4? Place a personal project at
https://www.mql5.com/en/job/new?prefered=Forexample
Keith Watford
Added topic Scalping
Comments that do not relate to the " Best Forex Scalping Robot ", have been moved into this topic
Keith Watford
Keith Watford
Want an Indicator or Expert to your specifications in MQL4? Place a personal project at
https://www.mql5.com/en/job/new?prefered=Forexample
Keith Watford
Added topic Rafael Grecco Strategy
Comments that do not relate to the " "Hedging" in Forex trading -Why do it? ", have been moved into this topic
Keith Watford
Added topic Cannot download purchased EA
Comments that do not relate to the " MT4 Indicator results to EA ", have been moved into this topic
Keith Watford
Added topic StrToTime() bug?
Hello, now I may just be missing something here.        string Begin=" 03 : 00 ";        string End=" 23 : 00 ";        Print ("Current Time = ", TimeCurrent
Keith Watford
Added topic Chinese??
Hi, I can't see if this has been covered already or maybe it is just me. Every section, including Freelance is currently flooded with Chinese. Is there a setting that I may have accidently changed
altzspec
[Deleted] 2018.04.13
It is all spam. Just ignore it.
Keith Watford
Added topic calculate the price scale range ( Max-Min)
Comments that do not relate to the " Please help with one trade per day code ", have been moved into this topic
6712812
6712812 2019.04.14
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Lime
#property indicator_color2 Red
#define SH_BUY 1
#define SH_SELL -1

//---- Âõîäíûå ïàðàìåòðû
extern int AllBars=0;//How many bars should be counted. 0 - all the bars.
extern int Otstup=17;//Step back.
extern double Per=13;//Period.
extern string 
Alert_Setting = "---------- Alert Setting";
extern bool 
EnableNativeAlerts = true;
extern string
SoundFilename = "alert.wav";

int SH,NB,i,UD,x=0,y=0,a=0,b=0;
double R,SHMax,SHMin;
double BufD[];
double BufU[];
//+------------------------------------------------------------------+
//| Ôóíêöèÿ èíèöèàëèçàöèè |
//+------------------------------------------------------------------+
int init()
{
//We will write the number of the bars for which we are counting to the NB
if (Bars<AllBars+Per || AllBars==0) NB=Bars-Per; else NB=AllBars;
IndicatorBuffers(2);
IndicatorShortName("SHI_SilverTrendSig");
SetIndexStyle(0,DRAW_ARROW,0,2);
SetIndexStyle(1,DRAW_ARROW,0,2);
SetIndexArrow(0,159);
SetIndexArrow(1,159);
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(0);
}
//+------------------------------------------------------------------+
//| Ôóíêöèÿ äåèíèöèàëèçàöèè |
//+------------------------------------------------------------------+
int deinit()
{
return(0);
}
//+------------------------------------------------------------------+
//| Ñîáñíà èíäèêàòîð |
//+------------------------------------------------------------------+
int start()
{
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(CBBars-CB) NB=Bars-CB;
for (SH=1;SH<NB;SH++)//comb out the chart from 1 to NB
{
for (R=0,i=SH;iSHMax-(SHMax-SHMin)*Otstup/100 && UD!=SH_BUY) { BufD[SH]=High[SH]+R*0.5; 
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;



}
else 


if (Close[SH]<SHMin+(SHMax-SHMin)*Otstup/100 && UD!=SH_SELL) { BufU[SH]=Low[SH]-R*0.5; 
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;

}
}

//----------------------- ALERT ON UP / DOWN DOT

if(EnableNativeAlerts)
{
string AlertComment;

if(UD==SH_BUY && x==1) Alert(Symbol(), " - ", "BUY - UP DIRECTION !");
if(UD==SH_BUY && x==1) Alert(AlertComment);
if(UD==SH_BUY && x==1) PlaySound(SoundFilename);
if(UD==SH_BUY && x==1) x=x+1;

if(UD==SH_SELL && y==1) Alert(Symbol(), " - ", "SELL - DOWN DIRECTION !"); 
if(UD==SH_SELL && y==1) Alert(AlertComment);
if(UD==SH_SELL && y==1) PlaySound(SoundFilename);
if(UD==SH_SELL && y==1) y=y+1;


}

//----------------------- END FUNCTION
return(0);
}



can u please explain part of the code pasted below and how the value of R is calculated and what is the meaning of (10+SH-i) in R equation,,, i want to understand its mathematical value..
what is the meaning of it R=0,i=SH;i<SH+10;i++...if u can do it .. it will be great help,,

(SH=1;SH<NB;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;
Keith Watford
Added topic What is going on in the Freelance section
I am discussing job details with a customer and posts are disappearing and random posts from someone else are appearing in their place. Just had a single post in Russian replace all the previous posts in the thread