Announcement

Collapse
No announcement yet.

alignment problem when using close([Symbol]);

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

  • alignment problem when using close([Symbol]);

    I discovered this problem working with one minute bars. I cannot find a work around.

    If a security has no trades during a one minute period, eSignal does not draw a bar or leave an empty space. So, if I want to plot an indicator, such as $VIX using close([Symbol]) in a study below the chart, the first time either the security or VIX skips a bar due to no activity, the study is not aligned with security.

    As a hard example, open an advanced chart of $VIX. Create an EFS formula which is simply one line in main ():

    return (close (0,"MMM"));

    $VIX misses bar 09/19/2003 14:57, so below the previous 14:56 bar of the vix, the study plots the 14:57 bar of MMM. This problem is cumulative as you progress backwards.

    I am somewhat new to efs, so maybe I am missing an obvious solution. But, it seems I need one of two things to fix this:

    1. Allow a chart option for eSignal to maintain alignment by plotting an empty space when a security does not trade in a one minute period - there would then be a fixed 390 bars during any day.

    2. Allow a method to get a value specified by an exact date/time. I could get the date and time of the current bar (of $VIX in the example above) and call up the matching value (of MMM in the example above) by that date/time - maintaining alignment.

    Any solutions to this problem?

  • #2
    Solution...

    Loop back until you find the bar/indicator that matches the bartime of the symbol you are using...

    For example...

    // record current MMM time.
    var mmmtime = getValue("rawtime",0,0,"MMM");

    // Find matching VIS time
    var i = 0;
    while (mmmtime > getValue("rawtime",i,0,"$VIX") {
    i--;
    }

    // Record VIX value for matching time to MMM
    var VIXValue = getValue("Close",i.0."$VIX");

    Hope this helps..

    Brad
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment


    • #3
      RE: Reply to post 'alignment problem when using close([Symbol]);'

      Thanks!

      -----Original Message-----
      From: [email protected] [mailto:[email protected]]=20
      Sent: Sunday, September 21, 2003 10:16 PM
      To: Mike Bielinski
      Subject: Reply to post 'alignment problem when using close([Symbol]);'


      Hello bullman,

      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      Comment

      Working...
      X