Announcement

Collapse
No announcement yet.

Can't set premain default color for plots

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

  • Can't set premain default color for plots

    I have a study that draws all my plots correctly, but all of the plots are the same color. I have added set default in the premain section, but it is not working. Will someone please help.

    Here is the premain section and return section.



    function premain(){
    setStudyTitle("BDB 1d");
    setShowTitleParameters(true);
    setPlotType(PLOTTYPE_INSTANTCOLORLINE);
    setCursorLabelName("Fish17x5", 0);
    setDefaultBarFgColor(Color.magenta, 0);
    setDefaultBarBgColor(Color.magenta,0);
    setCursorLabelName("SLOW", 1);
    setDefaultBarFgColor(Color.lime, 1);
    setDefaultBarBgColor(Color.lime, 1);
    setPlotType(PLOTTYPE_LINE, 1);
    setDefaultBarThickness(2, 1);
    setCursorLabelName("Fish_plot ", 2);
    setDefaultBarFgColor(Color.cyan, 2);
    setDefaultBarBgColor(Color.cyan, 2);
    setPlotType(PLOTTYPE_LINE, 2);
    setCursorLabelName("FAst", 3);
    setDefaultBarFgColor(Color.white, 3);
    setDefaultBarBgColor(Color.white, 3);
    setPlotType(PLOTTYPE_LINE, 3);
    setCursorLabelName("BBU", 4);
    setDefaultBarFgColor(Color.white, 4);
    setDefaultBarBgColor(Color.white, 4);
    setPlotType(PLOTTYPE_LINE, 4);
    setCursorLabelName("BBM", 5);
    setDefaultBarFgColor(Color.white, 5);
    setDefaultBarBgColor(Color.white, 5);
    setPlotType(PLOTTYPE_LINE, 5);
    setCursorLabelName("BBL", 6);
    setDefaultBarFgColor(Color.white, 6);
    setDefaultBarBgColor(Color.white, 6);
    setPlotType(PLOTTYPE_LINE, 6);
    var fp01 = new FunctionParameter("Fish_len", FunctionParameter.NUMBER);
    fp01.setName("Fisher Length") ;
    fp01.setLowerLimit(2);
    fp01.setDefault(10);
    var fp02 = new FunctionParameter("slow_len", FunctionParameter.NUMBER);
    fp02.setName("Slow Length AVG") ;
    fp02.setLowerLimit(1);
    fp02.setDefault(7);
    var fp03 = new FunctionParameter("fast_len", FunctionParameter.NUMBER);
    fp03.setName("Fast Length AVG") ;
    fp03.setLowerLimit(1);
    fp03.setDefault(2);
    var fp04 = new FunctionParameter("hooter_sens", FunctionParameter.NUMBER);
    fp04.setName("Hooter Sensitivity") ;
    fp04.setLowerLimit(2);
    fp04.setDefault(8);
    var fp05 = new FunctionParameter("show_50x", FunctionParameter.BOOLEAN);
    fp05.setName("Show 50 crosses") ;
    fp05.setDefault(true);
    var fp06 = new FunctionParameter("show_sf_x", FunctionParameter.BOOLEAN);
    fp06.setName("Show slow/fast crosses") ;
    fp06.setDefault(true);
    var fp07 = new FunctionParameter("show_fish", FunctionParameter.BOOLEAN);
    fp07.setName("Show fisherized crosses") ;
    fp07.setDefault(true);
    fp07.addOption("true");
    fp07.addOption("false");
    if(bExpired) {
    setStudyTitle("Expired Study");
    setCursorLabelName("Expired CLN");
    }

    }
    ++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++
    ++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++



    return new Array(Fish17_plot, slow,Fish_plot, fast,bbu, bbm, bbl);

    }

  • #2
    HJSeese
    premain should be preMain
    Alex


    Originally posted by HJSeese View Post
    I have a study that draws all my plots correctly, but all of the plots are the same color. I have added set default in the premain section, but it is not working. Will someone please help.

    Here is the premain section and return section.



    function premain(){
    setStudyTitle("BDB 1d");
    setShowTitleParameters(true);
    setPlotType(PLOTTYPE_INSTANTCOLORLINE);
    setCursorLabelName("Fish17x5", 0);
    setDefaultBarFgColor(Color.magenta, 0);
    setDefaultBarBgColor(Color.magenta,0);
    setCursorLabelName("SLOW", 1);
    setDefaultBarFgColor(Color.lime, 1);
    setDefaultBarBgColor(Color.lime, 1);
    setPlotType(PLOTTYPE_LINE, 1);
    setDefaultBarThickness(2, 1);
    setCursorLabelName("Fish_plot ", 2);
    setDefaultBarFgColor(Color.cyan, 2);
    setDefaultBarBgColor(Color.cyan, 2);
    setPlotType(PLOTTYPE_LINE, 2);
    setCursorLabelName("FAst", 3);
    setDefaultBarFgColor(Color.white, 3);
    setDefaultBarBgColor(Color.white, 3);
    setPlotType(PLOTTYPE_LINE, 3);
    setCursorLabelName("BBU", 4);
    setDefaultBarFgColor(Color.white, 4);
    setDefaultBarBgColor(Color.white, 4);
    setPlotType(PLOTTYPE_LINE, 4);
    setCursorLabelName("BBM", 5);
    setDefaultBarFgColor(Color.white, 5);
    setDefaultBarBgColor(Color.white, 5);
    setPlotType(PLOTTYPE_LINE, 5);
    setCursorLabelName("BBL", 6);
    setDefaultBarFgColor(Color.white, 6);
    setDefaultBarBgColor(Color.white, 6);
    setPlotType(PLOTTYPE_LINE, 6);
    var fp01 = new FunctionParameter("Fish_len", FunctionParameter.NUMBER);
    fp01.setName("Fisher Length") ;
    fp01.setLowerLimit(2);
    fp01.setDefault(10);
    var fp02 = new FunctionParameter("slow_len", FunctionParameter.NUMBER);
    fp02.setName("Slow Length AVG") ;
    fp02.setLowerLimit(1);
    fp02.setDefault(7);
    var fp03 = new FunctionParameter("fast_len", FunctionParameter.NUMBER);
    fp03.setName("Fast Length AVG") ;
    fp03.setLowerLimit(1);
    fp03.setDefault(2);
    var fp04 = new FunctionParameter("hooter_sens", FunctionParameter.NUMBER);
    fp04.setName("Hooter Sensitivity") ;
    fp04.setLowerLimit(2);
    fp04.setDefault(8);
    var fp05 = new FunctionParameter("show_50x", FunctionParameter.BOOLEAN);
    fp05.setName("Show 50 crosses") ;
    fp05.setDefault(true);
    var fp06 = new FunctionParameter("show_sf_x", FunctionParameter.BOOLEAN);
    fp06.setName("Show slow/fast crosses") ;
    fp06.setDefault(true);
    var fp07 = new FunctionParameter("show_fish", FunctionParameter.BOOLEAN);
    fp07.setName("Show fisherized crosses") ;
    fp07.setDefault(true);
    fp07.addOption("true");
    fp07.addOption("false");
    if(bExpired) {
    setStudyTitle("Expired Study");
    setCursorLabelName("Expired CLN");
    }

    }
    ++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++
    ++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++



    return new Array(Fish17_plot, slow,Fish_plot, fast,bbu, bbm, bbl);

    }

    Comment


    • #3
      Ugggh

      Thanks!!!!!!!!!

      Comment


      • #4
        HJSeese
        You are welcome
        Alex


        Originally posted by HJSeese View Post
        Ugggh

        Thanks!!!!!!!!!

        Comment

        Working...
        X