Announcement

Collapse
No announcement yet.

MessageBox ?

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

  • MessageBox ?

    Hi,

    Is there a way to pop up a text message box with "OK" on it in EFS? Javascript has the window.alert function but it appears not to be supported in EFS. Any other ideas?

    I would like to pop up a messagebox or msgbox like windows.

    Thanks,
    Doug

  • #2
    I don't think there is any way to do that (though I would need to look at one possible work around first), but can you tell me what you are trying to do...why you want the message box?

    Garth
    Garth

    Comment


    • #3
      I want to add it to my strategy so that every time my strategy has a new order, I can pop up the order on my screen and play a sound to alert me.

      Comment


      • #4
        Hello Doug,

        window.alert() is a browser extension and is not part of core JavaScript. The only thing we have in EFS that is similar would be askForInput() function, which brings up the formula parameters window.

        Alternatively, you could use the drawTextRelative() or drawTextAbsolute() functions to print some text on the chart. You could then assign an EFS function to the text object that would remove the text from the chart when you click on it. Try something this:

        message.efs

        PHP Code:
        function preMain() {
            
        setStudyTitle(" Remove Message Example");
            
        setShowCursorLabel(false);
        }

        var 
        TagName null;
        function 
        main() {
            if (
        getCurrentBarIndex() == -1) {
                
        TagName "error";
                
        drawTextAbsolute1515"Message - click to remove @URL=EFS:removeIt",
                    
        Color.whiteColor.redText.RELATIVETOLEFT|Text.RELATIVETOBOTTOM|Text.CENTER,
                    
        null14TagName);
            }
        }

        function 
        removeIt() {
            
        removeText(TagName);

        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