Announcement

Collapse
No announcement yet.

Add-on study insrted in watch list not being saved on exit

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

  • Add-on study insrted in watch list not being saved on exit

    I'm inserting an EFS study which I created into my Watch List. The study is working fine, and displays the correct data (price data). So I know the EFS study is working fine. The only problem is that when I exit eS (and save Page) and then re-start, the study is gone! All other data on my watch list: Symbol, Description, Last, % Change, Change and Comment fields are OK, and are there when I re-start eS. I'm using v 11.1.2272.1166 64-bit. Anyone know what the problem might be?? Thanks for your help.
    Last edited by Dr Kildare; 04-03-2011, 11:55 PM.

  • #2
    Dr Kildare,
    thank you very much for this information. This issue was reproduced by us and was added to our tracking system.
    But it has additional terms. It's reproduced only if you do not use setCursorLabelName() for returned values. As an alternative, please, for every returned series set the label name using function setCursorLabelName in preMain, as it’s described in the following KB article ( http://kb.esignalcentral.com/article...ticle=2202&p=4 )

    Thank you.
    Last edited by eSignal_VladimirS; 04-04-2011, 02:13 AM.

    Comment


    • #3
      Hi Vladimir -- thanks for your assistance. I rewrote my EFS script using SetCursorLabelName for the returned series. However. it's still not being saved in my Watch List upon exit.

      I'm attaching my script for your review, and hope you can offer me a solution. Thanks and regards.
      Attached Files

      Comment


      • #4
        Dr Kildare,
        thank you for your script, this information is very valuable for us.
        In spite of the fact that you wrote setCursorLabelName in preMain, in reality this function was not executed. Let me explain:
        preMain function is executed by the EFS engine only once when a study is initially applied to the Watch List. Thus, the code cited below will be executed only once
        PHP Code:
        var vLoaded false;
        var 
        vEdit false;
        var 
        cSym "";
        var 
        vSym "$SPX";
        var 
        BasePriceStock null;
        var 
        BasePriceIndex null;

        function 
        preMain() {
            if (
        vLoaded == false) {    
                
        //true-thread
                
        setDefaultBarFgColor(Color.yellow);
            } else {
                
        //else-thread
                
        if (vEdit == false) {
                    
        setStudyTitle(cSym " vs. " vSym " ");
                    
        setCursorLabelName(cSym "\/" vSym);
                    
        setCursorLabelName("RelPerf");
                } else {
                    
        setStudyTitle(cSym " vs. ");
                    
        setCursorLabelName(cSym "\/" vSym);
                    
        setCursorLabelName("RelPerf");
                }
            }

        When preMain is executing, the program checks vLoaded first of all. At the beginning of the program vLoaded was defined as false, thus, owing to if (vLoaded == false) will be executed only
        setDefaultBarFgColor(Color.yellow); .
        To execute else-thread you should define vLoaded as true. In this case code marked as //else-thread will be executed, and it will execute setCursorLabelName twice and your new row gets name by its last calling - RelPerf.
        More details about the peculiarities of execution of main and preMain functions you can read in this KB article http://kb.esignalcentral.com/article...ticle=2793&p=4
        Let me repeat that this is an alternative for the temporary decision of the fact that the row cannot be saved in WatchList after the application exit.
        Thank you.
        Last edited by eSignal_VladimirS; 04-05-2011, 04:04 AM.

        Comment


        • #5
          Hi Vladimir -- thanks for the insight into EFS programming. I understand what you mean when you say that SetCursoLabelName does not execute as vLoaded is initially set as False. However, in function main, preMain gets executed again, and this time vLoaded is True.

          But it sounds like you're saying that for the purposes of the execution on a Watch List, preMain is executed only once. Whereas on a Chart (as I've been using until now) it can get executed a 2nd time. Is this correct?

          If so, I'll have to rewrite accordingly. Thanks.

          Comment


          • #6
            Dr Kildare
            it sounds like you're saying that for the purposes of the execution on a Watch List, preMain is executed only once.
            Whereas on a Chart (as I've been using until now) it can get executed a 2nd time. Is this correct?
            I'm sorry, I missed the preMain() call in line 42 of your script.
            Let me explain: it's possible to recall preMain from main during execution on a Watch List, you can verify this loading
            on Watch List with real time script posted below (cells should change color, which means that preMain is executed)
            PHP Code:
            var color Color.maroon;
            function 
            preMain()
            {
                    
            setCursorLabelName("EMA10");
                    
            setDefaultBarBgColor(color);
            }

            0;
            function 
            main()
            {
                    
            = (i+1)%100 ;
                    if ( 
            i%== )
                    {
                        
            color Color.maroon;
                    }
                    else{
                        
            color Color.darkgreen;
                    }
                    
            preMain();

                    return 
            ema(10);

            but function setCursorLabelName is executed only once on the initial call of preMain, because it sets the meta information, which is common for all lines - the name of column.
            Thank you

            Comment


            • #7
              Hi Vladimir -- I rewrote the script based on your feedback and the indicator is now saving on WL. Thanks for your help. Appreciate it.

              Comment


              • #8
                Dr Kildare

                You're welcome.

                Thank you for bringing this issue to our attention

                Comment

                Working...
                X