Announcement

Collapse
No announcement yet.

Is there a way in an efs to calculate the average on 1 min bars for 20 days back?

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

  • Is there a way in an efs to calculate the average on 1 min bars for 20 days back?

    I may impliment a study that uses the average of the 1 min HLC/3 values for 20 days. This not to plot as a series but to have as a constant for the day to us in another calculation that would result in a series for the day.

    Thanks,

    jgr

  • #2
    Yes, you can create an "OffsetSeries" to handle this. One word of caution though, when you combine two time frames onto one chart, this can possibly create a problem and I'll explain why.

    Let's say you are running a 5 minute chart and want to know the 1 minute AVG (as you suggested). Well, when you load this efs onto the 5 minute chart, esignal SYNCS the 1 minute data to the 5 minute bars. Thus, you get the AVG value at the END of each 5 minute bar.

    Now, as you run this code in RT, you get the CURRENT 1 min AVG values (thus not at the end of the 5 minute bars).

    This means you could essentially be creating an efs that may not backtest accurately or could result in different RT actions than BT actions.

    Here is an example of an OffsetSeries.

    PHP Code:
         var vSymbol getSymbol()+", 1";

         
    MALevel offsetSeries(eval("sma")(20,eval("high")(sym(vSymbol))),0); 
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment


    • #3
      Doji3333

      Thanks for the help. The author of this indicator I am thinking of programming, uses the average of 20 days of 1 min values (over 4000 points). Then once that is obtained at the start of the day, it is used essentially as a constant for the calculations during the current day.

      I am not sure that all of that is really necessary. Does your code do that? My thinking is that maybe I could by with the HLC/3 of the Daily (or 1/2 hourly) values going back 20 days and not 1 minute values.

      Doji, is an interesting word. Apparently means Boy in Japanese. I visited the Sackler Gallery at the Smithsonian last week end and they have the Shuten Doji exhibit. That is a popular tale about a very bad boy.

      Comment

      Working...
      X