Announcement

Collapse
No announcement yet.

no notification when wrong symbol specified in script

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

  • no notification when wrong symbol specified in script

    7.2 Beta (Build 519)

    Please see attached script as an example.

    There is no notification about the incorrect symbol when this script is applied, the screen displays "Loading Data ..."

    PS. I was not able to upload the example .efs file, which is considered a non-recognized extension.
    Attached Files

  • #2
    Hello trader42,

    When you check for a null value with close(0, "foobar"), null doesn't get returned, the formula just stops computing and you don't get any feedback. Check for a null value using getNewestBarIndex("foobar") before hand. This one will give you a null value so you can handle the error after that and generate some feedback. Try the following:

    Code:
    function preMain() {
            setPriceStudy(false);
            setStudyTitle(" Spread ");
    }
    
    function main(Symbol) {
        if (Symbol != null) {
            var mySymbol = Symbol;
        } else {
            var mySymbol = getSymbol();    
        }
        var vCheck = getNewestBarIndex(mySymbol) ;
        if (vCheck==null) {
            myTitle = " Invalid Symbol! ";
            setStudyTitle(myTitle);
            return;
        } else {   
            var vOtherClose=close(0, mySymbol);
            return close(0)/vOtherClose;
        }
    }
    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

    Working...
    X