Announcement

Collapse
No announcement yet.

can someone help with a simple request...

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

  • can someone help with a simple request...

    Can someone help me add the lines necessary so that i can have the flexibility to adjust the colors of both the 'atr bands' & 'basis' independently. Currently i can override the color but it makes all 3 lines the same color. I would like to be able to bring up the color palette for each line.

    Thanks
    scott

    Heres the current code:


    function preMain() {
    setPriceStudy(true);

    setStudyTitle("Keltner (ATR Bands) ");

    setCursorLabelName("K-Upper", 0);
    setCursorLabelName("K-Basis", 1);
    setCursorLabelName("K-Lower", 2);

    setDefaultBarFgColor(Color.blue, 0); // upper
    setDefaultBarFgColor(Color.red, 1); // basis
    setDefaultBarFgColor(Color.blue, 2); // lower
    }

    function ATR(nInputLength) {
    var dSum = 0;
    var dH = high(0, -nInputLength);
    var dL = low(0, -nInputLength);
    var dC = close(-1, -nInputLength);
    if (dH == null || dL == null || dC == null) {
    return;
    }
    for (i = 0; i < nInputLength; ++i) {
    var vTrueHigh = Math.max(dH[i], dC[i]);
    var vTrueLow = Math.min(dL[i], dC[i]);
    var vTrueRange = (vTrueHigh - vTrueLow);
    dSum += vTrueRange;
    }
    dSum /= nInputLength;
    return dSum;
    }

    var BarCntr = 0;
    function main(nInputLength, nRangeFactor) {
    if(nInputLength == null)
    nInputLength = 20;
    if(nInputLength <= 0)
    nInputLength = 20;

    if(nRangeFactor == null)
    nRangeFactor = 2.5;
    if(nRangeFactor <= 0)
    nRangeFactor = 2.5;

    if (getBarState() == BARSTATE_NEWBAR)
    BarCntr += 1;

    if (BarCntr < nInputLength) {
    return;
    } else {
    var dKeltnerBasis= call("/Library/KeltnerEMA.efs", nInputLength);
    var dATR = ATR(nInputLength);
    return new Array(dKeltnerBasis + (nRangeFactor * dATR), dKeltnerBasis, dKeltnerBasis - (nRangeFactor * dATR));
    }
    }

  • #2
    You would adjust lines 10-12 to change the colors of each returned value. ",0" on line 10 specifies the color of the first returned value, ",1" on line 11 specifies the color of the second returned value, etc. A list of colors can be found here (from our EFS Help Center & Library.)
    Regards,
    Jay F.
    Product Manager
    _____________________________________
    Have a suggestion to improve our products?
    Click Support --> Request a Feature in eSignal 11

    Comment


    • #3
      popup color palette ?

      Is it possible to add the popup color pallette into an efs ? or only hard coded into the formula ?

      Comment


      • #4
        Yes you can create a a color wheel as an input parameter. Please reference the EFShelp.chm file available at http://share.esignal.com/groupconten...le&groupid=114

        Once opened, go to the Index and look up Function Parameter --> Function Parameter Class for a listing of the different tools available along these lines.
        Regards,
        Jay F.
        Product Manager
        _____________________________________
        Have a suggestion to improve our products?
        Click Support --> Request a Feature in eSignal 11

        Comment

        Working...
        X