Hello,
I’ve only just started with building my own indicators, I do like it a lot and the forum has helped me a lot while doing so. Currently I’ve run into a problem which is explained here below.
I do want to state that the code is far from finished, I’m setting R to equal 0 when the condition isn’t met, just for visualisation purposes!
I’m building an indicator based on pivot points, in my code I detect if a there is a bar which is higher than todays and the day before yesterdays bar. If the condition is true I want to project the Dhigh of the previous bar on the previous bar. (I’ve included the code beneath the text). When I project the data on my chart it is projected on the present bar rather than on the previous bar. So my question is how can I project the data on the previous bar?
//variables
//todays high
a=Dhigh(0)
//yesterdays high
b=Dhigh(1)
//day before yesterday
c=Dhigh(2)
//variables in the function
//R is price of pivot high
//conditions
condition1=b>a
condition2=b>c
//function
If condition1 and condition2 then
r=Dhigh(1)
else
r=0
endif
//result
Return r
I want to thank everyne for helping me outYours sincerelyBert
Drawing in the past is only possible with the new prorealtime version (10.3), that’s why you can’t do it with your current code, it needs newest instructions built-in in the new build of PRT.
I’m using the manual on the PRT website, it appears it indeed is version 10.2. Is there a place where I can find the latest intructions for 10.3 or could you say the code for it so i can search with the right keyword?
Greetings Bert
You can have a look at graphical instructions in our prorealtime documentation here on the website.
Thank you very much for the help
greetings
Bert
Hello, I tried to obtain the second order pivot points today, I want to mark them with another arrow in a different color. I ran into the following problem, I need a function which compares the different results rendered in the first function and picks out the highest one of a series. Until now I haven’t been able to come up with something thats works, are there any tips or could someone show me the way? I tried different functions found in the clossary on this website but nothing worked 🙁 I’ve included a picture of the code, the code of my previous question which is working fine and the selected data I want to extract from the first code and I want to represent on the graph. yours sincerely Bert
You need first to store the price value of each first function ‘ arrow:
if condition1 and condition2 then
val = Dhigh(1)
....
..
endif
Then you’ll be able to access the “val” array of data in the past and make a comparison of which is the highest of the series within the last X periods:
DRAWARROW(barindex,highest[20](val))
Of course you’ll have to fetch the good barindex if you want to draw the red arrow at the exact candle in the past. You may find useful this code snippet that do this job (example 2 for drawing segment) :
http://www.prorealcode.com/documentation/drawsegment/