Announcement

Collapse
No announcement yet.

No Solid Lines

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

  • No Solid Lines

    Hi!

    I am using the following Ichimoku study and am trying to get all of the lines that make up the Kumo to be dotted instead of solid. The changes that I made to lines 80,187 and 188 have done so to all of the vertical lines that make up the cloud and also to the 26 period offset. But I am unable to get the solid lines that create the Senkou Span A and B of the prior and current candles to change. I know that these changes can be made if you edit the settings, but I was hoping to set this default in the efs itself.

    Thank you in advance.

    PHP Code:
    /*********************************
    Provided By:  
        eSignal (Copyright © eSignal), a division of Interactive Data 
        Corporation. 2007. All rights reserved. This sample eSignal 
        Formula Script (EFS) is for educational purposes only and may be 
        modified and saved under a new file name.  eSignal is not responsible
        for the functionality once modified.  eSignal reserves the right 
        to modify and overwrite this EFS file with each new release.
        
    Version: 2.0  (8/7/2007)

    Notes:
        8/7/2007
        * Study has been updated to utilize EFS2 functionality
        * Additional formula parameters added to match built-in
            study parameters found in FutureSource Workstation 
            Ichimoku study.
    **********************************/


    // Global Variables
    var aFPArray      null;
    var 
    xTurn          null;
    var 
    xStd           null;
    var 
    xLS1           null;
    var 
    xLS2           null;
    var 
    xKumoStyle  null;

    var 
    bInit false;  // Initialization flag
    var vCntr 0;      // bar counter
    var vICntr 0;     // line counter for drawn lines

    function preMain() {

        
    setPriceStudy(true);
        
    setStudyTitle("Ichimoku Kinko Hyo");
        
    setCursorLabelName("Tenkan Sen"0);
        
    setCursorLabelName("Kijun Sen"1);
        
    setCursorLabelName("Chikou Span"2);
        
    setCursorLabelName("Senkou Span A"3);
        
    setCursorLabelName("Senkou Span B"4);
        
    setDefaultBarFgColor(Color.red0);
        
    setDefaultBarFgColor(Color.blue1);
        
    setDefaultBarFgColor(Color.magenta2);
        
    setDefaultBarFgColor(Color.lightgrey3);
        
    setDefaultBarFgColor(Color.purple4);
        
    setShowTitleParameters(false);
        
        var 
    0;
        
    aFPArray = new Array();
        
        
    aFPArray[i] = new FunctionParameter("nTrnPeriod"FunctionParameter.NUMBER);
        
    aFPArray[i].setName("Tenkan Sen Periods");
        
    aFPArray[i].setLowerLimit(1);
        
    aFPArray[i].setDefault(9);
        ++
    i;
        
        
    aFPArray[i] = new FunctionParameter("nStdPeriod"FunctionParameter.NUMBER);
        
    aFPArray[i].setName("Kijun Sen Periods");
        
    aFPArray[i].setLowerLimit(1);
        
    aFPArray[i].setDefault(26);
        ++
    i;
        
        
    aFPArray[i] = new FunctionParameter("nLS2Period"FunctionParameter.NUMBER);
        
    aFPArray[i].setName("Senkou Span B Periods");
        
    aFPArray[i].setLowerLimit(1);
        
    aFPArray[i].setDefault(52);
        ++
    i;

        
    aFPArray[i] = new FunctionParameter("nOffset"FunctionParameter.NUMBER);
        
    aFPArray[i].setName("Displacement");
        
    aFPArray[i].setLowerLimit(0);
        
    aFPArray[i].setDefault(26);
        ++
    i;
        
        
    aFPArray[i] = new FunctionParameter("sCloud"FunctionParameter.STRING);
        
    aFPArray[i].setName("Ichimoku Kumo Style");
        
    aFPArray[i].addOption"Solid Line" );
        
    aFPArray[i].addOption"Dotted Line" );
        
    aFPArray[i].setDefault("Dotted Line");     /*Dot*/
        
    ++i;

        
    aFPArray[i] = new FunctionParameter("cCloudUp"FunctionParameter.COLOR);
        
    aFPArray[i].setName("Ichimoku Kumo Color Up");
        
    aFPArray[i].setDefault(Color.grey);
        ++
    i;
        
        
    aFPArray[i] = new FunctionParameter("cCloudDown"FunctionParameter.COLOR);
        
    aFPArray[i].setName("Ichimoku Kumo Color Down");
        
    aFPArray[i].setDefault(Color.grey);
        ++
    i;

        
    aFPArray[i] = new FunctionParameter("nColorTrn"FunctionParameter.COLOR);
        
    aFPArray[i].setName("Line Color: Tenkan Sen");
        
    aFPArray[i].setDefault(Color.green);
        ++
    i;
            
        
    aFPArray[i] = new FunctionParameter("nColorStd"FunctionParameter.COLOR);
        
    aFPArray[i].setName("Line Color: Kijun Sen");
        
    aFPArray[i].setDefault(Color.blue);
        ++
    i;
            
        
    aFPArray[i] = new FunctionParameter("nColorDelay"FunctionParameter.COLOR);
        
    aFPArray[i].setName("Line Color: Chikou Span");
        
    aFPArray[i].setDefault(Color.magenta);
        ++
    i;
            
        
    aFPArray[i] = new FunctionParameter("nColorLS1"FunctionParameter.COLOR);
        
    aFPArray[i].setName("Line Color: Senkou Span A");
        
    aFPArray[i].setDefault(Color.lightgrey);
        ++
    i;
            
        
    aFPArray[i] = new FunctionParameter("nColorLS2"FunctionParameter.COLOR);
        
    aFPArray[i].setName("Line Color: Senkou Span B");
        
    aFPArray[i].setDefault(Color.purple);
        ++
    i;

        
    aFPArray[i] = new FunctionParameter("nThickTrn"FunctionParameter.NUMBER);
        
    aFPArray[i].setName("Line Thickness: Tenkan Sen");
        
    aFPArray[i].setLowerLimit(1);
        
    aFPArray[i].setDefault(2);
        ++
    i;
            
        
    aFPArray[i] = new FunctionParameter("nThickStd"FunctionParameter.NUMBER);
        
    aFPArray[i].setName("Line Thickness: Kijun Sen");
        
    aFPArray[i].setLowerLimit(1);
        
    aFPArray[i].setDefault(1);
        ++
    i;
            
        
    aFPArray[i] = new FunctionParameter("nThickDelay"FunctionParameter.NUMBER);
        
    aFPArray[i].setName("Line Thickness: Chikou Span");
        
    aFPArray[i].setLowerLimit(1);
        
    aFPArray[i].setDefault(1);
        ++
    i;
            
        
    aFPArray[i] = new FunctionParameter("nThickLS1"FunctionParameter.NUMBER);
        
    aFPArray[i].setName("Line Thickness: Senkou Span A");
        
    aFPArray[i].setLowerLimit(1);
        
    aFPArray[i].setDefault(1);
        ++
    i;
            
        
    aFPArray[i] = new FunctionParameter("nThickLS2"FunctionParameter.NUMBER);
        
    aFPArray[i].setName("Line Thickness: Senkou Span B");
        
    aFPArray[i].setLowerLimit(1);
        
    aFPArray[i].setDefault(1);
    }

    function 
    main(    nTrnPeriodnStdPeriodnLS2PeriodnOffsetsCloudcCloudUpcCloudDown
                    
    nColorTrnnColorStdnColorDelaynColorLS1nColorLS2,
                    
    nThickTrnnThickStdnThickDelaynThickLS1nThickLS2) {

        if (
    bInit == false) {
            
    setDefaultBarFgColor(nColorTrn0);
            
    setDefaultBarFgColor(nColorStd1);
            
    setDefaultBarFgColor(nColorDelay2);
            
    setDefaultBarFgColor(nColorLS13);
            
    setDefaultBarFgColor(nColorLS24);
            
    setDefaultBarThickness(nThickTrn0);
            
    setDefaultBarThickness(nThickStd1);
            
    setDefaultBarThickness(nThickDelay2);
            
    setDefaultBarThickness(nThickLS13);
            
    setDefaultBarThickness(nThickLS24);
            
    xTurn middleDonchian(nTrnPeriod);    
            
    xStd  middleDonchian(nStdPeriod);    
            
    xLS1  offsetSeries(efsInternal("calcLS1"xStdxTurn), nOffset);
            
    xLS2  offsetSeries(middleDonchian(nLS2Period), nOffset);
            
            
    xKumoStyle PS_SOLID;
            
            if(
    sCloud != null && sCloud == "Dotted Line"xKumoStyle PS_DOT;
            
            
    bInit true;
        }
        
        
    // added by gekko71
        
    if ( isLastBarOnChart() ) { 
        
            if(
    nOffset 0) {
                var 
    i;
                for(
    i=0i<nOffset; ++i) {
                
                    var 
    vSenkouACurr xLS1.getValue(i);
                    var 
    vSenkouANext xLS1.getValue(i+1);
                    var 
    vSenkouBCurr xLS2.getValue(i);
                    var 
    vSenkouBNext xLS2.getValue(i+1);
                    
                    
    drawLineRelative(ivSenkouACurr, (i+1), vSenkouANextPS_DOT1nColorLS1, (i+"A"));     /*Dot*/
                    
    drawLineRelative(ivSenkouBCurr, (i+1), vSenkouBNextPS_DOT1nColorLS2, (i+"B"));     /*Dot*/
                    
                    
    if(vSenkouACurr vSenkouBCurr) { 
                        if(
    == (nOffset 1)) 
                            
    drawLineRelative((i+1), vSenkouANext, (i+1), vSenkouBNextxKumoStyle1cCloudUp"CloudUpExt"+(i+1));
                            
                        
    drawLineRelative(ivSenkouACurrivSenkouBCurrxKumoStyle1cCloudUp"CloudUpExtCurr"+i);
                    }
                    if(
    vSenkouACurr vSenkouBCurr) {
                        if(
    == (nOffset 1)) 
                            
    drawLineRelative((i+1), vSenkouANext, (i+1), vSenkouBNextxKumoStyle1cCloudDown"CloudDownExt"+(i+1));
                        
                        
    drawLineRelative(ivSenkouACurrivSenkouBCurrxKumoStyle1cCloudDown"CloudDownExtCurr"+i);
                    }
                }
            }
        }
        
        if(
    getBarState() == BARSTATE_NEWBAR) {
            
    vCntr++;
            
    vICntr++;
            if (
    vICntr 350vICntr 0;
        }

        var 
    nTurningLine xTurn.getValue(0);
        var 
    nStandardLine xStd.getValue(0);
        var 
    nLeadingSpan1 xLS1.getValue(0);
        var 
    nLeadingSpan2 xLS2.getValue(0);
        
        if (
    nTurningLine == null || nStandardLine == null || nLeadingSpan1 == null || nLeadingSpan2 == null) return;
            
        if(
    nLeadingSpan1 nLeadingSpan2)
            
    drawLineRelative(0nLeadingSpan10nLeadingSpan2xKumoStyle1cCloudUp"CloudUp" vICntr);
        if(
    nLeadingSpan1 nLeadingSpan2)
            
    drawLineRelative(0nLeadingSpan10nLeadingSpan2xKumoStyle1cCloudDown"CloudDown" vICntr);
                
        if (
    nOffset 0) {
            
            var 
    nNum 0;
            
            if(
    getBarState() == BARSTATE_NEWBARnNum 1;
            
            if(
    getBuildNumber()>636){
                
    setBar(Bar.Value, -nOffset2close(0));
            } else {
                
    setBar(Bar.Value, (-nOffset nNum), new Array(nullnullclose(0), nullnull));
            }
        
            return new Array(
    nTurningLinenStandardLinenullnLeadingSpan1nLeadingSpan2);
        } else {
            return new Array(
    nTurningLinenStandardLineclose(0), nLeadingSpan1nLeadingSpan2);
        }
    }

    function 
    calcLS1xSTDxTRN ) {
        return (
    xSTD.getValue(0) + xTRN.getValue(0)) / 2;


  • #2
    Hi,

    If I understand you correctly, just add:
    PHP Code:
        setDefaultBarStylePS_DOT); 
        
    setDefaultBarStylePS_DOT); 
    inside preMain(), like under "setDefaultBarFgColor(Color.purple, 4);"

    These two lines are plots returned in main() by the return statement and not drawn by drawLineRelative().

    Wayne

    Comment


    • #3
      Thank you Wayne!

      You are as brilliant as always.

      Comment


      • #4
        Yw,

        Wayne

        Comment

        Working...
        X