Here is the AutoMOB EFS formula. This simply plots MOB's based off certain elliott wave points. In no way is this guaranteed to be right or wrong, just sample code showing you you might do it.
YOU NEED BUILD 566 or later for this to work and the Advanced GET studies as part of your eSignal subscription.
You can get there here: http://share.esignal.com/groupconten...r=&groupid=132
m.
YOU NEED BUILD 566 or later for this to work and the Advanced GET studies as part of your eSignal subscription.
You can get there here: http://share.esignal.com/groupconten...r=&groupid=132
m.
PHP Code:
var pivots = new GetPivotsStudy();
var elliott = new GetElliottStudy(300, 0, 50, 5, 35, 0);
var nLastMRW = null; // Last Most Recent Wave (used for reloading)
var nLastMRWIndex = null;
var dLastMRWHigh = null;
var dLastMRWLow = null;
var bMOBDrawn = false;
var arPivots = new Array();
var arPivotBar = new Array();
function preMain() {
setPriceStudy(true);
setStudyTitle("Auto MOB");
}
function main() {
// What's the most recent wave? If it has changed since last remembered, reload the EFS.
// If the elliot waves change, you can count on the pivots updating.
var nMRW = elliott.getValue(GetElliottStudy.MOSTRECENTWAVE);
var nMRWIndex = elliott.getValue(GetElliottStudy.MOSTRECENTWAVEBARINDEX);
if(getCurrentBarIndex() == 0) {
if(nLastMRW == null) {
if(nMRWIndex != null) {
nLastMRW = nMRW;
nLastMRWIndex = nMRWIndex;
dLastMRWHigh = high(nMRWIndex);
dLastMRWLow = low(nMRWIndex);
}
} else if(nLastMRW != nMRW || nMRWIndex > nLastMRWIndex || low(nMRWIndex) != dLastMRWLow || high(nMRWIndex) != dLastMRWHigh) {
nLastMRW = null;
nLastMRWIndex = null;
dLastMRWHigh = null;
dLastMRWLow = null;
reloadEFS();
return;
} else {
nLastMRWIndex = nMRWIndex;
dLastMRWHigh = high(nMRWIndex);
dLastMRWLow = low(nMRWIndex);
}
}
var nBarState = getBarState();
// If ALLBARS, init the wave arrays and vars.
// If newbar, shift the bar indexes
if(nBarState == BARSTATE_ALLBARS) {
clearLineTool(LineTool.MOB);
clearShape();
arPivots.length = 0;
arPivotBar.length = 0;
bMOBDrawn = false;
}
if(nBarState == BARSTATE_NEWBAR) {
var nPivot = pivots.getValue(GetPivotsStudy.PIVOTS, -1);
if(nPivot != null) {
arPivots.push(nPivot);
arPivotBar.push(getCurrentBarIndex());
}
}
if(bMOBDrawn == false && getCurrentBarIndex() == 0) {
bMOBDrawn = true;
var nStart = arPivots.length-1;
var i;
var nCount = 0;
for(i = nStart; i >= 0; i--) {
var vPivot = arPivots[i];
var vBar = arPivotBar[i]-1;
// debugPrintln("I: " + i + " Pivot: " + vPivot + " Bar: " + vBar);
// 1 primary
// 2 major
// 3 intermediate
// 4 minor
// if negative, a downsize pivot.
if(vPivot == 1) {
addLineTool(LineTool.MOB, vBar, high(vBar), Color.magenta, Color.magenta, Color.black, "mob");
drawShapeRelative(vBar, 20, Shape.UPTRIANGLE, "", Color.blue, Shape.RELATIVETOTOP, "Pt" + getValue("rawtime", vBar));
drawShapeRelative(vBar, 10, Shape.UPTRIANGLE, "", Color.blue, Shape.RELATIVETOBOTTOM, "Pb" + getValue("rawtime", vBar));
nCount++;
} else if(vPivot == -1) {
addLineTool(LineTool.MOB, vBar, low(vBar), Color.magenta, Color.magenta, Color.black, "mob");
drawShapeRelative(vBar, 20, Shape.DOWNTRIANGLE, "", Color.red, Shape.RELATIVETOTOP, "Pt" + getValue("rawtime", vBar));
drawShapeRelative(vBar, 10, Shape.DOWNTRIANGLE, "", Color.red, Shape.RELATIVETOBOTTOM, "Pb" + getValue("rawtime", vBar));
nCount++;
/**
} else if(vPivot == 2) {
addLineTool(LineTool.MOB, vBar, high(vBar), Color.yellow, Color.yellow, Color.black, "mob");
drawShapeRelative(vBar, 20, Shape.UPTRIANGLE, "", Color.yellow, Shape.RELATIVETOTOP, "Pt" + getValue("rawtime", vBar));
drawShapeRelative(vBar, 10, Shape.UPTRIANGLE, "", Color.yellow, Shape.RELATIVETOBOTTOM, "Pb" + getValue("rawtime", vBar));
nCount++;
} else if(vPivot == -2) {
addLineTool(LineTool.MOB, vBar, low(vBar), Color.yellow, Color.yellow, Color.black, "mob");
drawShapeRelative(vBar, 20, Shape.DOWNTRIANGLE, "", Color.yellow, Shape.RELATIVETOTOP, "Pt" + getValue("rawtime", vBar));
drawShapeRelative(vBar, 10, Shape.DOWNTRIANGLE, "", Color.yellow, Shape.RELATIVETOBOTTOM, "Pb" + getValue("rawtime", vBar));
nCount++;
**/
}
if(nCount > 4)
break;
}
}
}
Comment