Intra day camarilla Pivots not matching chart display
Forums › ProRealTime English forum › ProBuilder support › Intra day camarilla Pivots not matching chart display
- This topic has 23 replies, 4 voices, and was last updated 2 years ago by Paulg999.
-
-
09/21/2022 at 9:11 AM #201125
Hi,
I would be most grateful if you could help me get the camarilla pivot levels I see on my chart inline with the PRT test so that I can conduct back tests with confidence.
I am having problems when I back test a strategy which uses intraday camarilla levels. I performed a basic strategy test to ensure that the back test picked up some simple bounces of pivot levels but the results were mixed which would suggest that there is disparity between the chart levels I see & the back test levels. This make me think that my displayed levels are being calculated differently to those which the back test uses.🤷♀️
I am hoping that a minor adjustment of settings will correct the issue. Please find attached some screenshots of my current settings.
I appreciate any efforts to get this corrected for me.
Thank you.
09/21/2022 at 3:47 PM #20115409/22/2022 at 8:48 AM #201180Hi Paul, sorry but did you reply to someone in the topic? I do not see other messages than yours?
There are no instructions to get the camarilla pivots levels, you have to calculate them by yourself in your code, could you please share us your code in order to check them?
09/22/2022 at 10:09 AM #201186If it can be useful, this is a code written by Roberto Gozzi.
// PIVOT CAMARILLA by Roberto Gozzi
DEFPARAM DrawOnLastBarOnly = true
IF IntraDayBarIndex = 0 THEN
inizio = BarIndex
ENDIFmyH = ( DHIGH(1) )
myL = ( DLOW(1) )
myC = ( DCLOSE (1) )IF OpenDayOfWeek = 1 THEN
myH = ( DHIGH(2) )
myL = ( DLOW(2) )
myC = ( DCLOSE (2) )
ENDIFPP = myc//PP = Previous Day’s Close
R1 = ((myH-myL) * 1.1)/12+myC
RR2 = ((myH-myL)*1.1)/6+myC // Note: RR2 is used instead of R2 since R2 is the symbol for “R squared” in probuilder language.
R3 = ((myH-myL)*1.1)/4+myC
R4 = ((myH-myL)*1.1)/2+myCS1 = myC-((myH-myL)*1.1)/12
S2 = myC-((myH-myL)*1.1)/6
S3 = myC-((myH-myL)*1.1)/4
S4 = myC-((myH-myL)*1.1)/2DrawSegment(Inizio,R1,BarIndex,R1) COLOURED(255,0,0) style(dottedLine,2)
DrawText(“Cama R1”, BarIndex+5,R1) COLOURED(255,0,0)
DrawSegment(Inizio,RR2,BarIndex,RR2) COLOURED(255,0,0) style(dottedLine,2)
DrawText(“Cama R2”,BarIndex+5,RR2) COLOURED(255,0,0)
DrawSegment(Inizio,R3,BarIndex,R3) COLOURED(255,0,0) style(dottedLine,2)
DrawText(“Cama R3”,BarIndex+5,R3) COLOURED(255,0,0)
DrawSegment(Inizio,R4,BarIndex,R4) COLOURED(255,0,0) style(dottedLine,2)
DrawText(“Cama R4”,BarIndex+5,R4) COLOURED(255,0,0)
DrawSegment(Inizio,S1,BarIndex,S1) COLOURED(0,180,0) style(dottedLine,2)
DrawText(“Cama S1”,BarIndex+5,S1) COLOURED(0,180,0)
DrawSegment(Inizio,S2,BarIndex,S2) COLOURED(0,180,0) style(dottedLine,2)
DrawText(“Cama S2”,BarIndex+5,S2) COLOURED(0,180,0)
DrawSegment(Inizio,S3,BarIndex,S3) COLOURED(0,180,0) style(dottedLine,2)
DrawText(“Cama S3”,BarIndex+5,S3) COLOURED(0,180,0)
DrawSegment(Inizio,S4,BarIndex,S4) COLOURED(0,180,0) style(dottedLine,2)
DrawText(“Cama S4”,BarIndex+5,S4) COLOURED(0,180,0)
DrawSegment(Inizio,PP,BarIndex,PP) COLOURED(0,0,0) style(dottedLine,2)
DrawText(“Cama PP”,BarIndex+5,PP) COLOURED(0,0,0)RETURN R1 COLOURED(255,0,0)style(dottedLine,2) AS “CAMA R1” , RR2 COLOURED(255,0,0)style(dottedLine,2) AS “CAMA R2” , R3 COLOURED(255,0,0)style(dottedLine,2) AS “CAMA R3”, R4 COLOURED(255,0,0)style(dottedLine,2) AS “CAMA R4” , S1 COLOURED(0,180,0) style(dottedLine,2)AS “CAMA S1”, S2 COLOURED(0,180,0) style(dottedLine,2)AS “CAMA S2” , S3 COLOURED(0,180,0)style(dottedLine,2)AS “CAMA S3” , S4 COLOURED(0,180,0) style(dottedLine,2)AS “CAMA S4” ,PP COLOURED(0,0,0)style(line,2) AS “CAMA PP”
2 users thanked author for this post.
09/22/2022 at 11:08 AM #20119309/23/2022 at 10:43 AM #201237Hi,
Please find attached itf file & a copy of the code for longs only. The itf file contains both longs and shorts.
So this was a really simple test to make sure that the back test was recognising a bounce of the 15m Camerilla Pivot as I see it on my chart & the bottom line is there is disparity & I don’t understand why.
In simple terms, for longs i want to see the 8ema above the 15m PP, a colour change on the 8ema from Red to Green, the low of the previous bar below the pivot & the close of the current bar above the PP whilst price is above the Supertrend.
The test dates are from 14th September to 23rd September on the 1m chart using PRT 15m Camerilla’s on Wall Street (DFB)
I have included screenshots for the first two longs dated but you will see multiple examples of these across both short & longs if you use the itf file.
21/09/22 @ 10:58 [Low NOT below 15mPP.PNG]
19/09/22 @ 18:40 [The 8ema is NOT above the 15m PP.PNG]
I hope the above makes it easier to identify where the problem lies.
Many thanks for your continued support.
// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated// Conditions to enter long positions
indicator1 = ExponentialAverage[8](close)
c1 = (close[1] < indicator1[1])
indicator2 = ExponentialAverage[8](close)
c2 = (close > indicator2)
indicator3 = ExponentialAverage[8](close)
indicator4 = (DHigh(1) + DLow(1) + DClose(1))/3
c3 = (indicator3 > indicator4)
indicator5 = (DHigh(1) + DLow(1) + DClose(1))/3
c4 = (low[1] < indicator5[1])
indicator6 = (DHigh(1) + DLow(1) + DClose(1))/3
c5 = (close > indicator6)
indicator7 = SuperTrend[1.5,13]
c6 = (close > indicator7)IF c1 AND c2 AND c3 AND c4 AND c5 AND c6 THEN
BUY 1 PERPOINT AT MARKET
ENDIF// Conditions to exit long positions
indicator8 = SuperTrend[1.5,13]
c7 = (close CROSSES UNDER indicator8)IF c7 THEN
SELL AT MARKET
ENDIF09/23/2022 at 4:26 PM #20124909/24/2022 at 2:38 PM #201299Hi JS,
Thanks for the response.
As you may have been able to tell I am no coder & just used the indicator available within PRT (as per attachment [Pivot Points.png]).
I do see what you mean now reference the code relating to DHigh, DLow and DClose but I am at a loss to understand why the code is like that when the indicator is selected to 15m. I have just changed the pivot setting to weekly & that too reads the same code as above (Day levels) i.e it never changes.
Q1. I am curious (if you know) Why does the indicator display the 5m/15m/1Hr/Day & Week on the chart correctly but only return the same Day levels in the code?
Q2. As I only use the simplified code (due to lack of programming capability), is it possible to use separate/custom indicators for each level type (5m/15m/1Hr/Day & Week) where the code would be entered correctly for each PP type?
Q3. If the answer to Q2 is “Yes”, where would I find such indicators?
Q4. If the answer to Q2 is “No”, what would be my options given this scenario?
Thank you very much for your help, it is greatly appreciated.
09/24/2022 at 4:15 PM #201304Hi @Paulg999
The indicator can be adjusted to the time frame you use, so the indicator displays the correct values.
The code calculates the Camarilla based on daily rates, namely DHigh, DLow and DClose, so you only get daily pivot Camarilla here.
Yes, you can change the code by replacing the daily rates with “normal” rates, for example: DHigh => High, DLow => Low, DClose => Close
I see that you mix up the concepts of indicators and code, an indicator shows calculations graphically in the graph but cannot generate buy /sell signals, for example. The code is there for the calculations and can generate buy and sell signals but cannot perform graphical actions.
The indicator you use is good, but your code needs to be adjusted.
I will try to customize the code for you.
09/24/2022 at 5:59 PM #201313Hi @Paulg999
I have adjusted all daily rates to “normal” rates…
Paulg999 System1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556// Definitie van code parametersDEFPARAM CumulateOrders = False // Opstapelen posities gedeactiveerd// Condities om long posities te openenindicator1 = ExponentialAverage[8](close)c1 = (close[1] < indicator1[1])indicator2 = ExponentialAverage[8](close)c2 = (close > indicator2)indicator3 = ExponentialAverage[8](close)indicator4 = (High[1] + Low[1] + Close[1])/3c3 = (indicator3 > indicator4)indicator5 = (High[1] + Low[1] + Close[1])/3c4 = (low[1] < indicator5[1])indicator6 = (High[1] + Low[1] + Close[1])/3c5 = (close > indicator6)indicator7 = SuperTrend[1.5,13]c6 = (close > indicator7)IF c1 AND c2 AND c3 AND c4 AND c5 AND c6 THENBUY 1 CONTRACT AT MARKETENDIF// Condities om long posities te sluitenindicator8 = SuperTrend[1.5,13]c7 = (close CROSSES UNDER indicator8)IF c7 THENSELL AT MARKETENDIF// Condities om short posities te openenindicator9 = ExponentialAverage[8](close)c8 = (close[1] > indicator9[1])indicator10 = ExponentialAverage[8](close)c9 = (close < indicator10)indicator11 = ExponentialAverage[8](close)indicator12 = (High[1] + Low[1] + Close[1])/3c10 = (indicator11 < indicator12)indicator13 = (High[1] + Low[1] + Close[1])/3c11 = (high[1] > indicator13[1])indicator14 = (High[1] + Low[1] + Close[1])/3c12 = (close < indicator14)indicator15 = SuperTrend[1.5,13]c13 = (close < indicator15)IF c8 AND c9 AND c10 AND c11 AND c12 AND c13 THENSELLSHORT 1 CONTRACT AT MARKETENDIF// Condities om short posities te sluitenindicator16 = SuperTrend[1.5,13]c14 = (close CROSSES OVER indicator16)IF c14 THENEXITSHORT AT MARKETENDIF09/25/2022 at 9:09 PM #201391Hi JS,
Just want to thank you for your posting. My son has just gone down with Covid & my wife is away so I am struggling to get much time looking at this.
Will be back in touch as soon as I can. I dare say I will have some questions.
Thanks again.
P
09/25/2022 at 10:10 PM #20139209/28/2022 at 1:10 PM #20156409/28/2022 at 3:45 PM #201584Hi Paulg999
The brackets refer to the bar index where [0] is the most recent and [10] is that of 10 bars ago, e.g. Close[0] and Close[10].
The brackets can also be used to indicate a certain period of time, for example: Average[10](Close)
Calculate the average over the last 10 bars.
Parentheses can relate to a used time frame for example, DClose(0)
Is the Close value of the daily time frame and DClose(10) is the Close value of 10 bars ago in the daily time frame.
1 user thanked author for this post.
09/28/2022 at 3:47 PM #201585Hi JS,
When I add an additional Pivot level to a set of conditions how do i differentiate it from the first one?
// Conditions to enter long positions
indicator1 = ExponentialAverage[8](close)
indicator2 = (High[1] + Low[1] + Close[1])/3
c1 = (indicator1[1] < indicator2[1])
indicator3 = ExponentialAverage[8](close)
indicator4 = (High[1] + Low[1] + Close[1])/3
c2 = (indicator3 > indicator4)// The above conditions to take place on 5m
indicator5 = Close[1] + (High[1]-Low[1]) * (1.1 / 4)
c3 = (close > indicator5)
indicator6 = Close[1] + (High[1]-Low[1]) * (1.1 / 6)
c4 = (low[1] < indicator6[1])
indicator7 = Close[1] + (High[1]-Low[1]) * (1.1 / 6)
c5 = (close > indicator7)// The above conditions take place on 15m
When the back test runs it looks like only the 15m instruction is being considered.
-
AuthorPosts
Find exclusive trading pro-tools on