Candlestick: Doji and Near Doji

ICE Data Services -


NearDoji.efs  EFSLibrary - Discussion Board
  

File Name: NearDoji.efs


Description:
Doji and Near Doji


Formula Parameters:
Precision : 0.01
Font : Arial Narrow
Font Size : 11
Font and Shape Color : Green
Font BgColor : White

Notes:
This is a candlestick where the open and close are the same (or almost the same).

Download File:
NearDoji.efs




EFS Code:




/*********************************Provided By:      eSignal (Copyright c eSignal), a division of Interactive Data     Corporation. 2010. 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.   Description:            Doji and Near DojiVersion:            1.0  01/12/2010Formula Parameters:                     Default:    Precision                           0.01    Font                                Arial Narrow    Font Size                           11    Font and Shape Color                          Green    Font BgColor                        White    Notes:    This is a candlestick where the open and close are the same (or almost the same). **********************************/var fpArray = new Array();function preMain() {    setPriceStudy(true);    setStudyTitle("Doji and Near Doji");    setShowCursorLabel(false);    setShowTitleParameters(false);    var x=0;    fpArray[x] = new FunctionParameter("nFontSize", FunctionParameter.NUMBER);	with(fpArray[x++]){        setName("Font Size")        setLowerLimit(6);		        setDefault(11);    }    fpArray[x] = new FunctionParameter("cFontColor", FunctionParameter.COLOR);    with(fpArray[x++]){        setName("Font and Shape Color");        setDefault(Color.green);    }        fpArray[x] = new FunctionParameter("cFontBgColor", FunctionParameter.COLOR);    with(fpArray[x++]){        setName("Font BgColor");        setDefault(Color.white);    }        fpArray[x] = new FunctionParameter("sFont", FunctionParameter.STRING);    with(fpArray[x++]){        setName("Font");        setDefault("Arial Narrow");    }        fpArray[x] = new FunctionParameter("nPrecision", FunctionParameter.NUMBER);    with(fpArray[x++]){        setName("Precision");        setLowerLimit(0.000001);	        setDefault(0.01);    }    }function main(nPrecision, sFont, nFontSize, cFontColor, cFontBgColor) {    Find_NearDoji(nPrecision, sFont, nFontSize, cFontColor, cFontBgColor);    return;}function Find_NearDoji(nPrecision, sFont, nFontSize, cFontColor, cFontBgColor) {var nState = getBarState();var Open = open(0);var Close = close(0);var High = high(0);var Low = low(0);var nID = getCurrentBarCount();    if (nState == BARSTATE_ALLBARS) {        if (nPrecision == null) nPrecision = 0.01;        if (sFont == null) sFont = "Arial Narrow";        if (nFontSize == null) nFontSize = 11;        if (cFontColor == null) cFontColor = Color.green;        if (cFontBgColor == null) cFontBgColor = Color.white;    }    if (Math.abs(Open - Close) <= (High - Low) * nPrecision) {        drawTextRelative(0, AboveBar2, "NDj", cFontColor, cFontBgColor, Text.PRESET | Text.CENTER, sFont, nFontSize, "T"+nID);         drawShapeRelative(0, AboveBar1, Shape.DOWNARROW, null, cFontColor, Shape.PRESET, "S"+nID);             } else {        removeText("T"+nID);        removeShape("S"+nID);    }    return;}