Announcement

Collapse
No announcement yet.

Index Tracking

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

  • Index Tracking

    tracking previous bar indexes (e.g. when re-drawing trendlines) can be difficult due to bar re-numbering (... -3, -2, -1, 0).

    this could be made easier with something like:

    getAbsoluteBarIndex()

    whose returned values were ... -3 -2 -1 0 +1 +2 +3 ...

    0 would be the last bar on the chart at study loadtime. Each arriving bar would then be assigned a +ve incrementing value.

    This would allow index values to be stored/referenced knowing they won't change.
    Paul Williams
    Strategy & Applications
    www.futurenets.co.uk

  • #2
    futurenets,

    One way to do somthing similar is...

    PHP Code:

    var vBarCount 0;

    function 
    main() {

    if (
    getBarState() == BARSTATE_NEWBARvBarCount++;

    ...


    vBarCount will always be a static number increasing from 0 (oldest bar) to the current bar.
    Regards,
    Jay F.
    Product Manager
    _____________________________________
    Have a suggestion to improve our products?
    Click Support --> Request a Feature in eSignal 11

    Comment


    • #3
      Index tracking

      Thanks Jay

      I was using:

      if (getBarState() == BARSTATE_NEWBAR && vOSFlag == true) vOS += 1;
      if (vOSFlag == false && getCurrentBarIndex() == 0) vOSFlag = true;
      vBarNow = getCurrentBarIndex() + vOS; // ... -3 -2 -1 0 +1 +2 +3 ...

      it would just be nice to forget this and have a function to do the same.
      Paul Williams
      Strategy & Applications
      www.futurenets.co.uk

      Comment


      • #4
        Hello Futurenets,

        Please give us a detailed example of what you are trying to accomplish. We may be able to give you some other options to consider that may simplify your efforts.

        Thanks,
        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
          Index Tracking

          thanks Jason. all is working well now. we discussed the solution earlier via email.
          Paul Williams
          Strategy & Applications
          www.futurenets.co.uk

          Comment

          Working...
          X