Hi All,
I am adding some custom indicators to a chart and coding them in the probuilder. I need to shift a couple of indicators forward[n] periods and shift one back[n] periods.
The easiest way to explain this is to look at the Ichimoku indicators. This set of indicators has 2 lines shifted 26 periods into the future forming a cloud and it also has current price plotted 26 periods in the past as a “range” check.
I originally tried this which I put together from another query:
myTKD9 = CALL TKD9
myKD9 = CALL KD9
a=myTKD9
b=myKD9
c=a+b
d=c/2
y=d[598]
return y
However this hasn’t achieved what I wanted.
Would be very grateful for any help or advice.
Many Thanks
Liam
Hi Liam,
It is not possible to draw at the right of the price charts (in the future), i’m sorry.
About drawing in the past, it is only possible with new version 10.3.
MDSParticipant
Junior
Hi Nicolas,
the Ichimoku indicator in prt draws at the right of the price, how can we do that?
How does that indicator achieve this?
I’m writing a forecaster on 10.2 version and I’d like to draw in the future.
Regards,
Mauro
@MDS
This is a very often asked question here 🙂
Ichimoku is calculated and rendered directly by the platform itself, because of a rendering engine limitation on client side, it is not possible actually for customers to achieve the same things by code. I don’t know if its plan to modify it in a short term, but PRT is aware of this and so they should do something for it in the future .. but don’t know when sorry.
MDSParticipant
Junior
Hi Nicolas,
Thank you very much.
OK, I’d like to find a workaround.
What about arrays?
Can I create one ?
Can I overwrite a system array that I don’t use for my indicator?
I have read about you can’t create array, but the situation could be changed.
THX a lot,
Regards,
Mauro
If you have been able to build arrays, it should have solve the problem, at least to have these values in memory. Unfortunately, it is not possible to build your own arrays, the best you could do is to set your values into different variables names .. but of course fetch them within a loop is no way possible.
MDSParticipant
Junior
<!–more–>ok Nic, last try.
In 10.2 version, can i use drawsegment or something similar?
I was not able to draw a segment.n
Any clue?
THX a lot,
Regards,
Mauro.
Nope, since this is the new graphical components possibilities of the version 10.3
MDSParticipant
Junior
Hi all,
I’m trying the 10.3 prt version.
I’m tryng to plot the segments in the future… bat I can’t, it seems.
With the drawline is ok, but with the darwsegment instruction I didn’t succeede.
Any clue?
Thank at all
Not possible to draw a segment in the future, since a segment needs start and end coordinates and there is not barindex already known obviously.
Is it possibile to obtain the shifted value of an indicator in PRT ver 10.3?
i.e. I need MovingAverage of the x periods in the past… (like x bars before current in MT4, “shift” parameter)
Thanks
Sure Arnaud, let’s take an example with a 20 periods moving average for which you want to get the value from 13 bars ago:
ma20 = average[20]
value = ma20[13]
return value
or
ma20 = average[20][13]
return ma20