A flexible intraday camarilla pivot points indicator was requested on the probuilder french forum, working for no matter how small the timeframe, robust enough to function in case of empty bars :
http://www.prorealcode.com/topic/point-pivot-camarilla-hourly/
Change integer n among values 15, 30, 60, 120, 180, 240 in minutes as the period for calculation of the camarilla pivot points.
Use start and finish variables in HHMMSS format for intraday start and finish times. First calculation is made one « n » period after the start.
// PRC Camarilla Pivot Points intra day
// 04.10.2020 mod 09.10.2020
// Noobywan @ www.prorealcode.com
// Sharing ProRealTime Knowledge
// Forum ProBuilder user Choliver request
// --- Settings
n=120 // time span in minutes, choose parameter n equal to 15, 30, 60, 120, 180 or 240
start=080000 // time start in HHMMSS format
finish=220000 // time end in HHMMSS format
// --- End of settings
//
if n=15 then
changebarre= openminute[1]>openminute or (openminute[1]<15 and openminute>=15) or (openminute[1]<30 and openminute>=30) or (openminute[1]<45 and openminute>=45)
deltamin=1500
elsif n=30 then
changebarre= openminute[1]>openminute or (openminute[1]<30 and openminute>=30)
deltamin=3000
elsif n=60 then
changebarre= openminute[1]>openminute
deltamin=10000
elsif n=120 then
deltamin=20000
hrs=(opentime-start)/deltamin
changebarre= (hrs[1]<1 and hrs>=1) or (hrs[1]<2 and hrs>=2) or (hrs[1]<3 and hrs>=3) or (hrs[1]<4 and hrs>=4) or (hrs[1]<5 and hrs>=5) or (hrs[1]<6 and hrs>=6) or (hrs[1]<7 and hrs>=7) or (hrs[1]<8 and hrs>=8) or (hrs[1]<9 and hrs>=9) or (hrs[1]<10 and hrs>=10) or (hrs[1]<11 and hrs>=11)
elsif n=180 then
deltamin=30000
hrs=(opentime-start)/deltamin
changebarre= (hrs[1]<1 and hrs>=1) or (hrs[1]<2 and hrs>=2) or (hrs[1]<3 and hrs>=3) or (hrs[1]<4 and hrs>=4) or (hrs[1]<5 and hrs>=5) or (hrs[1]<6 and hrs>=6) or (hrs[1]<7 and hrs>=7)
elsif n=240 then
deltamin=40000
hrs=(opentime-start)/deltamin
changebarre= (hrs[1]<1 and hrs>=1) or (hrs[1]<2 and hrs>=2) or (hrs[1]<3 and hrs>=3) or (hrs[1]<4 and hrs>=4) or (hrs[1]<5 and hrs>=5)
else
DRAWTEXT("n must be 15, 30, 60, 120, 180 or 240", barindex, close)
endif
//
if changebarre then
stoque=barchange
barchange=barindex
myhigh=highest[barchange-stoque](high)[1]
mylow=lowest[barchange-stoque](low)[1]
myclose=close[1]
endif
//
if opentime>=start+deltamin and opentime<finish then
PPcama=myclose
R1cama=myclose+(myhigh-mylow)*1.1/12
R2cama=myclose+(myhigh-mylow)*1.1/6
R3cama=myclose+(myhigh-mylow)*1.1/4
R4cama=myclose+(myhigh-mylow)*1.1/2
S1cama=myclose-(myhigh-mylow)*1.1/12
S2cama=myclose-(myhigh-mylow)*1.1/6
S3cama=myclose-(myhigh-mylow)*1.1/4
S4cama=myclose-(myhigh-mylow)*1.1/2
else
PPcama=0
R1cama=0
R2cama=0
R3cama=0
R4cama=0
S1cama=0
S2cama=0
S3cama=0
S4cama=0
endif
RETURN PPcama AS "PP Camarilla", R1cama AS "R1 Camarilla", R2cama AS "R2 Camarilla", R3cama AS "R3 Camarilla", R4cama AS "R4 Camarilla", S1cama AS "S1 Camarilla", S2cama AS "S2 Camarilla", S3cama AS "S3 Camarilla", S4cama AS "S4 Camarilla"
You must be logged in to post a comment.
the choice of period and start and end time is exactly what i was asking for the classic pivot calculation in another thread. Being able to define those parameters is awesome. Is there any chance this methodology could be applied for the classical pivot calculation? apologies if a bit straightforward, I am new here so don't know if requests are taken. Many thanks in advance.
Hi FXTT, no problem for requests (as long as no one requests me singing), just usually it’s preferred for the forum to be the entry point. For the classic pivot points using above flexible intraday coding method, we would just need to replace lines 46 to 68 with classic calculation, and keep everything else above ligne 46 the same, the end result is: // PRC classic points intraday, adapted from Camarilla Pivot Points intra day // 04.10.2020 mod 09.10.2020 mod 14.12.2020 // Noobywan @ http://www.prorealcode.com // Sharing ProRealTime Knowledge // Forum ProBuilder user Choliver request // — Settings n=120 // time span in minutes, choose parameter n equal to 15, 30, 60, 120, 180 or 240 start=080000 // time start in HHMMSS format finish=220000 // time end in HHMMSS format // — End of settings // if n=15 then changebarre= openminute[1]>openminute or (openminute[1]=15) or (openminute[1]=30) or (openminute[1]=45) deltamin=1500 elsif n=30 then changebarre= openminute[1]>openminute or (openminute[1]=30) deltamin=3000 elsif n=60 then changebarre= openminute[1]>openminute deltamin=10000 elsif n=120 then deltamin=20000 hrs=(opentime-start)/deltamin changebarre= (hrs[1]=1) or (hrs[1]=2) or (hrs[1]=3) or (hrs[1]=4) or (hrs[1]=5) or (hrs[1]=6) or (hrs[1]=7) or (hrs[1]=8) or (hrs[1]=9) or (hrs[1]=10) or (hrs[1]=11) elsif n=180 then deltamin=30000 hrs=(opentime-start)/deltamin changebarre= (hrs[1]=1) or (hrs[1]=2) or (hrs[1]=3) or (hrs[1]=4) or (hrs[1]=5) or (hrs[1]=6) or (hrs[1]=7) elsif n=240 then deltamin=40000 hrs=(opentime-start)/deltamin changebarre= (hrs[1]=1) or (hrs[1]=2) or (hrs[1]=3) or (hrs[1]=4) or (hrs[1]=5) else DRAWTEXT(“n must be 15, 30, 60, 120, 180 or 240”, barindex, close) endif // if changebarre or (opentime[1]=start) then stoque=barchange barchange=barindex myhigh=highest[barchange-stoque](high)[1] mylow=lowest[barchange-stoque](low)[1] myclose=close[1] endif // if opentime>=start+deltamin and opentime<finish then PPclassic = (myhigh+mylow+myclose)/3 R1classic = 2*PPclassic-mylow R2classic = PPclassic+(myhigh-mylow) R3classic = myhigh+2*(PPclassic-mylow) S1classic = 2*PPclassic-myhigh S2classic = PPclassic-(myhigh-mylow) S3classic = mylow-2*(myhigh-PPclassic) else PPclassic = 0 R1classic = 0 R2classic = 0 R3classic = 0 S1classic = 0 S2classic = 0 S3classic = 0 endif RETURN PPclassic AS "PP", R1classic AS "R1", R2classic AS "R2", R3classic AS "R3", S1classic AS "S1", S2classic AS "S2", S3classic AS "S3"
Bug fix at line 38, should be: if changebarre or (opentime[1]=start) then (same as in modified code in 10/12/2020 comment above) My apologies