Intraday flexible camarilla pivot points

Category: Indicators By: JC_Bywan Created: October 12, 2020, 3:15 PM
October 12, 2020, 3:15 PM
Indicators
4 Comments

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"

Download
Filename: PRC_export_camarilla_intraday.itf
Downloads: 380
JC_Bywan Master
https://market.prorealcode.com/store/volume-profile-solutions/ - Trading since 2008, using PRT since 2009, PRC forums moderator since 2016, helping out when I can. Using personal algorithmic universal market model (any market, any timeframe, self-adaptating no optimisation required), and volume profile and tape personal tools. Scientific coding skills from past life in aerospace sector, in Computational Fluid Dynamics.
Author’s Profile

Comments

Logo Logo
Loading...