Found this code of interest on a NL Prorealtime forum for someone requesting an intraday pivot points indicator. Nicely coded and would surely be of interest of other people around here, I add it to library.
The variables ‘myStartHour’, ‘myStartMinute’, ‘myEndHour’ and ‘myEndMinute’ may be changed to any start and end time for the pivot points calculation.
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 60 61 62 63 64 |
// Variable Pivots // by Smoke // Zeitvariable myStartHour = 7 myStartMinute = 0 myEndHour = 9 myEndMinute = 0 // umrechnung Zeit start = (myStartHour * 10000) + (myStartMinute * 100) ende = (myEndHour * 10000) + (myEndMinute * 100) + 1000 // Hoch-Tief-Close Berechnung Once myHigh = 0 Once myLow = 1000 If (Day > Day[1]) Then myLow = Low myHigh = High myClose = Close Endif If (Time >= start) Then myClose = Close If High > myHigh Then myHigh = High Else myHigh = myHigh[1] Endif If (Time > ende) Then myHigh = myHigh[1] myClose = myClose[1] Endif If Low < myLow Then myLow = Low Else myLow = myLow[1] Endif If (Time > ende) Then myLow = myLow[1] Endif Endif If Time >= ende Then // PP-Berechnung PRange = ABS(myHigh - myLow) PP = (myHigh + myLow + myClose) / 3 R1 = 2 * PP - myLow R22 = PP + PRange R3 = PP + PRange * 2 R4 = PP + PRange * 3 S1 = 2 * PP - myHigh S2 = PP - PRange S3 = PP - Prange * 2 S4 = PP - PRange * 3 Endif Return PP coloured(0,0,0) as "PP", R1 coloured(255,0,0) as "R1", R22 coloured(255,0,0) as "R2", R3 coloured(255,0,0) as "R3", R4 coloured(255,0,0) as "R4", S1 coloured(0,255,0) as "S1", S2 coloured(0,255,0) as "S2", S3 coloured(0,255,0) as "S3", S4 coloured(0,255,0) as "S4" |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
there are two errors in the code:
If (Day > Day[1]) Then
myLow = Low
myHigh = High
myClose = Close
Endif
should be replaced by
If (Day > Day[1]) Then
myLow = Low*100
myHigh = 0
myClose = Close
Endif
and the calculation of the R3/S3 is wrong
Hi Nicola,
I wanted to know an information.
After optimizing a strategy (unit 10 min backtest time 1 year) I continue the
all with 5-step Walk Forward not anchored and choose the variables it reports to
50% or higher. After validating the system, I perform the last validity with the method
Walk Forward to a period. The questions I ask you are:
1- we hypothesize that the strategy is ok and that it is real, 1 year divided by 5 is equal to 2.5 months
, time of “expiration” of the strategy. After the expiration period I have to make a
optimization or validity with the walk forward method and how many periods?
2- If a strategy optimized and tested with the WF method has percentages higher than 150% how can I behave?
3- What is the optimal percentage of validity with the Walk Forward method? 70% -30% or 60% -40%?
4- When optimizing variables or the WF method is it important to update several variables together or one variable at a time?
Thanks
Why are you asking this question there? (and in other places in the forums that don’t have any link to the subject?!). You should open a new topic or even ask your question in this blog post: https://www.prorealcode.com/blog/learning/prorealtime-walk-analysis-tool/
Nice code Nicholas and well done on writing it but in my opinion and mine only pivot points hold zero value to actual trading . About as useful as Fibonacci , before enyone jumps down my throat go find a bell curve distribution of retrace levels and you will see there is a wide fat part of the curve that really serves no purpose predictively . IE there is no usable probability that will challenge random entry/exit . Not trying to be negative just putting it out there . Have a read of ” Evidence-Based Technical Analysis: Applying the Scientific Method and Statistical Inference to Trading Signals
Book by David Aronson “
Thanks for the input and your opinion, but IMO, the pivot points are ones of the best support and resistance lines for intraday trading. Both daily, weekly and monthly are great points of “rendez-vous” for a lot of traders and therefore can be used for targets and rejections orders. There is no single way to benefit from the market, but i know for sure that if you act like many others do, you should be in the right direction.