VWAP Date anchored + ORARIO
- This topic has 3 replies, 2 voices, and was last updated 4 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
Similar topics:
Forums › ProRealTime forum Italiano › Supporto ProBuilder › VWAP Date anchored + ORARIO
Salve.
Per un uso su time frame intraday (es.-1H) è possibile aggiungere l’ora/minuti al seguente codice ?
esempio che il vwap sia ancorato sulla barra del giorno es. 202141018 alle ore es. 15.00.
Grazie
Saluti
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
startDate=20141018 VWAP=undefined SDup1 = undefined SDlw1 = undefined SDup2 = undefined SDlw2 = undefined SDup3 = undefined SDlw3 = undefined if opendate=startDate then startbar=barindex endif if opendate>=startDate then barcount=barindex-startbar d = max(1, barcount) src = customclose if volume > 0 THEN VWAP = summation[d](Volume * src)/summation[d](Volume) ENDIF if(barcount=0) then sd = 0 else p1 = summation[d](Volume * src) p2 = summation[d](Volume) p3 = summation[d](Volume * src * src) ma = p1/p2 ma2 = p3/p2 sd = SQRT(ABS(ma2 - ma * ma) ) endif if viewSD then SDup1 = vwap+sd SDlw1 = vwap-sd SDup2 = vwap+sd*2 SDlw2 = vwap-sd*2 SDup3 = vwap+sd*3 SDlw3 = vwap-sd*3 endif SDup1 = vwap+sd*1 SDlw1 = vwap-sd*1 SDup2 = vwap+sd*2 SDlw2 = vwap-sd*2 SDup3 = vwap+sd*3 SDlw3 = vwap-sd*3 endif R=1 G=1 B=1 RETURN VWAP coloured(R,G,B) as "VWAP", SDup1 coloured(R,G,B) as "upper 1 STD", SDlw1 coloured(R,G,B) as "lower 1 STD", SDup2 coloured(R,G,B) as "upper 2 STD", SDlw2 coloured(R,G,B) as "lower 2 STD", SDup3 coloured(R,G,B) as "upper 3 STD", SDlw3 coloured(R,G,B) as "lower 3 STD" |
Cosa intendi per “ancorato“?
Ancorato nel senso che decidi tu da quale giorno deve inziare il vwap (per semplicità nel codice ho impostato il 18 ottobre 2024).
Vorrei aggiungere la possibilità di decidere anche l’orario per poterlo usare in un time frame intrday.
Ecco, ho aggiunto anche l’orara d’inizio (starttime):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
once startDate=20240108 once starttime=090000 once VWAP = undefined once SDup1 = undefined once SDlw1 = undefined once SDup2 = undefined once SDlw2 = undefined once SDup3 = undefined once SDlw3 = undefined if (opendate=startDate) AND (opentime=starttime) then startbar=barindex endif if (opendate>startDate) or (opendate=startDate) and (opentime>=starttime) then barcount=barindex-startbar d = max(1, barcount) src = customclose if volume > 0 THEN VWAP = summation[d](Volume * src)/summation[d](Volume) ENDIF if(barcount=0) then sd = 0 else p1 = summation[d](Volume * src) p2 = summation[d](Volume) p3 = summation[d](Volume * src * src) ma = p1/p2 ma2 = p3/p2 sd = SQRT(ABS(ma2 - ma * ma) ) endif if viewSD then SDup1 = vwap+sd SDlw1 = vwap-sd SDup2 = vwap+sd*2 SDlw2 = vwap-sd*2 SDup3 = vwap+sd*3 SDlw3 = vwap-sd*3 endif SDup1 = vwap+sd*1 SDlw1 = vwap-sd*1 SDup2 = vwap+sd*2 SDlw2 = vwap-sd*2 SDup3 = vwap+sd*3 SDlw3 = vwap-sd*3 endif R=1 G=1 B=1 RETURN VWAP coloured(R,G,B) as "VWAP", SDup1 coloured(R,G,B) as "upper 1 STD", SDlw1 coloured(R,G,B) as "lower 1 STD", SDup2 coloured(R,G,B) as "upper 2 STD", SDlw2 coloured(R,G,B) as "lower 2 STD", SDup3 coloured(R,G,B) as "upper 3 STD", SDlw3 coloured(R,G,B) as "lower 3 STD" |
Find exclusive trading pro-tools on