Announcement

Collapse
No announcement yet.

ComputeonClose Problem

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

  • ComputeonClose Problem

    I have applied setComputeOnClose(true) to the _BlauDS_Stoch studies (found in the Library Function folder) and am not getting correct data on the chart.
    Additionally, the chart does not update after each bar close , and needs constant refreshing to show correct bar data.

    The chart on the right is with compute on close applied and the one on the left is without. My charts are set to compute tick by tick.

    Does setting the compute on bar close not work with these indicators??

    I also tried using getValue(-1) in the return to accomplish the same thing, but am not sure if the correct data is being shown by this method.
    As you can see from the Data Box, a RSI indicator shows correct data, when one is set to computeonclose, and the other not. The RSI plots correctly also without having to refresh charts.

    Any help on this matter would be appreciated.Thanks.
    angelo
    Attached Files
    ang.

  • #2
    Need to see script

    I'll need to see your script to help you out with this problem.

    Are you doing the computation on the basis of the close() value each interval, or something else?

    This issue is thinly traded, so I wonder if that's got something to do with the interval data you're receiving?

    I can tell more when I see the script.

    -Fred

    Comment


    • #3
      _BlauDS_Stoch studies

      Hi Fred,

      Here is the code from the FunctionLibrary files. When setComputeonClose is inserted in premain, I have to refresh charts to get them to display correct data.

      Is it because the way the code is written , that it will not compute the values on the closing bar?

      Thanks for taking a look!

      PHP Code:
      /********************************************************* 
      angelo
      ang.

      Comment


      • #4
        Sorry, code didn't post correctly when pasted in PHP window.
        Here is the code :

        /************************************************** *******
        Alexis C. Montenegro © August 2005
        Use and/or modify this code freely. If you redistribute it
        please include this and/or any other comment blocks and a
        description of any changes you make.
        ************************************************** ********/

        // NOTE:
        // This efs requires amBlauStudies.efsLib in the FunctionLibrary folder.
        // If you do not have this file you can download it at the link below.
        // http://share.esignal.com/groupconten...ies&groupid=10

        function preMain() {
        setPriceStudy(false);
        setStudyTitle("Double Smoothed Stochastic(a)");
        setCursorLabelName("DSStoch",0);
        setCursorLabelName("DSStochSig",1);
        setDefaultBarFgColor(Color.blue,0);
        setDefaultBarFgColor(Color.red,1);
        setDefaultBarThickness(2, 0); // added
        setDefaultBarThickness(2, 1); // added
        setShowTitleParameters(true);
        setComputeOnClose(true); //added
        }

        var amLib = addLibrary("amBlauStudies.efsLib");
        var DS_Stoch = null;
        var DS_Sig = null;


        function main(q,r,s,u) {
        if(q==null) q = 14;
        if(r==null) r = 3;
        if(s==null) s = 3;
        if(u==null) u = 5;


        if(DS_Stoch==null) DS_Stoch = amLib.amDSStoch(q,r,s);
        if(DS_Sig==null) DS_Sig = ema(u,DS_Stoch);


        return new Array (DS_Stoch.getValue(0),DS_Sig.getValue(0));
        }
        ang.

        Comment

        Working...
        X