Dear Nicolas,
I am having trouble transferring the below code into V11 and would be grateful if you could have a look and give me any pointers as to why I am having difficulties. It is coded for use in a 1-hour chart with 2k units of info.
Many thanks
Robert
defparam CALCULATEONLASTBARS=8000
//y=0
//m=0
//d=0
//h=0
if year=y and month=m and day=d and hour=ho then
once pole=barindex
poleb=barindex
polea=high
//DRAWVLINE(pole)coloured(0,255,255)
endif
DRAWBARCHART(open, high, low, close)
//////////////////////////////////////////////high finder///////////////////////////////////////////////////
dc1=(poleb[0]-barindex)/7000 //arch
dc=(((poleb[0]-barindex[0])))/(50+dc1)//height
dcc1=SQRT(polea)///depth of bracket
dcc=SQRT(polea)+dc
dccc=dcc1+(dc*dcc)+polea
up1=dccc+dcc1
Drawtext ("-",barindex[pole],up1[pole],dialog,bold,12)coloured(255,255,0)
centre=dccc
Drawtext ("-",barindex[pole],centre[0],dialog,bold,14)coloured(255,0,255)
return
Here is the result I get with these settings:
y=2020
m=12
d=8
ho=7
I don’t know what it is supposed to do, but feels like it works?
Here is the result I get with these settings:
y=2020
m=12
d=8
ho=7
I don’t know what it is supposed to do, but feels like it works?
Thanks for getting back to me Nicholas- I take it the left-hand image is from V11?, I am looking to get the lines in the same place as they are on V10.3, I have contacted Prorealtime, who a) pointed me in your direction, and b)suggested that the coding of ‘barindex’ was different in V11?…
Forgive me, I forgot to put my settings in …
y=2020
m=12
d=18
ho=7
left image is on a daily chart. Do you have pictures on how it should look like in previous version? There is no difference in BARINDEX between the versions.
The picture I supplied was from V10.3 using a 1-hour timeframe and 2k units of info…for some reason V11 doesn’t seem to want to ‘paint’ the text in the same place….and produces the white trace line…I’m not sure where that comes from!
So, the picture from your first post is how it should look but the code is applied on v10.3, right?
Ok, so that below code will fix your problem. In PRT v11, you shouldn’t use the ONCE instruction in a conditionnal block (IF/ENDIF).
defparam CALCULATEONLASTBARS=8000
//y=0
//m=0
//d=0
//h=0
pole=0
if year=y and month=m and day=d and hour=ho then
//once pole=barindex
poleb=barindex
polea=high
//DRAWVLINE(pole)coloured(0,255,255)
endif
DRAWBARCHART(open, high, low, close)
//////////////////////////////////////////////high finder///////////////////////////////////////////////////
dc1=(poleb[0]-barindex)/7000 //arch
dc=(((poleb[0]-barindex[0])))/(50+dc1)//height
dcc1=SQRT(polea)///depth of bracket
dcc=SQRT(polea)+dc
dccc=dcc1+(dc*dcc)+polea
up1=dccc+dcc1
Drawtext ("-",barindex[pole],up1[pole],dialog,bold,12)coloured(255,255,0)
centre=dccc
Drawtext ("-",barindex[pole],centre[0],dialog,bold,14)coloured(255,0,255)
return