New to eSignal, can't find a EFS that will plot Higher Highs and Lower Lows... can anyone please point me in the right direction? Thanks in advance.
Announcement
Collapse
No announcement yet.
Looking for EFS that plots price pivot labels
Collapse
X
-
Hi there,
Here is what you are looking for. Created it specially for you, quite simple but helpful
PHP Code:
var fpArray = new Array();
var bInit = false;
function preMain() {
setPriceStudy(true);
setShowCursorLabel(false);
setShowTitleParameters( false );
setStudyTitle("HH, LL, HL, LH");
askForInput();
var x=0;
fpArray[x] = new FunctionParameter("FontColor", FunctionParameter.COLOR);
with(fpArray[x++]){
setName("Font Color");
setDefault(Color.green);
}
fpArray[x] = new FunctionParameter("FontSize", FunctionParameter.NUMBER);
with(fpArray[x++]){
setName("Font Size");
setDefault(10);
}
fpArray[x] = new FunctionParameter("Length", FunctionParameter.NUMBER);
with(fpArray[x++]){
setLowerLimit(1);
setDefault(50);
}
}
var Counter = 0;
function main(Length, FontSize, FontColor) {
var nState = getBarState();
var nCurrent = Counter;
if ( bInit == false ) {
ClearChart();
bInit = true;
}
if (getNumBars() <= Length) return;
if (nState == BARSTATE_ALLBARS) {
ClearChart();
}
if (nState == BARSTATE_NEWBAR) {
Counter++;
nCurrent = Counter;
}
my_HH(Length, nCurrent, FontSize, FontColor);
my_HL(Length, nCurrent, FontSize, FontColor);
my_LL(Length, nCurrent, FontSize, FontColor);
my_LH(Length, nCurrent, FontSize, FontColor);
return ;
}
function my_HH(nBarAgo, nCurrent, FontSize, FontColor){
var nRes = high(0);
var nBarIndex = 0;
for (var i = 0; i < nBarAgo; i++) {
if (nRes <= high(-i)) {
nBarIndex = i;
}
}
if (nBarIndex == 0) drawTextRelative( 0, nRes + 0.01, "H H", FontColor, null, Text.BOTTOM | Text.CENTER, "Times New Roman", FontSize, "HH" + nCurrent);
if (nBarIndex != 0) drawTextRelative( 0, nRes + 0.01, " ", FontColor, null, Text.BOTTOM |Text.CENTER, "Times New Roman", FontSize, "HH" + nCurrent);
return;
}
function my_HL(nBarAgo, nCurrent, FontSize, FontColor){
var nRes = low(0);
var nBarIndex = 0;
for (var i = 0; i < nBarAgo; i++) {
if (nRes <= low(-i)) {
nBarIndex = i;
}
}
if (nBarIndex == 0) drawTextRelative( 0, nRes - 0.01, "H L", FontColor, null, Text.ONTOP | Text.CENTER, "Times New Roman", FontSize, "HL" + nCurrent);
if (nBarIndex != 0) drawTextRelative( 0, nRes - 0.01, " ", FontColor, null, Text.ONTOP | Text.CENTER, "Times New Roman", FontSize, "HL" + nCurrent);
return;
}
function my_LL(nBarAgo, nCurrent, FontSize, FontColor){
var nRes = low(0);
var nBarIndex = 0;
for (var i = 0; i < nBarAgo; i++) {
if (nRes >= low(-i)) {
nBarIndex = i;
}
}
if (nBarIndex == 0) drawTextRelative( 0, nRes - 0.01, "LL", FontColor, null, Text.ONTOP | Text.CENTER, "Times New Roman", FontSize, "LL" + nCurrent);
if (nBarIndex != 0) drawTextRelative( 0, nRes - 0.01, " ", FontColor, null, Text.ONTOP | Text.CENTER, "Times New Roman", FontSize, "LL" + nCurrent);
return;
}
function my_LH(nBarAgo, nCurrent, FontSize, FontColor){
var nRes = high(0);
var nBarIndex = 0;
for (var i = 0; i < nBarAgo; i++) {
if (nRes >= high(-i)) {
nBarIndex = i;
}
}
if (nBarIndex == 0) drawTextRelative( 0, nRes + 0.01, "LH", FontColor, null, Text.BOTTOM | Text.CENTER, "Times New Roman", FontSize, "LH" + nCurrent);
if (nBarIndex != 0) drawTextRelative( 0, nRes + 0.01, " ", FontColor, null, Text.BOTTOM | Text.CENTER, "Times New Roman", FontSize, "LH" + nCurrent);
return;
}
function ClearChart(){
debugClear();
clearText();
return;
}
Comment
Comment