Announcement

Collapse
No announcement yet.

EFS plotting question

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

  • EFS plotting question

    This may be a stupid question, but is there a way to get an indicator to plot one price bar back? I modified the speed.efs (file attached) for tick and volume charts, but in order to get the time for the bar that needs to be plotted, you have to use the opening time of the next bar (var TimeDiff = rawtime(0)-rawtime(-1)) so the histogram then plots under that new bar instead of under the price bar that it's actually indicating. It's not a big deal in real time, but it's annoying when your trying to look back for studying and comparison purposes.

    I have a very limited understanding of efs, so any suggestions for improvements are most welcome.

    I also have an efs that plots just the time for tick and volume price bars, but it has the same problem of plotting one bar in advance. If anyone is interested I can post it.
    Attached Files

  • #2
    Hello opstock,

    To move the plot one bar back, you would use the setBar() function. All you need to do is change the return statement to return null for the current bar and use the setBar() function just before it like below. Your return statement needs to return null to create an empty series that the setBar() function can modify.

    PHP Code:
        //return nSpeed;
        
        
    setBar(Bar.Value, -1nSpeed);
        return 
    null
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      Jason,

      Thanks much! There seems to be a problem though with the fix. The values are plotting properly now under the right bar, but the colors seem to be plotting in a random basis. Did I fix it properly? Any ideas?
      Attached Files

      Comment


      • #4
        Hello opstock,

        You did nothing wrong. We just need to change the logic that colors the bars in addition to the previous modification. This can be accomplished with setBar() as well. Change lines 48 and 49 to the following.

        PHP Code:
        if (nSpeed nSpeed1setBar(Bar.FgColor, -1Color.blue);
        if (
        nSpeed nSpeed1setBar(Bar.FgColor, -1Color.aqua); 
        Jason K.
        Project Manager
        eSignal - an Interactive Data company

        EFS KnowledgeBase
        JavaScript for EFS Video Series
        EFS Beginner Tutorial Series
        EFS Glossary
        Custom EFS Development Policy

        New User Orientation

        Comment


        • #5
          Jason,

          That did the trick. Thanks so much for your help!

          I'll attach the fixed efs in case anyone else wants it.
          Attached Files

          Comment

          Working...
          X