Announcement

Collapse
No announcement yet.

Bar color tweak on Wizard . . .

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

  • Bar color tweak on Wizard . . .

    Simple Wizard EFS for bar color changes according to criteria in EFS . . . but when criteria NOT met, it prints grey bar with no outline and thick wick as per snap shot below. Is there any script I can insert to make those "grey bars" print with thin black wick and outline instead . . . I can live with the grey but if there's a chance I can chose my own RGB then all the better.

    I've included a sample Wizard EFS of the snap shot but it looks like an additional script rather than any simple change which I can normally do.

    Your help would be much appreciated.

    Many thanks in anticipation.

    Tiktok

    Click image for larger version

Name:	grey bar.JPG
Views:	1
Size:	93.2 KB
ID:	246988

    //{{EFSWizard_Description
    //
    // This formula was generated by the Alert Wizard
    //
    //}}EFSWizard_Description


    //{{EFSWizard_Declarations
    var vMACD30_63 = new MACDStudy(30, 63, 27, "Close", false);
    var vEMA10 = new MAStudy(10, 0, "Close", MAStudy.EXPONENTIAL);
    var vEMA21 = new MAStudy(21, 0, "Close", MAStudy.EXPONENTIAL);
    var vLastAlert = -1;
    //}}EFSWizard_Declarations


    function preMain() {
    //{{EFSWizard_Code_PreMain_setPriceBarColor
    setColorPriceBars(true);
    //}}EFSWizard_Code_PreMain_setPriceBarColor
    /**
    * This function is called only once, before any of the bars are loaded.
    * Place any study or EFS configuration commands here.
    */
    //{{EFSWizard_PreMain
    setPriceStudy(true);
    setStudyTitle("macd 15 plus 10 21 ema 5 candle col");
    //}}EFSWizard_PreMain

    }

    function main() {
    /**
    * The main() function is called once per bar on all previous bars, once per
    * each incoming completed bar, and if you don't have 'setComputeOnClose(true)'
    * in your preMain(), it is also called on every tick.
    */

    //{{EFSWizard_Expressions
    //{{EFSWizard_Expression_1
    if (
    vMACD30_63.getValue(MACDStudy.MACD) >= vMACD30_63.getValue(MACDStudy.SIGNAL) &&
    vEMA10.getValue(MAStudy.MA) >= vEMA21.getValue(MAStudy.MA)
    ) onAction1()
    //}}EFSWizard_Expression_1

    //{{EFSWizard_Expression_2
    else if (
    vMACD30_63.getValue(MACDStudy.MACD) <= vMACD30_63.getValue(MACDStudy.SIGNAL) &&
    vEMA10.getValue(MAStudy.MA) <= vEMA21.getValue(MAStudy.MA)
    ) onAction2();
    //}}EFSWizard_Expression_2

    //}}EFSWizard_Expressions


    //{{EFSWizard_Return
    return null;
    //}}EFSWizard_Return

    }

    function postMain() {
    /**
    * The postMain() function is called only once, when the EFS is no longer used for
    * the current symbol (ie, symbol change, chart closing, or application shutdown).
    */
    }

    //{{EFSWizard_Actions
    //{{EFSWizard_Action_1
    function onAction1() {
    setPriceBarColor(Color.RGB(0,206,0),Color.black, true);
    vLastAlert = 1;
    }
    //}}EFSWizard_Action_1

    //{{EFSWizard_Action_2
    function onAction2() {
    setPriceBarColor(Color.red, Color.black, true);
    vLastAlert = 2;
    }
    //}}EFSWizard_Action_2

    //}}EFSWizard_Actions

  • #2
    tiktok
    See the solution provided in this thread on a similar issue (also search this very same forum as there are several other threads on the topic)
    Alex


    Originally posted by tiktok View Post
    Simple Wizard EFS for bar color changes according to criteria in EFS . . . but when criteria NOT met, it prints grey bar with no outline and thick wick as per snap shot below. Is there any script I can insert to make those "grey bars" print with thin black wick and outline instead . . . I can live with the grey but if there's a chance I can chose my own RGB then all the better.

    I've included a sample Wizard EFS of the snap shot but it looks like an additional script rather than any simple change which I can normally do.

    Your help would be much appreciated.

    Many thanks in anticipation.

    Tiktok

    [ATTACH]16745[/ATTACH]

    //{{EFSWizard_Description
    //
    // This formula was generated by the Alert Wizard
    //
    //}}EFSWizard_Description


    //{{EFSWizard_Declarations
    var vMACD30_63 = new MACDStudy(30, 63, 27, "Close", false);
    var vEMA10 = new MAStudy(10, 0, "Close", MAStudy.EXPONENTIAL);
    var vEMA21 = new MAStudy(21, 0, "Close", MAStudy.EXPONENTIAL);
    var vLastAlert = -1;
    //}}EFSWizard_Declarations


    function preMain() {
    //{{EFSWizard_Code_PreMain_setPriceBarColor
    setColorPriceBars(true);
    //}}EFSWizard_Code_PreMain_setPriceBarColor
    /**
    * This function is called only once, before any of the bars are loaded.
    * Place any study or EFS configuration commands here.
    */
    //{{EFSWizard_PreMain
    setPriceStudy(true);
    setStudyTitle("macd 15 plus 10 21 ema 5 candle col");
    //}}EFSWizard_PreMain

    }

    function main() {
    /**
    * The main() function is called once per bar on all previous bars, once per
    * each incoming completed bar, and if you don't have 'setComputeOnClose(true)'
    * in your preMain(), it is also called on every tick.
    */

    //{{EFSWizard_Expressions
    //{{EFSWizard_Expression_1
    if (
    vMACD30_63.getValue(MACDStudy.MACD) >= vMACD30_63.getValue(MACDStudy.SIGNAL) &&
    vEMA10.getValue(MAStudy.MA) >= vEMA21.getValue(MAStudy.MA)
    ) onAction1()
    //}}EFSWizard_Expression_1

    //{{EFSWizard_Expression_2
    else if (
    vMACD30_63.getValue(MACDStudy.MACD) <= vMACD30_63.getValue(MACDStudy.SIGNAL) &&
    vEMA10.getValue(MAStudy.MA) <= vEMA21.getValue(MAStudy.MA)
    ) onAction2();
    //}}EFSWizard_Expression_2

    //}}EFSWizard_Expressions


    //{{EFSWizard_Return
    return null;
    //}}EFSWizard_Return

    }

    function postMain() {
    /**
    * The postMain() function is called only once, when the EFS is no longer used for
    * the current symbol (ie, symbol change, chart closing, or application shutdown).
    */
    }

    //{{EFSWizard_Actions
    //{{EFSWizard_Action_1
    function onAction1() {
    setPriceBarColor(Color.RGB(0,206,0),Color.black, true);
    vLastAlert = 1;
    }
    //}}EFSWizard_Action_1

    //{{EFSWizard_Action_2
    function onAction2() {
    setPriceBarColor(Color.red, Color.black, true);
    vLastAlert = 2;
    }
    //}}EFSWizard_Action_2

    //}}EFSWizard_Actions

    Comment


    • #3
      A wizard with your help Alex and perfect as always . . . many thanks :-)

      All the best,
      Tiktok

      Comment


      • #4
        tiktok
        You are welcome
        Alex


        Originally posted by tiktok View Post
        A wizard with your help Alex and perfect as always . . . many thanks :-)

        All the best,
        Tiktok

        Comment

        Working...
        X