Announcement

Collapse
No announcement yet.

GetSeries & maintaining higher time frame tick data in a lower time frame

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

  • GetSeries & maintaining higher time frame tick data in a lower time frame

    I would like to have the correct and most efficient way of calling a series from another series and return data from a higher timeframe into a lower timeframe when using ticks.

    This works for me using minute data higher time frame like 5min in 1min chart:-

    function preMain(){
    setStudyTitle("RSCI");
    setCursorLabelName("RSCI");
    }

    var CCI = null;
    var RSI = null;

    function main(){
    if(CCI == null) CCI = cci(20, inv(5));
    if(RSI == null) RSI = rsi(14, getSeries(CCI));

    return getSeries(RSI);
    }


    But this does not because the indicator does not average itself as with minutes using ticks say in a 1500T chart (using minutes from higher timeframe does work in lower time frame tick chart using above efs):-


    function preMain(){
    setStudyTitle("RSCI");
    setCursorLabelName("RSCI");
    }

    var CCI = null;
    var RSI = null;

    function main(){
    if(CCI == null) CCI = cci(20, inv("4500T"));
    if(RSI == null) RSI = rsi(14, getSeries(CCI));

    return getSeries(RSI);
    }

    Can anyone explain what is wrong and how it can be corrected.

    Robert

  • #2
    Robert
    The issue you are seeing is caused by a bug in the efs engine's synchronization between tick based intervals that I have already reported to eSignal
    As to making the formula more efficient see the examples in the image enclosed below. Also search the forum as this topic has been covered at length before
    Alex




    Originally posted by rcamrn123 View Post
    I would like to have the correct and most efficient way of calling a series from another series and return data from a higher timeframe into a lower timeframe when using ticks.

    This works for me using minute data higher time frame like 5min in 1min chart:-

    function preMain(){
    setStudyTitle("RSCI");
    setCursorLabelName("RSCI");
    }

    var CCI = null;
    var RSI = null;

    function main(){
    if(CCI == null) CCI = cci(20, inv(5));
    if(RSI == null) RSI = rsi(14, getSeries(CCI));

    return getSeries(RSI);
    }


    But this does not because the indicator does not average itself as with minutes using ticks say in a 1500T chart (using minutes from higher timeframe does work in lower time frame tick chart using above efs):-


    function preMain(){
    setStudyTitle("RSCI");
    setCursorLabelName("RSCI");
    }

    var CCI = null;
    var RSI = null;

    function main(){
    if(CCI == null) CCI = cci(20, inv("4500T"));
    if(RSI == null) RSI = rsi(14, getSeries(CCI));

    return getSeries(RSI);
    }

    Can anyone explain what is wrong and how it can be corrected.

    Robert

    Comment


    • #3
      Alex,

      Thank you for your response and coding advice.

      Concerning display of graphics in a lower timeframe from a higher timeframe how do you code it so that if the value that performs a graphic routine changes in later lower time frame bars where any graphics that have been drawn will be cleared.

      the value displayed from getSeries() will self correct as per coding already given but I can't see how to do it with graphics.

      any advice would be appreciated.

      Robert

      Comment


      • #4
        There's two ways to draw:

        1. Return values from your main function whose drawing styles are setup in the preMain().

        2. The draw routines in the efs library. If you want old values from these calls updated then you reuse their respective tag field(s). Continually generating new tag values adds new drawing to the chart.

        Comment

        Working...
        X