Announcement

Collapse
No announcement yet.

The Composite Index

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

  • The Composite Index

    Does anyone know or have created "The Composite Index" indicator by Constance Brown in the eSignal software? I have attached the Meta Stock format. I would like to use this indicator in eSignal. If you can help please let me know. Thank You.

    Ashraf


    The Composite Index In The Metastock Format



    A=RSI(14)-Ref(RSI(14),-9)+Mov(RSI(3),3,S);

    Plot1 = Mov(A,13,S);

    Plot2 = Mov(A,33,S);

    A;Plot1;Plot2;

  • #2
    Yes,
    I would also like an EFS version.

    I can supply the TradeStation Format if it would he helpful to convert into EFS.

    Cheers, Al.

    Comment


    • #3
      Alrados,

      Please send me the TS format. Thank you.

      Ashraf

      Comment


      • #4
        Hi Ashraf,

        I tried to do it. Here is the code. Hope it will be helpful.

        PHP Code:
        function preMain() {

            
        setPriceStudy(false);
            
        setStudyTitle("Composite Index");
            
        setCursorLabelName("A",0);
            
        setCursorLabelName("SMA(13)",1);
            
        setCursorLabelName("SMA(33)",2);
            
        setDefaultBarFgColor(Color.lime,0);
            
        setDefaultBarFgColor(Color.blue,1);
            
        setDefaultBarFgColor(Color.red,2);
            
        setPlotType(PLOTTYPE_LINE,0); 
            
        setPlotType(PLOTTYPE_LINE,1); 
            
        setPlotType(PLOTTYPE_LINE,2); 
            
        setDefaultBarThickness(1,0);
            
        askForInput();
         
           
        }

        function 
        calc(){
              
        //RSI(14)-Ref(RSI(14),-9)+Mov(RSI(3),3,S); 
            
        return rsi(14,0)-rsi(14,-9)+sma(3,rsi(3));
        }


        function 
        main() {

            var 
        A=efsInternal("calc");

            
        //Plot1 = Mov(A,13,S);
            
        var Plot1 sma(13,A);
            
            
        //Plot2 = Mov(A,33,S);
            
        var Plot2 sma(33,A);
         
         
            return new Array (
        A,Plot1,Plot2);
             

        EMET

        Comment


        • #5
          Guys, the Composite Index EFS doesn't update in real time on tick charts. Anyone with any ideas?
          Cheers, Al.

          Comment


          • #6
            I believe the issue is that you need to use the getSeries() function to retrieve the study series for it to plot.

            Try the following (I added a "bInit" routine for efficiency so the series are created only once instead of on every tick):
            PHP Code:
            function preMain() { 

                
            setPriceStudy(false); 
                
            setStudyTitle("Composite Index"); 
                
            setCursorLabelName("A",0); 
                
            setCursorLabelName("SMA(13)",1); 
                
            setCursorLabelName("SMA(33)",2); 
                
            setDefaultBarFgColor(Color.lime,0); 
                
            setDefaultBarFgColor(Color.blue,1); 
                
            setDefaultBarFgColor(Color.red,2); 
                
            setPlotType(PLOTTYPE_LINE,0);  
                
            setPlotType(PLOTTYPE_LINE,1);  
                
            setPlotType(PLOTTYPE_LINE,2);  
                
            setDefaultBarThickness(1,0); 
                
            //askForInput();  //function main() has no parameters to input
              
                


            function 
            calc(){ 
                  
            //RSI(14)-Ref(RSI(14),-9)+Mov(RSI(3),3,S);  
                
            return rsi(14,0)-rsi(14,-9)+sma(3,rsi(3)); 

            var 
            bInit=false;
            var 
            A,Plot1,Plot2;
            function 
            main() { 
                if(!
            bInit){
                    
            A=getSeries(efsInternal("calc")); 
                    
            //Plot1 = Mov(A,13,S); 
                    
            Plot1 getSeries(sma(13,A)); 
                    
            //Plot2 = Mov(A,33,S); 
                    
            Plot2 getSeries(sma(33,A)); 
                    
            bInit=true;
                }
              
                return new Array (
            A,Plot1,Plot2); 
                  

            Last edited by waynecd; 12-07-2012, 01:44 PM.

            Comment


            • #7
              Waynecd, fantastic. Can't thank you enough. I'll put it to the test next week and let you know how it goes.
              Cheers, Al.

              Comment


              • #8
                Hope it works as you expect.

                Wayne

                Comment


                • #9
                  FWIW the original formula posted by emet works just fine and contrary to what waynecd states it does not require the getSeries() function to retrieve the series
                  Alex

                  Comment

                  Working...
                  X