SAINT RAPHAEL FRANCE
Experience: Advanced
Platform: TRADESTATION
Trading: FUTURE
Posts: 2 since Oct 2013
Thanks Given: 0
Thanks Received: 0
|
I have a simple indicator divergence written in easy language (see file
attached)
It distinguishes and trace High Low on courses that are not accompanied by High Low on indicator
I'd like to turn this indicator to detect the so-called Hidden differences or otherwise
That is to say:
High Low on the indicator that are not accompanied
by High Low on courses
Looking for someone to do this work (of course pay for this work)
Do you have a name?
BBJAP
{DIVERGENCES macd}
inputsrice(Close),FastMA(9),SlowMA(19),MacdMA(6),Tracage(1),Maxbarres(50);
vars:div1(0);
vars:croise(0);
vars:continue(0);
vars:achat(0),vente(0),valmacd(0),avgmacd(0);
vars:limite(10),indice(0),max(0),depart(0),sommet(0);
varsoint1(0),point2(0),maxsommet(0);
vars:nb_hausse(0),nb_baisse(0);
array:croise_hausse[110](0);
array:croise_baisse[110](0);
array:cours_hausse[110](0);
array:cours_baisse[110](0);
array:barre_baisse[110](0);
array:barre_hausse[110](0);
achat=0;
vente=0;
croise=0;
maxsommet=30;
if (currentbar<=1) then
begin
nb_hausse=0;
nb_baisse=0;
end
else
begin
for indice=1 to nb_hausse
begin
barre_hausse[indice]=barre_hausse[indice]+1;
end;
for indice=1 to nb_baisse
begin
barre_baisse[indice]=barre_baisse[indice]+1;
end;
valmacd=macd(price,FastMA,SlowMA);
avgmacd=xaverage(valmacd,MacdMA);
if (valmacd>avgmacd) and (valmacd[1]<avgmacd[1]) then
begin
nb_hausse=nb_hausse+1;
if (nb_hausse>maxsommet) then
begin
for indice=1 to maxsommet
begin
croise_hausse[indice]=croise_hausse[indice+1];
cours_hausse[indice]=cours_hausse[indice+1];
barre_hausse[indice]=barre_hausse[indice+1];
nb_hausse=maxsommet;
end;
end;
if (valmacd[2]>valmacd[1]) and (valmacd>valmacd[1]) then indice=1
else indice=swinglowbar(1,valmacd,2,20);
if (indice>0) then
begin
croise_hausse[nb_hausse]=valmacd[indice];
indice=lowestbar(low,10);
cours_hausse[nb_hausse]=low[indice];
barre_hausse[nb_hausse]=indice;
sommet=indice;
end;
croise=1;
end;
if (valmacd<avgmacd) and (valmacd[1]>avgmacd[1]) then
begin
nb_baisse=nb_baisse+1;
if (nb_baisse>maxsommet) then
begin
for indice=1 to maxsommet
begin
croise_baisse[indice]=croise_baisse[indice+1];
cours_baisse[indice]=cours_baisse[indice+1];
barre_baisse[indice]=barre_baisse[indice+1];
nb_baisse=maxsommet;
end;
end;
if (valmacd[2]<valmacd[1]) and (valmacd<valmacd[1]) then indice=1
else indice=swinghighbar(1,valmacd,2,20);
if (indice>0) then
begin
croise_baisse[nb_baisse]=valmacd[indice];
indice=highestbar(high,10);
cours_baisse[nb_baisse]=high[indice];
barre_baisse[nb_baisse]=indice;
sommet=indice;
end;
croise=-1;
end;
if (valmacd<valmacd[1]) and (valmacd[1]>valmacd[2]) and (nb_baisse>1)
then
begin
continue=1;
indice=nb_baisse;
while (continue=1)
begin
if (barre_baisse[indice]>maxbarres) then
begin
continue=0;
indice=0;
end
else
begin
if (croise_baisse[indice]>valmacd[1]) then continue=0
else
begin
indice=indice-1;
if (indice<1) then
begin
continue=0;
indice=0;
end;
end;
end;
end;
if (indice>0) then
begin
sommet=highestbar(high,5);
if (cours_baisse[indice]<=high[sommet])and (sommet<barre_baisse[indice]) then
begin
vente=1;
depart=indice;
point2=barre_baisse[depart];
end;
end;
end;
if (valmacd>valmacd[1]) and (valmacd[1]<valmacd[2]) and (nb_hausse>1)
then
begin
continue=1;
indice=nb_hausse;
while (continue=1)
begin
if (barre_hausse[indice]>maxbarres) then
begin
continue=0;
indice=0;
end
else
begin
if (croise_hausse[indice]<valmacd[1]) then continue=0
else
begin
indice=indice-1;
if (indice<1) then
begin
continue=0;
indice=0;
end;
end;
end;
end;
if (indice>0) then
begin
sommet=lowestbar(low,5);
if (cours_hausse[indice]>low[sommet])and (sommet<barre_hausse[indice]) then
begin
achat=1;
depart=indice;
point2=barre_hausse[depart];
end;
end;
end;
vars:retour(0);
if (vente=0) and (valmacd<valmacd[1]) then
begin
value60=0;
value61=0;
retour=swinghighbar(1,valmacd,2,20);
if (retour>2) and (retour<7) then
begin
if (valmacd<valmacd[retour]) and (high>high[retour]) then
begin
vente=1;
depart=indice;
sommet=0;
point2=retour;
end;
end;
end;
if (achat=0) and (valmacd>valmacd[1]) then
begin
retour=swinglowbar(1,valmacd,2,20);
if (retour>2)and (retour<7) then
begin
if (valmacd>valmacd[retour]) and (low<low[retour]) then
begin
achat=1;
depart=indice;
sommet=0;
point2=retour;
end;
end;
end;
div1=0;
if (achat=1) then
begin
div1=1;
if (Tracage=1) then
begin
if (time[point2]<>time[sommet])
then begin
value11=TL_New (Date[point2], Time[point2], low[point2], Date[sommet], Time[sommet], low[sommet]);
TL_SetStyle(value11, tool_solid);
TL_SetSize(value11,1) ;
TL_SetColor(value11,green);
end;
end;
end;
if (vente=1) then
begin
div1=-1;
if (Tracage=1) then
begin
if (time[point2]<>time[sommet])
then begin
value11=TL_New (Date[point2], Time[point2], high[point2], Date[sommet], Time[sommet], high[sommet]);
TL_SetStyle(value11, tool_solid);
TL_SetSize(value11,1) ;
TL_SetColor(value11,red);
end;
end;
end;
end;
|