GetBiasStudy() Advanced GET Study Functions
Creates object, which allows to get signals of indicator Advanced GET Bias Reversal in EFS scripts. The Bias Reversal indicates a potential change in trend (a reversal of a bias) point.
Syntax
GetBiasStudy( bFilter , Mode )
Parameters
Parameter: | Description: | Default: |
bFilter |
Boolean. When True, the Filter removes any Bias Reversal signals that have been marked as false signals. When False, false Bias Reversal signals will be returned.
|
n/a |
Mode |
Allows to choose between Normal and Tight sensitivity level for the Bias Reversal calculation. To choose sensitivity level use constants GetBiasStudy.NORMAL or GetBiasStudy.TIGHT.
|
n/a |
Member(s)
Syntax: | Returned value: |
GetBiasStudy.BIAS |
Returns series, which contains the following values: 1 - true signal for reverse pivot from bullish to bearish trend,
|
Notes
Only available in versions 7.9 or later.
Code Example
Creation Object Example:
var xBias = null; function main() { if (xBias == null) xBias = new GetBiasStudy(true, GetBiasStudy.NORMAL); var vBias = xBias.getValue(GetBiasStudy.BIAS); return vBias; }
Bias Reversal Indicator:
var fpArray = new Array(); function preMain() { askForInput(); setPriceStudy(true); setShowSeries(false, 0); setStudyTitle("AGET Bias"); setCursorLabelName("Bias", 0); setDefaultBarFgColor(Color.grey); var x = 0; fpArray[x] = new FunctionParameter("bFilter", FunctionParameter.BOOLEAN); with (fpArray[x++]) { setName("Filter"); setDefault(true); } fpArray[x] = new FunctionParameter("Mode", FunctionParameter.STRING); with (fpArray[x++]) { setName("Mode"); addOption("NORMAL"); addOption("TIGHT"); setDefault("NORMAL"); } fpArray[x] = new FunctionParameter("gTop", FunctionParameter.COLOR); with (fpArray[x++]) { setName("Top"); setDefault(Color.red); } fpArray[x] = new FunctionParameter("gBottom", FunctionParameter.COLOR); with (fpArray[x++]) { setName("Bottom"); setDefault(Color.RGB(0, 148, 225)); } } var vBias = null; var i = 0; function main(bFilter, Mode, gTop, gBottom) { if (Mode == "NORMAL") { Mode = GetBiasStudy.NORMAL; } else { Mode = GetBiasStudy.TIGHT; } if (vBias == null) vBias = new GetBiasStudy(bFilter, Mode); var valBias = vBias.getValue(GetBiasStudy.BIAS); if (valBias == 1) { drawShapeRelative( 0, TopRow1, Shape.DOWNTRIANGLE, null, gTop, Shape.PRESET, i++ ); setBarFgColor(gTop); } if (valBias == 255) { drawShapeRelative( 0, BottomRow1, Shape.UPTRIANGLE, null, gBottom, Shape.PRESET, i++ ); setBarFgColor(gBottom); } if (valBias == 2 && !bFilter) { drawShapeRelative( 0, TopRow1, Shape.DOWNARROW, null, gTop, Shape.PRESET, i++ ); setBarFgColor(gTop); } if (valBias == 254 && !bFilter) { drawShapeRelative( 0, BottomRow1, Shape.UPARROW, null, gBottom, Shape.PRESET, i++ ); setBarFgColor(gBottom); } if (valBias == null) { valBias = 0; } return valBias; }
See Also