Announcement

Collapse
No announcement yet.

Offsetting a Plot

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Offsetting a Plot

    I would like to take an EFS indicator I have written and plot it offfset X bars to the right. Could someone suggest how that might be achieved?

    Im sure it is very simple but I could not find out how from looking at the help.

    Cheers,
    Nick.

  • #2
    Hi,


    Well, there are two ways of approaching this.

    If you are ok with your indicator running a few bars behind (and I doubt you would be, but you never know so I am including this here because it would be the simple way of doing it) would be
    to just store what you would have been returning into an array and once the array is of the proper length you can start returning the oldest element of the array (I would use unshift to add and pop to remove).

    The other way, which would allow you to project the indicator into the future, which is what I assume you want to do, would be to use the drawLineRelative() command instead of using return() as a method of drawing values. This is more complex, but there are some examples out there on how to do this. You might try searching the archive for drawLineRelative and see where others have had the same question.

    Garth
    Garth

    Comment


    • #3
      Thanks for the prompt reply. I'll check out the method you mention sounds like that will do the Job.

      Cheers,
      Nick.

      Comment

      Working...
      X