candlestick indicator
Forums › ProRealTime forum Italiano › Supporto ProBuilder › candlestick indicator
- This topic has 10 replies, 2 voices, and was last updated 7 years ago by abd78.
-
-
11/01/2017 at 9:29 PM #51257
Ciao a tutti volevo fare in modo che questo indicatore qui:
https://www.prorealcode.com/prorealtime-indicators/candlestick-patterns-recognition/
invece che scrivere sul grafico con la direzione del pattern mi segni una barra (verde/rossa) in base alla direzione del pattern (freccia).
se è
esempio:
invece che:
Se si può anche che passando il cursore sopra la barra esca il nome del pattern.
grazie e un saluto.
11/01/2017 at 11:16 PM #51258Fare apparire una barra sotto il grafico dei prezzi è possibile, ma senza nome, l’unico tentativo da fare è diversificare i colori in base al pattern.
Se può andarti bene ci provo.
Roberto
11/02/2017 at 12:22 AM #5125911/02/2017 at 9:33 AM #51265Ho modificato l’originale, commentando le istruzioni inutilizzate per lasciare che tu possa riconoscerne il nome ed abbinarne i colori:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138DEFPARAM CalculateOnLastBars = 1000//text color// white = 255,255,255 ; black = 0,0,0//atr = averagetruerange[10](close)*0.5 //offset per il display di frecce e nomi sul grafico dei prezzix = 0DojiSize = 0.05data=(abs(open - close) <= (high - low) * DojiSize)if data thenx = 1r = 127g = 255b = 212//DRAWTEXT("Doji", barindex, high+atr, Dialog, Standard, 12) COLOURED(R,G,B)endifdata2=(close[2] > open[2] and min(open[1], close[1]) > close[2] and open < min(open[1], close[1]) and close < open )if data2 thenx = 1r = 255g = 228b = 196//DRAWTEXT("Evening Star", barindex, high[1]+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)//DRAWARROWDOWN(barindex-1,high[1]) COLOURED(255,0,10)endifdata3=(close[2] < open[2] and max(open[1], close[1]) < close[2] and open > max(open[1], close[1]) and close > open )if data3 thenx = 1r = 165g = 42b = 42//DRAWTEXT("Morning Star", barindex, low[1]-atr*1.5, Dialog, Standard, 12) COLOURED(0,255,10)//DRAWARROWUP(barindex-1,low[1]) COLOURED(0,255,10)endifdata4=(open[1] < close[1] and open > close[1] and high - max(open, close) >= abs(open - close) * 3 and min(close, open) - low <= abs(open - close))if data4 thenx = 1r = 222g = 184b = 135//DRAWTEXT("Shooting Star", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)//DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)endifdata5=(((high - low)>3*(open -close)) and ((close - low)/(.001 + high - low) > 0.6) and ((open - low)/(.001 + high - low) > 0.6))if data5 thenx = 1r = 95g = 158b = 160//DRAWTEXT("Hammer", barindex, high+atr, Dialog, Standard, 12) COLOURED(R,G,B)endifdata5b=(((high - low)>3*(open -close)) and ((high - close)/(.001 + high - low) > 0.6) and ((high - open)/(.001 + high - low) > 0.6))if data5b thenx = 1r = 210g = 105b = 30//DRAWTEXT("Inverted Hammer", barindex, high+atr, Dialog, Standard, 12) COLOURED(R,G,B)endifdata6=(close[1] > open[1] and open > close and open <= close[1] and open[1] <= close and open - close < close[1] - open[1] )if data6 thenx = 1r = 255g = 127b = 80//DRAWTEXT("Bearish Harami", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)//DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)endifdata7=(open[1] > close[1] and close > open and close <= open[1] and close[1] <= open and close - open < open[1] - close[1] )if data7 thenx = 1r = 169g = 169b = 169//DRAWTEXT("Bullish Harami", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,255,10)//DRAWARROWUP(barindex,low) COLOURED(0,255,10)endifdata8=(close[1] > open[1] and open > close and open >= close[1] and open[1] >= close and open - close > close[1] - open[1] )if data8 thenx = 1r = 34g = 139b = 34//DRAWTEXT("Bearish Engulfing", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)//DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)endifdata9=(open[1] > close[1] and close > open and close >= open[1] and close[1] >= open and close - open > open[1] - close[1] )if data9 thenx = 1r = 255g = 0b = 255//DRAWTEXT("Bullish Engulfing", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,255,10)//DRAWARROWUP(barindex,low) COLOURED(0,255,10)endifdata10=(close[1] < open[1] and open < low[1] and close > close[1] + ((open[1] - close[1])/2) and close < open[1])if data10 thenx = 1r = 255g = 215b = 0//DRAWT0EXT("Piercing Line", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,255,10)//DRAWARROWUP(barindex,low) COLOURED(0,255,10)endifdata14=(((high-low>4*(open-close))and((close-low)/(.001+high-low)>=0.75)and((open-low)/(.001+high-low)>=0.75)) and high[1] < open and high[2] < open)if data14 thenx = 1r = 128g = 128b = 128//DRAWTEXT("Hanging Man", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)//DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)endifdata15=((close[1]>open[1])and(((close[1]+open[1])/2)>close)and(open>close)and(open>close[1])and(close>open[1])and((open-close)/(.001+(high-low))>0.6))if data15 thenx = 1r = 238g = 130b = 238//DRAWTEXT("Dark Cloud Cover", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)//DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)endifRETURN x COLOURED(r,g,b) STYLE(histogram,1)Non è gran che, anche perché ne vengono stampate troppe e ti confondono, inoltre devi avere la tabella dei colori sottomano o scrivertene una tu da tenere sempre vicino a te.
Un suggerimento che ti do è quello di eliminare i pattern che non ti interessano ed eventualmente di variarne le caratteristiche, in modo da ridurli e renderli visivamente più distinguibili. Ma questa è una tua scelta e potrai utilizzarlo come esercizio per fare pratica. Ricordati di fare sempre copie di salvataggio prima di fare modifiche.
Allego anche il file .ITF che puoi importare nella piattaforma.
Roberto
11/03/2017 at 12:10 AM #51363grazie roberto, volevo chiederti per semplificare il tutto (visto che dovrei segnarmi i colori ecc..) se si poteva fare un barra verde quando il pattern indica buy e rosso quando indica sell. (così ho una barra come l’indicatore divergense rsi, anche solo su una fila come fatto con questo va bene così guadagno spazio). grazie
11/03/2017 at 4:32 AM #51369Intanto questo è il link alla tabella dei colori (mi ero dimenticato di segnalartelo): https://www.prorealcode.com/documentation/coloured/ (dopo avere aperta la pagina clicca poi sull’immagine per vedere bene i codici, magari te li stampi).
Quindi non vuoi più colori diversi per ogni tipo di pattern, ma solo VERDE se rialzista e ROSSO se ribassista, ho interpretato bene?
11/03/2017 at 1:26 PM #5140011/03/2017 at 4:56 PM #51443Cambiare i colori non è difficile, basta che sostituisci r (rosso), g (verde) e b (blue) con i colori che preferisci, presi dalla tabella di cui sopra.
Anche perché devi essere tu a stabilire quali Pattern sono Rialzisti o Ribassisti, ad esempio il DOJI.
Ad ogni modo, se vuoi cambiare, ad esempio, l’Inverted Hammer devi variare la parte di codice che va dalle righe 59 a 66 (io ho lasciato i vecchi nomi proprio per poterle facilmenre identificare), per il NERO basterà che le righe 62, 63 e 64 diventino:
123r = 0 //Red (rosso)g = 0 //Green (verde)b = 0 //Blue (blù)11/16/2017 at 6:13 PM #53046123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138DEFPARAM CalculateOnLastBars = 1000//text color// white = 255,255,255 ; black = 0,0,0//atr = averagetruerange[10](close)*0.5 //offset per il display di frecce e nomi sul grafico dei prezzix = 0DojiSize = 0.05data=(abs(open - close) <= (high - low) * DojiSize)if data thenx = 1r = 127g = 255b = 212//DRAWTEXT("Doji", barindex, high+atr, Dialog, Standard, 12) COLOURED(R,G,B)endifdata2=(close[2] > open[2] and min(open[1], close[1]) > close[2] and open < min(open[1], close[1]) and close < open )if data2 thenx = 1r = 255g = 228b = 196//DRAWTEXT("Evening Star", barindex, high[1]+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)//DRAWARROWDOWN(barindex-1,high[1]) COLOURED(255,0,10)endifdata3=(close[2] < open[2] and max(open[1], close[1]) < close[2] and open > max(open[1], close[1]) and close > open )if data3 thenx = 1r = 165g = 42b = 42//DRAWTEXT("Morning Star", barindex, low[1]-atr*1.5, Dialog, Standard, 12) COLOURED(0,255,10)//DRAWARROWUP(barindex-1,low[1]) COLOURED(0,255,10)endifdata4=(open[1] < close[1] and open > close[1] and high - max(open, close) >= abs(open - close) * 3 and min(close, open) - low <= abs(open - close))if data4 thenx = 1r = 222g = 184b = 135//DRAWTEXT("Shooting Star", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)//DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)endifdata5=(((high - low)>3*(open -close)) and ((close - low)/(.001 + high - low) > 0.6) and ((open - low)/(.001 + high - low) > 0.6))if data5 thenx = 1r = 95g = 158b = 160//DRAWTEXT("Hammer", barindex, high+atr, Dialog, Standard, 12) COLOURED(R,G,B)endifdata5b=(((high - low)>3*(open -close)) and ((high - close)/(.001 + high - low) > 0.6) and ((high - open)/(.001 + high - low) > 0.6))if data5b thenx = 1r = 210g = 105b = 30//DRAWTEXT("Inverted Hammer", barindex, high+atr, Dialog, Standard, 12) COLOURED(R,G,B)endifdata6=(close[1] > open[1] and open > close and open <= close[1] and open[1] <= close and open - close < close[1] - open[1] )if data6 thenx = 1r = 255g = 127b = 80//DRAWTEXT("Bearish Harami", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)//DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)endifdata7=(open[1] > close[1] and close > open and close <= open[1] and close[1] <= open and close - open < open[1] - close[1] )if data7 thenx = 1r = 169g = 169b = 169//DRAWTEXT("Bullish Harami", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,255,10)//DRAWARROWUP(barindex,low) COLOURED(0,255,10)endifdata8=(close[1] > open[1] and open > close and open >= close[1] and open[1] >= close and open - close > close[1] - open[1] )if data8 thenx = 1r = 34g = 139b = 34//DRAWTEXT("Bearish Engulfing", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)//DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)endifdata9=(open[1] > close[1] and close > open and close >= open[1] and close[1] >= open and close - open > open[1] - close[1] )if data9 thenx = 1r = 255g = 0b = 255//DRAWTEXT("Bullish Engulfing", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,255,10)//DRAWARROWUP(barindex,low) COLOURED(0,255,10)endifdata10=(close[1] < open[1] and open < low[1] and close > close[1] + ((open[1] - close[1])/2) and close < open[1])if data10 thenx = 1r = 255g = 215b = 0//DRAWT0EXT("Piercing Line", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,255,10)//DRAWARROWUP(barindex,low) COLOURED(0,255,10)endifdata14=(((high-low>4*(open-close))and((close-low)/(.001+high-low)>=0.75)and((open-low)/(.001+high-low)>=0.75)) and high[1] < open and high[2] < open)if data14 thenx = 1r = 128g = 128b = 128//DRAWTEXT("Hanging Man", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)//DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)endifdata15=((close[1]>open[1])and(((close[1]+open[1])/2)>close)and(open>close)and(open>close[1])and(close>open[1])and((open-close)/(.001+(high-low))>0.6))if data15 thenx = 1r = 238g = 130b = 238//DRAWTEXT("Dark Cloud Cover", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)//DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)endifRETURN x COLOURED(r,g,b) STYLE(histogram,1)non mi funziona quando lo importo
11/16/2017 at 6:26 PM #53050Ho fatto il copia e Incolla della tua versione qui sopra e funziona perfettamente.
L’ho esportato e lo allego.
Prova a reimportare questo, altrimenti crealo facendo il Copia e Incolla anche tu, sai come farlo?
11/16/2017 at 9:29 PM #53058 -
AuthorPosts
Find exclusive trading pro-tools on