Disegnare Box relativo al Supertrend
- This topic has 5 replies, 2 voices, and was last updated 1 year ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
Similar topics:
Forums › ProRealTime forum Italiano › Supporto ProBuilder › Disegnare Box relativo al Supertrend
Buonasera a tutti,
vorrei chiedere cortesemente un aiuto per risolvere un problema che non riesco a risolvere:
creare un Box prendendo in esame il Supertrend.
In particolare se il Supertrend si “stabilizza” per almeno 5 candele vorrei disegnare un Box che abbia come base (o tetto) la linea del Supertend e come tetto (o base) il massimo (o minimo) della serie di candele in esame.
Grazie.
Allego esempio
Questo mi sembra vada bene:
1 2 3 4 5 6 7 |
myST = SuperTrend[2,10] IF summation[5](myST = myST[1]) = 5 THEN Upper = max(myST,highest[5](high)) Lower = min(myST,lowest[5](low)) DrawRectangle(BarIndex-4,Upper,BarIndex,Lower) coloured("Cyan",90) bordercolor("Red",0) ENDIF RETURN |
Molte grazie Roberto.
Se possibile vorrei chiederTi se puoi aggiornare il codice:
se il Supertrend rimane “stabile” per più di 5 candele il Box dovrebbe proseguire fino a quando il Supertrend non cambia inclinazione.
Il mio problema era questo cioè creare un ciclo che controllasse il Supertrend ad ogni candela.
Grazie
Scusa Roberto, ho provato a modificare il tuo codice ma non riesco a visualizzare il Box.
Per cortesia riesci a correggerlo?
Grazie.
Allego il codice
1 2 3 4 5 6 7 8 9 10 11 12 13 |
myST = SuperTrend[2,10] ONCE CONT = 1 IF summation[CONT](myST = myST[CONT]) THEN IF CONT >= 5 then Upper = max(myST,highest[CONT](high)) Lower = min(myST,lowest[CONT](low)) DrawRectangle(barindex-CONT,Upper,BarIndex,Lower) coloured("Cyan",90) bordercolor("Red",0) CONT = CONT + 1 ELSE CONT = CONT + 1 ENDIF ENDIF RETURN |
Ho riscritto il codice così:
1 2 3 4 5 6 7 8 9 10 11 12 |
myST = SuperTrend[2,10] ONCE CONT = 1 IF summation[CONT](myST = myST[CONT]) THEN IF CONT >= 5 then Upper = max(myST,highest[CONT](high)) Lower = min(myST,lowest[CONT](low)) DrawRectangle(barindex-CONT,Upper,BarIndex,Lower) coloured("Cyan",90) bordercolor("Red",0) CONT = 0 ENDIF CONT = CONT + 1 ENDIF RETURN |
prova se così va bene.
Find exclusive trading pro-tools on