NexusFi: Find Your Edge


Home Menu

 





DIVERGENCE


Discussion in EasyLanguage Programming

Updated
    1. trending_up 4,540 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 BBJAP 
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;


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
April 2026 Jobs Report: +115k vs +65k Expected
Traders Hideout
TradingView Deploys AI to Monitor SEC Filings in Real Ti …
TradingView
Netherlands & Germany Surge as World Cup Field Narro …
Prediction Markets & Event Contracts
Iran Forward Curve: June 30 at 56% vs June 15 at 28% -- …
Prediction Markets & Event Contracts
Orban at 29pct as Hungary Votes Tomorrow -- McIlroy Surg …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
197 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
BERN ALGOS algo trading journal
8 thanks
Volume Indicators
8 thanks
  #3 (permalink)
 Itchymoku 
Philadelphia
 
Experience: None
Platform: corded black telephone
Trading: ticker tape
Posts: 2,892 since Apr 2012
Thanks Given: 1,683
Thanks Received: 3,681


I see a few times

anyways, you might want to try https://nexusfi.com/hire-consultant-programmer/


R.I.P. Joseph Bach (Itchymoku), 1987-2018.
Please visit this thread for more information.
Reply With Quote




Last Updated on October 3, 2013


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts