Disegnare Box relativo al Supertrend
Forums › ProRealTime forum Italiano › Supporto ProBuilder › Disegnare Box relativo al Supertrend
- This topic has 5 replies, 2 voices, and was last updated 8 months ago by Stanko.
-
-
08/03/2023 at 4:14 PM #218556
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
08/03/2023 at 5:17 PM #218558Questo mi sembra vada bene:
1234567myST = SuperTrend[2,10]IF summation[5](myST = myST[1]) = 5 THENUpper = max(myST,highest[5](high))Lower = min(myST,lowest[5](low))DrawRectangle(BarIndex-4,Upper,BarIndex,Lower) coloured("Cyan",90) bordercolor("Red",0)ENDIFRETURN1 user thanked author for this post.
08/03/2023 at 5:57 PM #218560Molte 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
08/03/2023 at 7:10 PM #218561Scusa Roberto, ho provato a modificare il tuo codice ma non riesco a visualizzare il Box.
Per cortesia riesci a correggerlo?
Grazie.
Allego il codice
Box con Supertrend12345678910111213myST = SuperTrend[2,10]ONCE CONT = 1IF summation[CONT](myST = myST[CONT]) THENIF CONT >= 5 thenUpper = 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 + 1ELSECONT = CONT + 1ENDIFENDIFRETURN08/11/2023 at 10:01 AM #218933Ho riscritto il codice così:
123456789101112myST = SuperTrend[2,10]ONCE CONT = 1IF summation[CONT](myST = myST[CONT]) THENIF CONT >= 5 thenUpper = max(myST,highest[CONT](high))Lower = min(myST,lowest[CONT](low))DrawRectangle(barindex-CONT,Upper,BarIndex,Lower) coloured("Cyan",90) bordercolor("Red",0)CONT = 0ENDIFCONT = CONT + 1ENDIFRETURNprova se così va bene.
1 user thanked author for this post.
08/11/2023 at 7:17 PM #218956 -
AuthorPosts
Find exclusive trading pro-tools on