Shift Indicators Forward

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #13448 quote
    liammaher11
    Participant
    New

    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

    #13453 quote
    Nicolas
    Keymaster
    Master

    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.

    #16034 quote
    MDS
    Participant
    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

    #16054 quote
    Nicolas
    Keymaster
    Master

    @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.

    #16087 quote
    MDS
    Participant
    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

    #16091 quote
    Nicolas
    Keymaster
    Master

    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.

    #16130 quote
    MDS
    Participant
    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.

    #16135 quote
    Nicolas
    Keymaster
    Master

    Nope, since this is the new graphical components possibilities of the version 10.3

    #19029 quote
    MDS
    Participant
    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

    #19030 quote
    MDS
    Participant
    Junior

    bat->but

    #19044 quote
    Nicolas
    Keymaster
    Master

    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.

    #48308 quote
    Degardin Arnaud
    Participant
    Junior

    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

    #48309 quote
    Nicolas
    Keymaster
    Master

    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
Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.

Shift Indicators Forward


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 12 replies,
has 4 voices, and was last updated by Nicolas
8 years, 4 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 09/21/2016
Status: Active
Attachments: No files
Logo Logo
Loading...