Announcement

Collapse
No announcement yet.

Time vertical lines

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

  • Time vertical lines

    Hello ACM,

    I would be so grateful if you could help me with revised version of this efs Im clueless with coding and very badly want to plot thinnest dotted vertical time lines in main chart area:

    PreMarket 400 color blue
    Open 930 color yellow
    TradeWindow1 935 color grey
    Tradewindow2 940 color grey
    Tradewindow3 1130 color grey
    Close 1600 color red

    Happy to pay for the help
    Last edited by NYSE; 08-04-2016, 10:23 AM.

  • #2
    NYSE
    As I also told you in my reply to your Private Message on this same topic I do not do custom programming
    If you are in need of custom programming you may want to contact one of the EFS Consultants listed in the EFS KnowledgeBase
    Alex


    Originally posted by NYSE View Post
    Hello ACM,

    I would be so grateful if you could help me with revised version of this efs Im clueless with coding and very badly want to plot thinnest dotted vertical time lines in main chart area:

    PreMarket 400 color blue
    Open 930 color yellow
    TradeWindow1 935 color grey
    Tradewindow2 940 color grey
    Tradewindow3 1130 color grey
    Close 1600 color red

    Happy to pay for the help

    Comment


    • #3
      Your request promted me to code this for my own use. BTW I'm not a programmer. Anyway here it is in case you can use it:

      PHP Code:
      //debugClear();

       
      function preMain() {

          var 
      aFPArray = new Array();
          
      setPriceStudy(true);
          
      setStudyTitle("Time Lines");
          var 
      timeArr = [400,530,735,1030,1130,1600];
          var 
      lineClr = [Color.green,Color.magenta,Color.brown,Color.black,Color.blue,Color.red];
          var 
      lineThick = [1,2,3,4,5,6];
          var 
      x=0y=0i=0;
          for(
      0timeArr.lengthi++){
              
      y="time"+i;
              
      aFPArray[x] = new FunctionParameter(yFunctionParameter.NUMBER);
              
      with(aFPArray[x++]){
                  
      setLowerLimit(1);
                  
      setDefault(timeArr[i]);
              }

              
      y="lineClr"+i;
              
      aFPArray[x] = new FunctionParameter(yFunctionParameter.COLOR);
              
      with(aFPArray[x++]){
                  
      setDefault(lineClr[i]);
              }

              
      y="lineThick"+i;
              
      aFPArray[x] = new FunctionParameter(yFunctionParameter.NUMBER);
              
      with(aFPArray[x++]){
                  
      setLowerLimit(1);
                  for (
      0lineThick.length-1x++) {
                      if (
      lineThick[x] != nulladdOption(lineThick[x]);
                  }
                  
      setDefault(2);
              }
          }
      }

      var 
      bInit=false;
      var 
      paramArr=[];

      function 
      main(time0,time1,time2,time3,time4,time5,
                    
      lineClr0,lineClr1,lineClr2,lineClr3,lineClr4,lineClr5,
                    
      lineThick0,lineThick1,lineThick2,lineThick3,lineThick4,lineThick5) {
                    
          if(!
      bInit){
              var 
      0temp=null;
              for(
      03+= 1){
                  
      paramArr.push([]);
              }
              for(
      06+= 1){
                  
      temp = eval("time" i);
                  if(
      temp != nullparamArr[0][i] = temp;
                  
      temp = eval("lineClr" i);
                  if(
      temp != nullparamArr[1][i] = temp;
                  
      temp = eval("lineThick" i);
                  if(
      temp != nullparamArr[2][i] = temp;
              }
              
      bInit=true;
          }
          
          
      DrawTrigger(paramArr);
       
          return 
      null;

      }

      var 
      flag0 0flag1 0timeCtr=0;
      var 
      DrawTriggerInit=false;
      function 
      DrawTrigger(paramArr){

          var 
      0;
          var 
      barTm = (hour(0)*100)+minute(0);

          if(!
      DrawTriggerInit){
              for(
      0paramArr[0].length+= 1){
                  if(
      paramArr[1][i] != nullsetDefaultBarFgColor(paramArr[1][i],i);
                  if(
      paramArr[2][i] != nullsetDefaultBarThickness(paramArr[2][i],i);
              }
              
      DrawTriggerInit=true;
          }
          
          if(
      flag1 == && barTm paramArr[0][timeCtr+1]) flag1 0;

          if(
      flag0 == && barTm >= paramArr[0][paramArr[0].length -1]){
              if(
      getCurrentBarCount()>1onAction0(paramArr[1][paramArr[1].length-1],paramArr[2][paramArr[2].length-1]);
              
      flag1 0;
              
      flag0 1;
          }

          if(
      flag1 == 0){
              for(
      0paramArr[0].length+= 1){
                  if((
      barTm >= paramArr[0][i] && barTm <paramArr[0][i+1])){
                      
      onAction0(paramArr[1][i],paramArr[2][i]);
                      
      flag0 0;
                      
      flag1 1;
                      
      timeCtr i;
                  }
              }
          }
      }

      function 
      onAction0(clrthick) {
          
      drawLineRelative(000999999PS_SOLIDthickclr"line"+rawtime(0));


      Wayne

      Comment


      • #4
        Added the option to select the # of lines that will plot.

        PHP Code:
        //debugClear();

         
        function preMain() {

            var 
        aFPArray = new Array();
            
        setPriceStudy(true);
            
        setStudyTitle("Time Lines");
            var 
        timeArr = [400,530,735,1030,1130,1600];
            var 
        lineClr = [Color.green,Color.magenta,Color.brown,Color.black,Color.blue,Color.red];
            var 
        lineThick = [1,2,3,4,5,6];
            var 
        x=0y=0i=0j=0;
            
        aFPArray[x] = new FunctionParameter("NumberOfLinesToDraw"FunctionParameter.NUMBER);
            
        with(aFPArray[x++]){
                
        setName("Draw The 1st ? Lines");//i.e., if NumberOfLinesToDraw==1 one line is drawn every time the 1st "time0" bar time is reached, if it==2 then two lines are drawn for "time0" and "time1", etc.
                
        setLowerLimit(1);
                
        setUpperLimit(6);
                for (
        0lineThick.lengthj++) {
                    if (
        lineThick[j] != nulladdOption(lineThick[j]);
                }
                
        setDefault(6);
            }
            for(
        0timeArr.lengthi++){
                
        y="time"+i;
                
        aFPArray[x] = new FunctionParameter(yFunctionParameter.NUMBER);
                
        with(aFPArray[x++]){
                    
        setLowerLimit(1);
                    
        setDefault(timeArr[i]);
                }

                
        y="lineClr"+i;
                
        aFPArray[x] = new FunctionParameter(yFunctionParameter.COLOR);
                
        with(aFPArray[x++]){
                    
        setDefault(lineClr[i]);
                }

                
        y="lineThick"+i;
                
        aFPArray[x] = new FunctionParameter(yFunctionParameter.NUMBER);
                
        with(aFPArray[x++]){
                    
        setLowerLimit(1);
                    for (
        0lineThick.lengthj++) {
                        if (
        lineThick[j] != nulladdOption(lineThick[j]);
                    }
                    
        setDefault(2);
                }
            }
        }

        var 
        bInit=false;
        var 
        paramArr=[];
        function 
        main(NumberOfLinesToDraw,
                      
        time0,time1,time2,time3,time4,time5,
                      
        lineClr0,lineClr1,lineClr2,lineClr3,lineClr4,lineClr5,
                      
        lineThick0,lineThick1,lineThick2,lineThick3,lineThick4,lineThick5) {

            if(
        isDWM()) return;
            if(!
        bInit){
                var 
        0temp=null;
                for(
        03+= 1){
                    
        paramArr.push([]);
                }
                for(
        06+= 1){
                    
        temp = eval("time" i);
                    if(
        temp != nullparamArr[0][i] = temp;
                    
        temp = eval("lineClr" i);
                    if(
        temp != nullparamArr[1][i] = temp;
                    
        temp = eval("lineThick" i);
                    if(
        temp != nullparamArr[2][i] = temp;
                }
                
        bInit=true;
            }
            
            
        DrawTrigger(paramArrNumberOfLinesToDraw);
         
            return 
        null;

        }

        var 
        flag0 0flag1 0timeCtr=0;
        var 
        DrawTriggerInit=false;
        function 
        DrawTrigger(paramArrNumberOfLinesToDraw){

            var 
        0;
            var 
        barTm = (hour(0)*100)+minute(0);

            if(!
        DrawTriggerInit){
                for(
        0paramArr[0].length+= 1){
                    if(
        paramArr[1][i] != nullsetDefaultBarFgColor(paramArr[1][i],i);
                    if(
        paramArr[2][i] != nullsetDefaultBarThickness(paramArr[2][i],i);
                }
                
        DrawTriggerInit=true;
            }
            
            if(
        flag1 == && barTm paramArr[0][timeCtr+1]) flag1 0;

            if(
        flag0 == && barTm >= paramArr[0][paramArr[0].length -1]){
                if(
        NumberOfLinesToDraw == && getCurrentBarCount()>1onAction0(paramArr[1][paramArr[1].length-1],paramArr[2][paramArr[2].length-1]);
                
        flag1 0;
                
        flag0 1;
            }

            if(
        flag1 == 0){
                for(
        0paramArr[0].length+= 1){
                    if((
        barTm >= paramArr[0][i] && barTm <paramArr[0][i+1])){
                        if(
        <= NumberOfLinesToDraw-1){ onAction0(paramArr[1][i],paramArr[2][i]);
                        
        debugPrintln("96: "+i+"\t"+NumberOfLinesToDraw);}
                        
        flag0 0;
                        
        flag1 1;
                        
        timeCtr i;
                    }
                }
            }
        }
        debugClear();

        function 
        onAction0(clrthick) {
            
        drawLineRelative(000999999PS_SOLIDthickclr"line"+rawtime(0));

        Wayne

        Comment


        • #5
          For some reason I can't edit so for the last script I would delete the "debugClear();" on line 113
          Wayne

          Comment


          • #6
            Had to make a minor correction:
            PHP Code:
            //debugClear();

             
            function preMain() {

                var 
            aFPArray = new Array();
                
            setPriceStudy(true);
                
            setStudyTitle("Time Lines");
                var 
            timeArr = [400,530,735,1030,1130,1600];
                var 
            lineClr = [Color.green,Color.magenta,Color.brown,Color.black,Color.blue,Color.red];
                var 
            lineThick = [1,2,3,4,5,6];
                var 
            x=0y=0i=0j=0;
                
            aFPArray[x] = new FunctionParameter("NumberOfLinesToDraw"FunctionParameter.NUMBER);
                
            with(aFPArray[x++]){
                    
            setName("Draw The 1st ? Lines");//i.e., if NumberOfLinesToDraw==1 one line is drawn every time the 1st "time0" bar time is reached, if it==2 then two lines are drawn for "time0" and "time1", etc.
                    
            setLowerLimit(1);
                    
            setUpperLimit(6);
                    for (
            0lineThick.lengthj++) {
                        
            addOption(1);
                    }
                    
            setDefault(6);
                }
                for(
            0timeArr.lengthi++){
                    
            y="time"+i;
                    
            aFPArray[x] = new FunctionParameter(yFunctionParameter.NUMBER);
                    
            with(aFPArray[x++]){
                        
            setLowerLimit(1);
                        
            setDefault(timeArr[i]);
                    }

                    
            y="lineClr"+i;
                    
            aFPArray[x] = new FunctionParameter(yFunctionParameter.COLOR);
                    
            with(aFPArray[x++]){
                        
            setDefault(lineClr[i]);
                    }

                    
            y="lineThick"+i;
                    
            aFPArray[x] = new FunctionParameter(yFunctionParameter.NUMBER);
                    
            with(aFPArray[x++]){
                        
            setLowerLimit(1);
                        for (
            0lineThick.lengthj++) {
                            if (
            lineThick[j] != nulladdOption(lineThick[j]);
                        }
                        
            setDefault(2);
                    }
                }
            }

            var 
            bInit=false;
            var 
            paramArr=[];
            function 
            main(NumberOfLinesToDraw,
                          
            time0,time1,time2,time3,time4,time5,
                          
            lineClr0,lineClr1,lineClr2,lineClr3,lineClr4,lineClr5,
                          
            lineThick0,lineThick1,lineThick2,lineThick3,lineThick4,lineThick5) {

                if(
            isDWM()) return;
                if(!
            bInit){
                    var 
            0temp=null;
                    for(
            03+= 1){
                        
            paramArr.push([]);
                    }
                    for(
            06+= 1){
                        
            temp = eval("time" i);
                        if(
            temp != nullparamArr[0][i] = temp;
                        
            temp = eval("lineClr" i);
                        if(
            temp != nullparamArr[1][i] = temp;
                        
            temp = eval("lineThick" i);
                        if(
            temp != nullparamArr[2][i] = temp;
                    }
                    
            bInit=true;
                }
                
                
            DrawTrigger(paramArrNumberOfLinesToDraw);
             
                return 
            null;

            }

            var 
            flag0 0flag1 0timeCtr=0;
            var 
            DrawTriggerInit=false;
            function 
            DrawTrigger(paramArrNumberOfLinesToDraw){

                var 
            0;
                var 
            barTm = (hour(0)*100)+minute(0);

                if(!
            DrawTriggerInit){
                    for(
            0paramArr[0].length+= 1){
                        if(
            paramArr[1][i] != nullsetDefaultBarFgColor(paramArr[1][i],i);
                        if(
            paramArr[2][i] != nullsetDefaultBarThickness(paramArr[2][i],i);
                    }
                    
            DrawTriggerInit=true;
                }
                
                if(
            flag1 == && barTm paramArr[0][timeCtr+1]) flag1 0;

                if(
            flag0 == && barTm >= paramArr[0][paramArr[0].length -1]){
                    if(
            NumberOfLinesToDraw == && getCurrentBarCount()>1onAction0(paramArr[1][paramArr[1].length-1],paramArr[2][paramArr[2].length-1]);
                    
            flag1 0;
                    
            flag0 1;
                }

                if(
            flag1 == 0){
                    for(
            0paramArr[0].length+= 1){
                        if((
            barTm >= paramArr[0][i] && barTm <paramArr[0][i+1])){
                            if(
            <= NumberOfLinesToDraw-1onAction0(paramArr[1][i],paramArr[2][i]);
                            
            flag0 0;
                            
            flag1 1;
                            
            timeCtr i;
                        }
                    }
                }
            }

            function 
            onAction0(clrthick) {
                
            drawLineRelative(000999999PS_SOLIDthickclr"line"+rawtime(0));

            Wayne

            Comment


            • #7
              Thank you very much for the work you did for me very much appreciated!

              However, I am unable to edit the study title, currently it is very long (see attached image). I actually needed 7 time lines >> (default values set to): 800, 930, 935, 940, 1030, 1115, 1600 (Colors, grey, white, aqua, aqua, dark grey, dark grey, navy. Line thickness 1

              Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	39.9 KB
ID:	243020

              Comment


              • #8
                I am unable to edit the study title
                See menu item "displayParam".
                I actually needed 7 time lines
                Added one more line.
                (default values set to): 800, 930, 935, 940, 1030, 1115, 1600 (Colors, grey, white, aqua, aqua, dark grey, dark grey, navy. Line thickness 1
                Set parameters as requested.


                PHP Code:
                //debugClear();

                 
                function preMain() {

                    var 
                aFPArray = new Array();
                    
                setPriceStudy(true);
                    
                setStudyTitle("Time Lines");
                    var 
                timeArr = [800,930,935,940,1030,1115,1600];
                    var 
                lineClr = [Color.grey,Color.white,Color.aqua,Color.aqua,Color.darkgrey,Color.darkgrey,Color.navy];
                    var 
                lineThick = [1,1,1,1,1,1,1];
                    var 
                x=0y=0i=0j=0;
                    
                aFPArray[x] = new FunctionParameter("NumberOfLinesToDraw"FunctionParameter.NUMBER);
                    
                with(aFPArray[x++]){
                        
                setName("Draw The 1st ? Lines");//i.e., if NumberOfLinesToDraw==1 one line is drawn every time the 1st "time0" bar time is reached, if it==2 then two lines are drawn for "time0" and "time1", etc.
                        
                setLowerLimit(1);
                        
                setUpperLimit(7);
                        for (
                0lineThick.lengthj++) {
                            
                addOption(1);
                        }
                        
                setDefault(7);
                    }
                    for(
                0timeArr.lengthi++){
                        
                y="time"+i;
                        
                aFPArray[x] = new FunctionParameter(yFunctionParameter.NUMBER);
                        
                with(aFPArray[x++]){
                            
                setLowerLimit(1);
                            
                setDefault(timeArr[i]);
                        }

                        
                y="lineClr"+i;
                        
                aFPArray[x] = new FunctionParameter(yFunctionParameter.COLOR);
                        
                with(aFPArray[x++]){
                            
                setDefault(lineClr[i]);
                        }

                        
                y="lineThick"+i;
                        
                aFPArray[x] = new FunctionParameter(yFunctionParameter.NUMBER);
                        
                with(aFPArray[x++]){
                            
                setLowerLimit(1);
                            for (
                0lineThick.lengthj++) {
                                if (
                lineThick[j] != nulladdOption(j+1);
                            }
                            
                setDefault(1);
                        }
                    }
                    
                aFPArray[x] = new FunctionParameter("displayParam"FunctionParameter.BOOLEAN);
                    
                with(aFPArray[x++]){
                        
                setDefault(false);
                    }
                }

                var 
                bInit=false;
                var 
                paramArr=[];
                function 
                main(NumberOfLinesToDraw,
                              
                time0,time1,time2,time3,time4,time5,time6,
                              
                lineClr0,lineClr1,lineClr2,lineClr3,lineClr4,lineClr5,lineClr6,
                              
                lineThick0,lineThick1,lineThick2,lineThick3,lineThick4,lineThick5,lineThick6,
                              
                displayParam) {

                    if(
                isDWM()) return;
                    if(!
                bInit){
                        
                setShowTitleParametersdisplayParam );
                        var 
                0temp=null;
                        for(
                03+= 1){
                            
                paramArr.push([]);
                        }
                        for(
                07+= 1){
                            
                temp = eval("time" i);
                            if(
                temp != nullparamArr[0][i] = temp;
                            
                temp = eval("lineClr" i);
                            if(
                temp != nullparamArr[1][i] = temp;
                            
                temp = eval("lineThick" i);
                            if(
                temp != nullparamArr[2][i] = temp;
                        }
                        
                bInit=true;
                    }
                    
                    
                DrawTrigger(paramArrNumberOfLinesToDraw);
                 
                    return 
                null;

                }

                var 
                flag0 0flag1 0timeCtr=0;
                var 
                DrawTriggerInit=false;
                function 
                DrawTrigger(paramArrNumberOfLinesToDraw){

                    var 
                0;
                    var 
                barTm = (hour(0)*100)+minute(0);

                    if(!
                DrawTriggerInit){
                        for(
                0paramArr[0].length+= 1){
                            if(
                paramArr[1][i] != nullsetDefaultBarFgColor(paramArr[1][i],i);
                            if(
                paramArr[2][i] != nullsetDefaultBarThickness(paramArr[2][i],i);
                        }
                        
                DrawTriggerInit=true;
                    }
                    
                    if(
                flag1 == && barTm paramArr[0][timeCtr+1]) flag1 0;

                    if(
                flag0 == && barTm >= paramArr[0][paramArr[0].length -1]){
                        if(
                NumberOfLinesToDraw == paramArr[0].length && getCurrentBarCount()>1onAction0(paramArr[1][paramArr[1].length-1],paramArr[2][paramArr[2].length-1]);
                        
                flag1 0;
                        
                flag0 1;
                    }

                    if(
                flag1 == 0){
                        for(
                0paramArr[0].length+= 1){
                            if((
                barTm >= paramArr[0][i] && barTm <paramArr[0][i+1])){
                                if(
                <= NumberOfLinesToDraw-1onAction0(paramArr[1][i],paramArr[2][i]);
                                
                flag0 0;
                                
                flag1 1;
                                
                timeCtr i;
                            }
                        }
                    }
                }

                function 
                onAction0(clrthick) {
                    
                drawLineRelative(000999999PS_SOLIDthickclr"line"+rawtime(0));

                Wayne

                Comment


                • #9
                  Note: any line color set to match the chart background color won't display on the chart, i.e. white line on white chart background.

                  In the future you can change defaults yourself by modifying the 3 arrays on code lines 8, 9, 10. Just make sure you keep the same code structure of surrounging each array with []; and separating each array element with a comma as you can see in the code. Also keep 7 elements in each array. The timeArr must be numbers only in 24 hour time format with no delimiters like ":" or text. The lineClr array must contain correct esignal color names found in the EFS Glossary (do a search for "colors" in the knowledge base). The lineThick array must only contain numbers and nothing else.

                  Wayne

                  Comment


                  • #10
                    Last the lowest number in the lineThick array must be 1.

                    Wayne

                    Comment


                    • #11
                      Ref: your PM request to name the script "Vertical.q3 Time Plots":

                      On line 7 of the script from replace "Time Lines" in
                      setStudyTitle("TimeLines");
                      with the name you prefer.

                      Wayne

                      Comment


                      • #12
                        Its perfect thank you!!

                        Comment


                        • #13
                          Originally posted by NYSE View Post
                          Its perfect thank you!!
                          You're welcome.

                          Wayne

                          Comment


                          • #14
                            My last post on this. I made a small change in the interest of efficiency (no change in the output/drawing of lines);
                            PHP Code:
                            //debugClear();
                            var arrLen null;
                            function 
                            preMain() {

                                var 
                            aFPArray = new Array();
                                
                            setPriceStudy(true);
                                
                            //setStudyTitle("Time Lines");
                                
                            var timeArr = [800,930,935,940,1030,1115,1600];
                                var 
                            lineClr = [Color.grey,Color.blue,Color.aqua,Color.aqua,Color.darkgrey,Color.darkgrey,Color.navy];
                                var 
                            lineThick = [3,3,3,3,3,3,3];
                                
                            arrLen timeArr.length;
                                var 
                            x=0y=0i=0j=0;
                                
                            aFPArray[x] = new FunctionParameter("NumberOfLinesToDraw"FunctionParameter.NUMBER);
                                
                            with(aFPArray[x++]){
                                    
                            setName("Draw The 1st ? Lines");//i.e., if NumberOfLinesToDraw==1 one line is drawn every time the 1st "time0" bar time is reached, if it==2 then two lines are drawn for "time0" and "time1", etc.
                                    
                            setLowerLimit(1);
                                    
                            setUpperLimit(7);
                                    for (
                            0lineThick.lengthj++) {
                                        
                            addOption(1);
                                    }
                                    
                            setDefault(7);
                                }
                                for(
                            0timeArr.lengthi++){
                                    
                            y="time"+i;
                                    
                            aFPArray[x] = new FunctionParameter(yFunctionParameter.NUMBER);
                                    
                            with(aFPArray[x++]){
                                        
                            setLowerLimit(1);
                                        
                            setDefault(timeArr[i]);
                                    }

                                    
                            y="lineClr"+i;
                                    
                            aFPArray[x] = new FunctionParameter(yFunctionParameter.COLOR);
                                    
                            with(aFPArray[x++]){
                                        
                            setDefault(lineClr[i]);
                                    }

                                    
                            y="lineThick"+i;
                                    
                            aFPArray[x] = new FunctionParameter(yFunctionParameter.NUMBER);
                                    
                            with(aFPArray[x++]){
                                        
                            setLowerLimit(1);
                                        for (
                            0lineThick.lengthj++) {
                                            if (
                            lineThick[j] != nulladdOption(j+1);
                                        }
                                        
                            setDefault(1);
                                    }
                                }
                                
                            aFPArray[x] = new FunctionParameter("displayParam"FunctionParameter.BOOLEAN);
                                
                            with(aFPArray[x++]){
                                    
                            setDefault(false);
                                }
                            }

                            var 
                            bInit=false;
                            var 
                            paramArr=[];
                            function 
                            main(NumberOfLinesToDraw,
                                          
                            time0,time1,time2,time3,time4,time5,time6,
                                          
                            lineClr0,lineClr1,lineClr2,lineClr3,lineClr4,lineClr5,lineClr6,
                                          
                            lineThick0,lineThick1,lineThick2,lineThick3,lineThick4,lineThick5,lineThick6,
                                          
                            displayParam) {

                                if(
                            isDWM()) return;
                                if(!
                            bInit){
                                    
                            setShowTitleParametersdisplayParam );
                                    var 
                            args = Array.prototype.slice.call(arguments);
                                    var 
                            0temp=null;
                                    for(
                            03+= 1){
                                        
                            paramArr.push([]);
                                    }
                                    for(
                            0arrLen+= 1){
                                        if(
                            args[i+1] != nullparamArr[0][i] = args[i+1];
                                        if(
                            args[i+8] != nullparamArr[1][i] = args[i+8];
                                        if(
                            args[i+15] != nullparamArr[2][i] = args[i+15];
                                    }
                                    
                            bInit=true;
                                }
                                
                                
                            DrawTrigger(paramArrNumberOfLinesToDraw);
                             
                                return 
                            null;

                            }
                            function 
                            createParamArr(){

                            }
                            var 
                            flag0 0flag1 0timeCtr=0;
                            var 
                            DrawTriggerInit=false;
                            function 
                            DrawTrigger(paramArrNumberOfLinesToDraw){

                                var 
                            0;
                                var 
                            barTm = (hour(0)*100)+minute(0);

                                if(!
                            DrawTriggerInit){
                                    for(
                            0paramArr[0].length+= 1){
                                        if(
                            paramArr[1][i] != nullsetDefaultBarFgColor(paramArr[1][i],i);
                                        if(
                            paramArr[2][i] != nullsetDefaultBarThickness(paramArr[2][i],i);
                                    }
                                    
                            DrawTriggerInit=true;
                                }
                                
                                if(
                            flag1 == && barTm paramArr[0][timeCtr+1]) flag1 0;

                                if(
                            flag0 == && barTm >= paramArr[0][paramArr[0].length -1]){
                                    if(
                            NumberOfLinesToDraw == paramArr[0].length && getCurrentBarCount()>1onAction0(paramArr[1][paramArr[1].length-1],paramArr[2][paramArr[2].length-1]);
                                    
                            flag1 0;
                                    
                            flag0 1;
                                }

                                if(
                            flag1 == 0){
                                    for(
                            0paramArr[0].length+= 1){
                                        if((
                            barTm >= paramArr[0][i] && barTm <paramArr[0][i+1])){
                                            if(
                            <= NumberOfLinesToDraw-1onAction0(paramArr[1][i],paramArr[2][i]);
                                            
                            flag0 0;
                                            
                            flag1 1;
                                            
                            timeCtr i;
                                        }
                                    }
                                }
                            }

                            function 
                            onAction0(clrthick) {
                                
                            drawLineRelative(000999999PS_SOLIDthickclr"line"+rawtime(0));

                            Wayne

                            Comment


                            • #15
                              Corrected an issue with the line thickness menu options.
                              PHP Code:
                              var arrLen null;
                              function 
                              preMain() {

                                  var 
                              aFPArray = new Array();
                                  
                              setPriceStudy(true);
                                  
                              setStudyTitle("Time Lines");

                                  
                              //defauls can be changed via the next 3 arrays (timeArr, lineClr, lineThick) but they must have 7 elements each.
                                  //for timeArr use 24 hour format with no delimiters (i.e. ":" etc.).
                                  //The lineClr array must contain correct esignal color names found in the EFS Glossary (do a search for "colors" in the knowledge base).
                                  //The lineThick array must only contain numbers and nothing else with a minimum value of 1.

                                  
                              var timeArr = [800,930,935,940,1030,1115,1600];
                                  var 
                              lineClr = [Color.grey,Color.white,Color.aqua,Color.aqua,Color.darkgrey,Color.darkgrey,Color.navy];
                                  var 
                              lineThick = [1,1,1,1,1,1,1];

                                  
                              arrLen timeArr.length;
                                  var 
                              x=0y=0i=0j=0;
                                  
                              aFPArray[x] = new FunctionParameter("NumberOfLinesToDraw"FunctionParameter.NUMBER);
                                  
                              with(aFPArray[x++]){
                                      
                              setName("Draw The 1st ? Lines");//i.e., if NumberOfLinesToDraw==1 one line is drawn every time the 1st "time0" bar time is reached, if it==2 then two lines are drawn for "time0" and "time1", etc.
                                      
                              setLowerLimit(1);
                                      
                              setUpperLimit(7);
                                      for (
                              0timeArr.lengthj++) {
                                          
                              addOption(1);
                                      }
                                      
                              setDefault(timeArr.length);
                                  }
                                  for(
                              0timeArr.lengthi++){
                                      
                              y="time"+i;
                                      
                              aFPArray[x] = new FunctionParameter(yFunctionParameter.NUMBER);
                                      
                              with(aFPArray[x++]){
                                          
                              setLowerLimit(1);
                                          
                              setDefault(timeArr[i]);
                                      }

                                      
                              y="lineClr"+i;
                                      
                              aFPArray[x] = new FunctionParameter(yFunctionParameter.COLOR);
                                      
                              with(aFPArray[x++]){
                                          
                              setDefault(lineClr[i]);
                                      }

                                      
                              y="lineThick"+i;
                                      
                              aFPArray[x] = new FunctionParameter(yFunctionParameter.NUMBER);
                                      
                              with(aFPArray[x++]){
                                          
                              setLowerLimit(1);
                                          for (
                              0timeArr.lengthj++) {
                                              
                              addOption(j+1);
                                          }
                                          
                              setDefault(lineThick[i]);
                                      }
                                  }
                                  
                              aFPArray[x] = new FunctionParameter("displayParam"FunctionParameter.BOOLEAN);
                                  
                              with(aFPArray[x++]){
                                      
                              setDefault(false);
                                  }
                              }

                              var 
                              bInit=false;
                              var 
                              paramArr=[];
                              function 
                              main(NumberOfLinesToDraw,
                                            
                              time0,time1,time2,time3,time4,time5,time6,
                                            
                              lineClr0,lineClr1,lineClr2,lineClr3,lineClr4,lineClr5,lineClr6,
                                            
                              lineThick0,lineThick1,lineThick2,lineThick3,lineThick4,lineThick5,lineThick6,
                                            
                              displayParam) {

                                  if(
                              isDWM()) return;
                                  if(!
                              bInit){
                                      
                              setShowTitleParametersdisplayParam );
                                      var 
                              args = Array.prototype.slice.call(arguments);
                                      var 
                              0temp=null;
                                      for(
                              03+= 1){
                                          
                              paramArr.push([]);
                                      }
                                      for(
                              0arrLen+= 1){
                                          if(
                              args[i+1] != nullparamArr[0][i] = args[i+1];
                                          if(
                              args[i+arrLen+1] != nullparamArr[1][i] = args[i+arrLen+1];
                                          if(
                              args[i+2*arrLen+1] != nullparamArr[2][i] = args[i+2*arrLen+1];
                                      }
                                      
                              bInit=true;
                                  }
                                  
                                  
                              DrawTrigger(paramArrNumberOfLinesToDraw);
                               
                                  return 
                              null;

                              }
                              var 
                              flag0 0flag1 0timeCtr=0;
                              var 
                              DrawTriggerInit=false;
                              function 
                              DrawTrigger(paramArrNumberOfLinesToDraw){

                                  var 
                              0;
                                  var 
                              barTm = (hour(0)*100)+minute(0);

                                  if(!
                              DrawTriggerInit){
                                      for(
                              0paramArr[0].length+= 1){
                                          if(
                              paramArr[1][i] != nullsetDefaultBarFgColor(paramArr[1][i],i);
                                          if(
                              paramArr[2][i] != nullsetDefaultBarThickness(paramArr[2][i],i);
                                      }
                                      
                              DrawTriggerInit=true;
                                  }
                                  
                                  if(
                              flag1 == && barTm paramArr[0][timeCtr+1]) flag1 0;

                                  if(
                              flag0 == && barTm >= paramArr[0][paramArr[0].length -1]){
                                      if(
                              NumberOfLinesToDraw == paramArr[0].length && getCurrentBarCount()>1onAction0(paramArr[1][paramArr[1].length-1],paramArr[2][paramArr[2].length-1]);
                                      
                              flag1 0;
                                      
                              flag0 1;
                                  }

                                  if(
                              flag1 == 0){
                                      for(
                              0paramArr[0].length+= 1){
                                          if((
                              barTm >= paramArr[0][i] && barTm <paramArr[0][i+1])){
                                              if(
                              <= NumberOfLinesToDraw-1onAction0(paramArr[1][i],paramArr[2][i]);
                                              
                              flag0 0;
                                              
                              flag1 1;
                                              
                              timeCtr i;
                                          }
                                      }
                                  }
                              }

                              function 
                              onAction0(clrthick) {
                                  
                              drawLineRelative(000999999PS_SOLIDthickclr"line"+rawtime(0));

                              Wayne

                              Comment

                              Working...
                              X