Tracer les niveaux symboliques

Forum d'entraide ProRealTime : prise en main, réglages, indicateurs, programmation ProBuilder et ProOrder, astuces entre utilisateurs de la plateforme.
TT32

Tracer les niveaux symboliques

Message non lu par TT32 »

Bonsoir,

Après avoir chercher sur Prorealcode sans trouver et passer des heures à tracer mes niveaux symboliques à la main
J'ai fais un petit indicateur qui marche avec une simple boucle
Ça donne ça :

Image

Le défaut : il détecte automatiquement les indices selon le prix
Dow (20000-30000)
Dax (9000-15000)
Cac (4000-6000)

à modifier ou ajouter comme vous le souhaitez c'est très simple ! :top:

Code : #

// Lignes tous les 100 points

x = 0

// Cac 40
if close>4000 and close<6000 then
While Not(x>6000) Do
x = x +100
DRAWHLINE(x) COLOURED(117, 0, 158)
If x > 6000 then
Break
Endif
Wend
endif

// Dax 30
if close>9000 and close<15000 then
While Not(x>15000) Do
x = x +100
DRAWHLINE(x) COLOURED(117, 0, 158)
If x > 15000 then
Break
Endif
Wend
endif

// Dow Jones
if close>20000 and close<30000 then
While Not(x>30000) Do
x = x +100
DRAWHLINE(x) COLOURED(117, 0, 158)
If x > 30000 then
Break
Endif
Wend
endif



// Lignes tous les 250 points

y = 0

// Cac 40
if close>4000 and close<6000 then
While Not(y>6000) Do
y = y +250
DRAWHLINE(y-0.1) COLOURED(117, 0, 158)
DRAWHLINE(y) COLOURED(117, 0, 158)
DRAWHLINE(y+0.1) COLOURED(117, 0, 158)
If y > 6000 then
Break
Endif
Wend
endif

// Dax 30
if close>9000 and close<15000 then
While Not(y>15000) Do
y = y +250
DRAWHLINE(y-0.2) COLOURED(117, 0, 158)
DRAWHLINE(y) COLOURED(117, 0, 158)
DRAWHLINE(y+0.2) COLOURED(117, 0, 158)
If y > 15000 then
Break
Endif
Wend
endif

// Dow Jones
if close>20000 and close<30000 then
While Not(y>30000) Do
y = y +250
DRAWHLINE(y-0.3) COLOURED(117, 0, 158)
DRAWHLINE(y) COLOURED(117, 0, 158)
DRAWHLINE(y+0.3) COLOURED(117, 0, 158)
If y > 30000 then
Break
Endif
Wend
endif

RETURN
TT32

Re: Tracer les niveaux symboliques

Message non lu par TT32 »

à ne pas afficher sur le graphique en ticks :!:
J'ai remarquer que ça fait énormément ralentir les performances du pc, car la boucle est calculée à chaque clôture de bougie!
Je préfère l'afficher en 5minutes
Je vais trouver un moyen de réduire ce problème :top:
Avatar du membre
Francis1
Le Sage
Messages : 30212
Enregistré le : 20 mars 2019 15:50

Re: Tracer les niveaux symboliques

Message non lu par Francis1 »

:merci: , Il y a quelque temps, je crois que j'avais un indicateur qui l'a fait, je vais le chercher.
TT32

Re: Tracer les niveaux symboliques

Message non lu par TT32 »

Update
Tout simple, j'ai simplement ajouter un if intradaybarindex=0 pour qu'il ne calcul qu'au moment de la première bougie de la journée et plus de problème de performances :top:

Code : #

// Lignes tous les 100 points

 if intradaybarindex=0 then

x = 0

// Cac 40
if close>4000 and close<6000 then
While Not(x>6000) Do
x = x +100
DRAWHLINE(x) COLOURED(117, 0, 158)
If x > 6000 then
Break
Endif
Wend
endif

// Dax 30
if close>9000 and close<15000 then
While Not(x>15000) Do
x = x +100
DRAWHLINE(x) COLOURED(117, 0, 158)
If x > 15000 then
Break
Endif
Wend
endif

// Dow Jones
if close>20000 and close<30000 then
While Not(x>30000) Do
x = x +100
DRAWHLINE(x) COLOURED(117, 0, 158)
If x > 30000 then
Break
Endif
Wend
endif

// Nasdaq
if close>6000 and close<8500 then
While Not(x>8500) Do
x = x +100
DRAWHLINE(x) COLOURED(117, 0, 158)
If x > 8500 then
Break
Endif
Wend
endif



// Lignes tous les 250 points

y = 0

