Announcement

Collapse
No announcement yet.

Auto MOB EFS not working

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

  • Auto MOB EFS not working

    I was trying to use efs file of automob but it was showing following error-?

    C:\Users\abc\Documents\ICE eSignal\Formulas\Back Testing Examples\automob.efs, line 1: Error: Failed to call 'GetPivotsStudy': function is not defined (yet).

    I am providing the efs program here as unable to upload efs file. file share link of the file is
    eSignal File Share - The App? .

    knowledgebase link for this efs is AutoMOB.efs – EFS (esignal.com)

    Please help me out by correcting this efs.?


    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() {
    checkVersion(2, "http://share.esignal.com/ContentRoot/PowerStation/MAG-EFS/AutoMOB.efs");

    addEntitlement("AGST", "Not entitled for Advanced GET Studies");
    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.MOSTRECENTWAVEBAR INDEX);

    if(nMRWIndex == null)
    return;

    if(getCurrentBarIndex() == 0) {
    if(nLastMRW == 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.aqua, 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.aqua, 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;
    }


    }

    }

    ?

  • #2
    Somehow made this efs working on 21 versin , but its plotting only 1 mob from Primary Pivot. Corrected EFS program below. Can someone modify it to work on Major Pivots as well.

    //Check every line 1 by 1

    var fpArray = new Array();
    var bInit = false; // This code block executes only once at the beginning of initialization.



    var Pivot = AGet.pivots(PIVOTS_PRIMARY);
    var elliott = null;
    var Symbol = null;
    var Interval = null;
    //AGet.elliottWaves(0,50,300,ELLIOTTWAVES_ORIGINAL,E LLIOTTWAVES_INTERMEDIATE);
    //ELLIOTT AKTERNATE CONSTANTS
    //ELLIOTTWAVES_ORIGINAL = 0
    //ELLIOTTWAVES_AGGRESSIVE = 1
    //ELLIOTTWAVES_SHORTTERM = 2
    //ELLIOTTWAVES_LONGTERM = 3

    //RETURN SERIES
    //ELLIOTTWAVES_PTI = 0
    //ELLIOTTWAVES_PROJECTION1 = 1
    //ELLIOTTWAVES_PROJECTION2 = 2
    //ELLIOTTWAVES_MAJOR = 3
    //ELLIOTTWAVES_INTERMEDIATE = 4
    //ELLIOTTWAVES_MINOR = 5
    //ELLIOTTWAVES_WAVE4CHANNEL1 = 6
    //ELLIOTTWAVES_WAVE4CHANNEL2 = 7
    //ELLIOTTWAVES_WAVE4CHANNEL3 = 8

    //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() {
    //checkVersion(2, "http://share.esignal.com/ContentRoot/PowerStation/MAG-EFS/AutoMOB.efs");

    addEntitlement("AGST", "Not entitled for Advanced GET Studies");
    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);
    if(bInit == false){
    if(Symbol == false) symbol = getSymbol();
    if(Interval == null) Interval = getInterval();
    vSymbol = Symbol+","+Interval;

    elliott = AGet.elliottWaves(0,50,300,ELLIOTTWAVES_ORIGINAL,E LLIOTTWAVES_INTERMEDIATE);
    bInit = true; };
    if (isLastBarOnChart()){
    clearText();
    recalculate(function(){
    var nMRW = elliott.getValue(0);
    var nMRWIndex = elliott.getValue(0);

    if(nMRWIndex == null)
    return;

    if(getCurrentBarIndex() == 0) {
    if(nLastMRW == 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); MY CORRECTION
    // clearShape(); MY CORRECTION

    arPivots.length = 0;
    arPivotBar.length = 0;

    bMOBDrawn = false;
    }

    if(nBarState == BARSTATE_NEWBAR) {
    var nPivot = Pivot.getValue((PIVOTS_PRIMARY & PIVOTS_MAJOR));
    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.aqua, 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.aqua, 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

    Working...
    X