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


    • #3
      Line 60 had an error from the original post, see below for the fix, this works, on setting up one mob

      Elliott = AGet.elliottWaves(0,50,300,ELLIOTTWAVES_ORIGINAL,E LLIOTTWAVES_INTERMEDIATE);

      Comment


      • #4
        Line 60 had an error from the original post, see below for the fix, this works, on setting up one mob

        Elliott = AGet.elliottWaves(0,50,300,ELLIOTTWAVES_ORIGINAL,E LLIOTTWAVES_INTERMEDIATE);
        Last edited by Ainsley; 03-04-2023, 10:45 PM.

        Comment


        • #5
          Thanks Ainsley for correction. Can you help me regarding automated trading too?


          Lucky
          [email protected]

          Comment


          • #6
            The below links (highlight and then right click and open in new tab) have most of what you need in order to cut some code but you will need to review and learn Java and JavaScript along the way, Im afraid no shortcuts exist, other than you spending many hours learning how to do it.

            No shortcuts to knowledge exist so all you need to do is sit down, open the laptop and start learning, start with the esignal courses outlined below and over a three month period you will be in a position to create something unique.

            also, one of the most important things to learn is how to write up your solution in pseudocode, which is what you will need prior to any coding, this is where the real work is done, so review this carefully and write it up in logical segments as a word document that captures your design and solution in logical detail which is then used to develop code from


            This link is where you need to start, All About JavaScript - The Foundation of EFS – EFS (esignal.com)

            This is the high level view of the EFS content EFS (esignal.com)

            This link has all the keywords to use and for review - Function Reference – EFS (esignal.com)

            Begin your journey, no shortcuts exist, download visual studio, and add the EFS add on and get going with the examples eSignal provide and start peddling.?

            It may be annoyingly hard at first but it simplifies immensely as you keep going, so press on and move forward.
            Last edited by Ainsley; 03-23-2023, 01:31 AM.

            Comment


            • #7
              Automated trading is most certainly possible and eSignal have provided all the tools to get this done, lookup Buy and Sell as key commands under the reference section.

              See below two examples that can also be used to test your design on the market, eSignal have provided an awesome tool that does all the analytics anyone could ever want as part of the program, lookup, from within the eSignal platform, Chart\Back Test Report

              Strategy.doLong("Long Signal", Strategy.MARKET, Strategy.THISBAR); // Enter a long position

              Strategy.doSell("Long Exit", Strategy.MARKET, Strategy.THISBAR); // exit a long position

              lookup the example code and run it to review, you can find it under formulas\back testing examples
              Last edited by Ainsley; 03-23-2023, 01:36 AM.

              Comment


              • #8
                Hi Ainsley, Thankyou for your comprehensive suggestion regarding EFS development. I wish I could have got this advice 3 months back. I am not very good at writing the strategy on pseudo code (if possible pls share few pseudo codes with EFS for my better understanding). I don't know any programming language just learned basics of EFS and using it by modifying the basic studies provided by eSignal. Those guides will help me alot on the process of being a programmer for my strategies.

                Regarding the mob it is potting 1 from primary pivot only, can we make it to work on major pivots as well?


                Lucky [email protected]

                Comment


                • #9
                  here is an example of pseudocode

                  IF you are happy THEN
                  smile
                  ELSE IF you are sad
                  frown
                  ELSE
                  keep face plain
                  ENDIF?

                  writeup your solution in a similar fashion, this is then used to code from

                  MOB's and Ellipses are great, I use them from the primary pivot, to go for more will give you a busy chart but each to their own, experiment is the way forward, get it working with primary and then tweak it

                  Comment

                  Working...
                  X