// Cac 40
if close>4000 and close<6000 then
While Not(y>6000) Do
y = y +250
DRAWHLINE(y-0.1) COLOURED(117, 0, 158)
DRAWHLINE(y) COLOURED(117, 0, 158)
DRAWHLINE(y+0.1) COLOURED(117, 0, 158)
If y > 6000 then
Break
Endif
Wend
endif

// Dax 30
if close>9000 and close<15000 then
While Not(y>15000) Do
y = y +250
DRAWHLINE(y-0.2) COLOURED(117, 0, 158)
DRAWHLINE(y) COLOURED(117, 0, 158)
DRAWHLINE(y+0.2) COLOURED(117, 0, 158)
If y > 15000 then
Break
Endif
Wend
endif

// Dow Jones
if close>20000 and close<30000 then
While Not(y>30000) Do
y = y +250
DRAWHLINE(y-0.3) COLOURED(117, 0, 158)
DRAWHLINE(y) COLOURED(117, 0, 158)
DRAWHLINE(y+0.3) COLOURED(117, 0, 158)
If y > 30000 then
Break
Endif
Wend
endif

// Dow Jones
if close>6000 and close<8500 then
While Not(y>8500) Do
y = y +250
DRAWHLINE(y-0.3) COLOURED(117, 0, 158)
DRAWHLINE(y) COLOURED(117, 0, 158)
DRAWHLINE(y+0.3) COLOURED(117, 0, 158)
If y > 8500 then
Break
Endif
Wend
endif

 endif

RETURN
Ano782345

Re: Tracer les niveaux symboliques

Message non lu par Ano782345 »

Merci, :top: c'est ce que je cherchais, juste changer 500 à la place de 100 ce qui donne les niveaux 250, 500, 1000

Code : #

// Lignes tous les 500 points

if intradaybarindex=0 then

x = 0

// Cac 40
if close>4000 and close<6000 then
While Not(x>6000) Do
x = x +500
DRAWHLINE(x) COLOURED(117, 0, 158)
If x > 6000 then
Break
Endif
Wend
endif

// Dax 30
if close>9000 and close<15000 then
While Not(x>15000) Do
x = x +500
DRAWHLINE(x) COLOURED(117, 0, 158)
If x > 15000 then
Break
Endif
Wend
endif

// Dow Jones
if close>20000 and close<30000 then
While Not(x>30000) Do
x = x +500
DRAWHLINE(x) COLOURED(117, 0, 158)
If x > 30000 then
Break
Endif
Wend
endif

// Nasdaq
if close>6000 and close<8500 then
While Not(x>8500) Do
x = x +500
DRAWHLINE(x) COLOURED(117, 0, 158)
If x > 8500 then
Break
Endif
Wend
endif



// Lignes tous les 250 points

y = 0

// Cac 40
if close>4000 and close<6000 then
While Not(y>6000) Do
y = y +250
DRAWHLINE(y-0.1) COLOURED(117, 0, 158)
DRAWHLINE(y) COLOURED(117, 0, 158)
DRAWHLINE(y+0.1) COLOURED(117, 0, 158)
If y > 6000 then
Break
Endif
Wend
endif

// Dax 30
if close>9000 and close<15000 then
While Not(y>15000) Do
y = y +250
DRAWHLINE(y-0.2) COLOURED(117, 0, 158)
DRAWHLINE(y) COLOURED(117, 0, 158)
DRAWHLINE(y+0.2) COLOURED(117, 0, 158)
If y > 15000 then
Break
Endif
Wend
endif

// Dow Jones
if close>20000 and close<30000 then
While Not(y>30000) Do
y = y +250
DRAWHLINE(y-0.3) COLOURED(117, 0, 158)
DRAWHLINE(y) COLOURED(117, 0, 158)
DRAWHLINE(y+0.3) COLOURED(117, 0, 158)
If y > 30000 then
Break
Endif
Wend
endif

// Dow Jones
if close>6000 and close<8500 then
While Not(y>8500) Do
y = y +250
DRAWHLINE(y-0.3) COLOURED(117, 0, 158)
DRAWHLINE(y) COLOURED(117, 0, 158)
DRAWHLINE(y+0.3) COLOURED(117, 0, 158)
If y > 8500 then
Break
Endif
Wend
endif

endif

RETURN

par contre en 100 ticks j'ai trois lignes par niveau a la plage d'une pas bien gênant
TT32

Re: Tracer les niveaux symboliques

Message non lu par TT32 »

Pour ce problème il faut regarder sur la doc du côté des indicateurs multitime frame, j'avais réussi à faire ce dont tu parles à l'époque avec un système de filtre de type : if bar > 5minutes then (affiche plusieurs lignes) / if not (affiche qu'une ligne)
je l'ai malheureusement enlever et le retrouve plus