Announcement

Collapse
No announcement yet.

offsetSeries()

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

  • offsetSeries()

    Hello. I have scripted a simple EFS study. What I would like to do next is add a user defined input for phase shifting or offsetting the plot to the "right". It's my understanding that the applicable function is the offsetSeries() for shifting the study plot with a positive offset.

    I have been looking for a sample EFS which allows the user to input an offset quantity. I did a couple of searches on this forum but found nothing specific. Can anyone point me toward an EFS which has this user defined input.?

    Many Thanks, QT.

  • #2
    Re: offsetSeries()

    Place something like this in the preMain() function:

    var fp1 = new FunctionParamater("vOffset", FunctionParamater.NUMBER);
    fp1.setName("Offset Number of Bars");
    fp1.setDefault(0);

    This part of the script will cause a dialog to be present in the edit studies panel that allows you to change the default offset from 0 to another number. The script creates a variable named vOffset. vOffset can be used anyway you use any other variable such as offsetSeries(vOffset)...

    I have not use the offsetSeries() function so make sure you understand the context of whether the offset should be a positive or negative number and modify what I have shown here appropriately.

    Mike Scott
    Tarzna, CA

    Originally posted by quanttrader
    Hello. I have scripted a simple EFS study. What I would like to do next is add a user defined input for phase shifting or offsetting the plot to the "right". It's my understanding that the applicable function is the offsetSeries() for shifting the study plot with a positive offset.

    I have been looking for a sample EFS which allows the user to input an offset quantity. I did a couple of searches on this forum but found nothing specific. Can anyone point me toward an EFS which has this user defined input.?

    Many Thanks, QT.
    ....Mike

    Comment

    Working...
    X