Scrivere testo sul grafico
Forums › ProRealTime forum Italiano › Supporto ProBuilder › Scrivere testo sul grafico
- This topic has 3 replies, 3 voices, and was last updated 1 year ago by Alessandro Furlani.
-
-
10/11/2023 at 11:08 AM #222266
Vorrei scrivere del testo negli angoli dei grafici ma ho sempre usato il barindex come riferimento di posizione. Come funzionano le coordinate ?
Potrei vedere qualche esempio ?
Grazie
10/11/2023 at 12:42 PM #222272Se ti può servire come esempio, questo è un codice di Roberto che disegna la chiusura-massimo-minimo del giorno precedente e scrive con draw text i dati.
DEFPARAM DRAWONLASTBARONLY = true
IF OpenTime = 000000 THEN // cambiare se si vuole fare iniziare il draw dell’open in un orario differente
Massimo = high
Minimo = low
ENDIFIF Time <= 173000 THEN
Massimo = max(Massimo,high)
Minimo = min(Minimo,low)
ENDIFIF Time = 173000 THEN
Chiusura = close
MassimoPrec = Massimo
MinimoPrec = Minimo
ENDIFIF Time = 173000 THEN
Inizio = BarIndex
ENDIF
Fine = 48 // minuti da variare come vuoi secondo il TF,
// sono il numero di barre in un’intera giornata di trading
// 24(60) 48 (30) – 96 (15) – 288 (5) – 480(3) – 720(2)
DRAWSEGMENT(Inizio,Chiusura,Inizio+Fine,Chiusura) coloured(0,128,0,255) //Verde
DRAWSEGMENT(Inizio,MassimoPrec, Inizio+Fine,MassimoPrec) coloured(0,0,255,255) //Blù
DRAWSEGMENT(Inizio,MinimoPrec, Inizio+Fine,MinimoPrec) coloured(255,0,0,255) //Rossodrawtext(“Close #Chiusura#” ,barindex,Chiusura + range,Dialog,Bold,20) //grandezza 10-30
drawtext(“High #MassimoPrec#” ,barindex,MassimoPrec + range,Dialog,Bold,20) //grandezza 10-30
drawtext(“Low #MinimoPrec#” ,barindex,MinimoPrec – range,Dialog,Bold,20) //grandezza 10-30RETURN
10/11/2023 at 2:58 PM #222277Ecco un esempio:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182// Anchor, drawtext, TopRight, TopLeft, BottomRight, BottomLeft, Middle, Index, Volume, Bottom, Top, Right, Left, Xshift, Yshift//// TSR-ADR-Indikators display Änderung//// https://www.prorealcode.com/topic/tsr-adr-indikators-display-anderung/////PRC_TSR_DailyRange_display | indicator//11.12.2018//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledge//translated from MT4 versiondefparam drawonlastbaronly=trueif day<>day[1] thenstartbar=barindexFIVE=0TEN=0TWENTY=0for i = 1 to 20 doif i<6 thenFIVE=FIVE+(dhigh(i)-dlow(i))endifif i<11 thenTEN=TEN+(dhigh(i)-dlow(i))endifTWENTY=TWENTY+(dhigh(i)-dlow(i))nextFIVE = FIVE/10TEN = TEN/20TWENTY = TWENTY/40AV = (FIVE+TEN+TWENTY)/3endifHIDaily = dhigh(0)-(AV)LOWDaily = dlow(0)+(AV)HIDaily1 = dhigh(0)LOWDaily1 =dlow(0)HIDaily2 = dhigh(0)-(AV)*2LOWDaily2 =dlow(0)+(AV)*2//--------------------------------------------------------------------------------------------------------------------drawrectangle(-350,0,-245,-20) anchor(TopRight) coloured("YellowGreen") bordercolor("Black")drawtext ("Top DAILY Range ", -301 ,-10) anchor(TopRight) coloured("Black")//drawrectangle(-350,-20,-245,-40) anchor(TopRight) coloured("Silver") bordercolor("Black")drawtext ("Open", -314 ,-30) anchor(TopRight) coloured("Black")//drawrectangle(-350,-40,-245,-60) anchor(TopRight) coloured("PapayaWhip") bordercolor("Black")drawtext ("Bottom DAILY Range", -298 ,-50) anchor(TopRight) coloured("Black")//--------------------------------------------------------------------------------------------------------------------drawrectangle(-245,0,-170,-20) anchor(TopRight) coloured("YellowGreen") bordercolor("Black")x = round(LowDaily2,1)drawtext ("#x#", -196 ,-10) anchor(TopRight) coloured("Black")//drawrectangle(-245,-20,-170,-40) anchor(TopRight) coloured("Silver") bordercolor("Black")x = Dopen(0)drawtext ("#x#", -196 ,-30) anchor(TopRight) coloured("Black")//drawrectangle(-245,-40,-170,-60) anchor(TopRight) coloured("PapayaWhip") bordercolor("Black")x = round(HiDaily2,1)drawtext ("#x#", -196 ,-50) anchor(TopRight) coloured("Black")//--------------------------------------------------------------------------------------------------------------------drawrectangle(-160,0,-90,-20) anchor(TopRight) coloured("LightBlue") bordercolor("Black")drawtext ("Date: ", -140 ,-10) anchor(TopRight) coloured("Black")//drawrectangle(-160,-20,-90,-40) anchor(TopRight) coloured("LightBlue") bordercolor("Black")drawtext ("High", -140 ,-30) anchor(TopRight) coloured("Black")//drawrectangle(-160,-40,-90,-60) anchor(TopRight) coloured("LightBlue") bordercolor("Black")drawtext ("Low ", -140 ,-50) anchor(TopRight) coloured("Black")//--------------------------------------------------------------------------------------------------------------------drawrectangle(-90,0,-10,-20) anchor(TopRight) coloured("LightBlue") bordercolor("Black")x = OpenDayy = OpenMonthz = OpenYear MOD 2000drawtext ("#x##y##z#", -40 ,-10) anchor(TopRight) coloured("Black")//drawrectangle(-90,-20,-10,-40) anchor(TopRight) coloured("LightBlue") bordercolor("Black")x = Dhigh(0)drawtext ("#x#", -40 ,-30) anchor(TopRight) coloured("Black")//drawrectangle(-90,-40,-10,-60) anchor(TopRight) coloured("LightBlue") bordercolor("Black")x = Dlow(0)drawtext ("#x#", -40 ,-50) anchor(TopRight) coloured("Black")return10/11/2023 at 3:58 PM #222289Perfettissimo grazie era quello che cercavo.
Saluti
-
AuthorPosts
Find exclusive trading pro-tools on