Announcement

Collapse
No announcement yet.

Bogus parameter list in MAStudy() causes the eSignal app to crash

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bogus parameter list in MAStudy() causes the eSignal app to crash

    Hi,

    I was working on a piece of code to pass a obv() series object to a moving average that causes the eSignal application to crash.

    Based on my review of the code it was a user error (me), that caused the problem. I forgot to change the MAStudy() to wma(). I ended up passing a series object created from a obv() object.

    Although this is a user error this type of problem should not result in the eSignal application to crash.

    The MAStudy() and all such studies should have some sort of internal error handling that should intercept nasty errors like this and should not allow the eSignal application to crash.

    Following is the code that results in the eSignal application to crash:

    PHP Code:
    /**************************************************

    RE          : Mar-02-2008_Code_causes_crash.efs
    DATE        : Mar-02-2008
    DESCRIPTION : The following code segment results in a crash of eSignal.
                  The code attempts to create an OnBalanceVolume obv() object that
                  is then passed to a Weighted MAStudy().

                  I inadvertently used MAStudy() instead of wma().

                  The parameter list for MAStudy() is as follows:

                  MAStudy(Length, Offset, PriceSource, [StudyType], MovingAverageType)

                  The parameter list for wma() is as follows:

                  wma(nLength [, Series | sym() | inv() ][, nBarIndex ] )

                  During the course of making a code change I incorrectly used
                  MAStudy() instead of wma().  It appears that the MAStudy()
                  encountered a problem while processing the "PriceSource".

                  The version of eSignal that results in this problem is:

                  Version : 10.0.1086.932 (12/22/2007)

                  To recreate the problem open an advanced chart using the symbol
                  ES #F.  Then load the code for this study.

                  I have confirmed that this code does result in the eSignal
                  application to crash.

    **************************************************/

    // Define our Global variables

    var soOBV   null;    // Series Object
    var vOBV    null;    // Initialized OBV Series Object
    var vOBV_MA null;    // Initialized MA  Series Object


    function preMain() {
        
    setStudyTitle("OBV Study");
        
    setPriceStudy(false);
        
    setShowTitleParameters(false);

        
    setCursorLabelName("OBV"0);
        
    setPlotType(PLOTTYPE_LINE0);
        
    setDefaultBarStyle(PS_SOLID0);
        
    setDefaultBarThickness(10);
        
    setDefaultBarFgColor(Color.red0);


        var 
    fp1 = new FunctionParameter("MALength"FunctionParameter.NUMBER);
            
    fp1.setLowerLimit(1);        
            
    fp1.setDefault(5);

        var 
    fp2 = new FunctionParameter("MAType"FunctionParameter.STRING);
            
    fp2.setName("MAType");
            
    fp2.addOption("MAStudy.SIMPLE");
            
    fp2.addOption("MAStudy.EXPONENTIAL");
            
    fp2.addOption("MAStudy.WEIGHTED");
            
    fp2.addOption("MAStudy.VOLUMEWEIGHTED");
            
    fp2.setDefault("MAStudy.WEIGHTED");
    }

    function 
    main(MALengthMAType) {
        
    // Create an instance of our OBV:

        
    if (vOBV == null)
        {
            
    vOBV  obv(sym("ES #F"));
            
    soOBV vOBV.getValue(0);
                    
            if (
    vOBV == null || soOBV == null)
            {
                return;
            }
        }


        
    // Create an instance of our OBV moving average:

        
    if (vOBV_MA == null)
        {
            
    vOBV_MA = new MAStudy(MALength0soOBVMAStudy.MA, eval(MAType));

            if (
    vOBV_MA == null)
            {
                return;
            }
        }


        
    // Generate a moving average based on our OBV:

        
    var nOBVMA vOBV_MA.getValue(MAStudy.MA);

        return 
    nOBVMA;

    When the crash occurred I did complete the crash report with information regarding this problem.

    Please let me know if there is any additional information needed to address this problem.

    THANX(MKD).

  • #2
    Hello dwymi02,

    You are correct. This should not cause a crash. I've reported this to our developers.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      Jason,

      Thank you for your response. I do appreciate the efforts of your team in addressing this issue.

      THANX(MKD).

      Comment

      Working...
      X