Announcement

Collapse
No announcement yet.

Calculating closing price in EFS

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

  • Calculating closing price in EFS

    Hello,

    I trade Eurex. The PrevClose.efs formula calculates closing
    price using the Daily Settlement Price which can be several points
    different to actual closing price. Not only is the Gap affected, but so
    are the daily pivots. Is there any way to correct this so that the actual
    closing price is calculated?

    Thanks

    PS: I tried to attach example but no luck. Must have missed something in the faq!

  • #2
    Hello ozfader,

    In the Prev Close.efs the close(inv("D")) will return the settlement price of the previous day from the daily chart by default. To get the last close from the last bar of the previous day you will need to do several things. First, set your chart's time template to only show the bars within your desired range of time for the session of the symbol you are charting. This will allow you to detect within your EFS as it loads what the last bar of the previous day was based on the bars loaded in the chart. In your formula, use the day() function to accomplish this with the following conditional statement.

    PHP Code:
    var nPrevClose null;

    function 
    main() {
        if (
    day(0) != day(-1)) {
            
    nPrevClose close(-1);
        }
        
        return 
    nPrevClose;

    This condition evaluates to true on the first bar of the day and sets the nPrevClose variable to the close from the last bar of the previous day. Let us know it this helps.
    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
      Many thanks Jason.

      Alan

      Comment


      • #4
        Hello Alan,

        You are most welcome. You may also want to check out this post from earlier today regarding the Eurex settlement. I believe this will resolve this issue as well. Try the Prev Close.efs after Aug 11 and let us know if this resolves the issue as well.
        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
          Works a treat on the Prev Close.efs formula Jason, many thanks again.

          How can I to apply that to PivotPointAll.efs?

          Alan

          Comment

          Working...
          X