Announcement

Collapse
No announcement yet.

XTL alerts

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

  • XTL alerts

    Hi,

    Can you please show me some EFS code about how to use XTL to generate alerts? For example, when the color of XTL change from black to red, I want to get an alert.

    Thanks in advance.


    Jason

  • #2
    Jason
    Enclosed below is a script that uses the XTL study to trigger alerts.
    The length for the XTL can be set using Edit Studies (default is 35)
    Hope this helps
    Alex

    PHP Code:
    var xtl null;

    function 
    preMain() {
        
    setStudyTitle("XTL Alerts");
        
    setPriceStudy(true);
        
    setShowCursorLabel(false);
        
    setComputeOnClose();
        
        var 
    fp1 = new FunctionParameter("Length"FunctionParameter.NUMBER);
        
    fp1.setLowerLimit(1);        
        
    fp1.setDefault(35);
        
    }

    function 
    main(Length){

    if (
    xtl == nullxtl = new GetXTLStudy(Length);

        if(
    xtl.getValue(GetXTLStudy.XTL)==&& xtl.getValue(GetXTLStudy.XTL,-1)==||
           
    xtl.getValue(GetXTLStudy.XTL)==&& xtl.getValue(GetXTLStudy.XTL,-1)==2){
            
    Alert.playSound("ding.wav");
            
    Alert.addToList(getSymbol()+"  "+getInterval(),"XTL Blue",Color.black,Color.blue);
        }
        if(
    xtl.getValue(GetXTLStudy.XTL)==&& xtl.getValue(GetXTLStudy.XTL,-1)==|| 
           
    xtl.getValue(GetXTLStudy.XTL)==&& xtl.getValue(GetXTLStudy.XTL,-1)==2){
            
    Alert.playSound("buzz.wav");
            
    Alert.addToList(getSymbol()+"  "+getInterval(),"XTL Red",Color.black,Color.red);
        }

    return;

    Comment


    • #3
      Thanks for everybody's help. I appreciate. It's very helpful.

      Comment


      • #4
        Does anybody know if there is a reference book to show people how to call Advanced Get studies from esignal?

        Thanks in advance.

        Comment


        • #5
          Jason
          You should be able to find the relevant information in Chris Kryza's EFS Help Files which can be downloaded here in both Windows Help or HTML formats.
          Alex

          Comment


          • #6
            XTL Alert

            Alex:
            I am using your XTL Alert code and what I am getting repeat "dinging."
            What I have done to troubleshoot this situation is I looked under all my alerts and I noticed that none of my price alerts where registering "alerts." So, my question is when repeated sound alerts come up what can I do to test for the offending alert?
            Also, does your XTL Alert code - ding once or repeatedly?
            Thanks,
            Harndog

            Comment


            • #7
              Harndog
              I believe it should sound the alert only once as it has setComputeOnClose() but let me check
              Alex

              Comment


              • #8
                Harndog
                I just ran a test in Tick Replay and it only sounds a ding (or buzz) one time and triggers an alert.
                As to finding the culprit of the multiple dings the only way I can think of is to run EFS Performance Monitor and check one by one all the efs(s). Perhaps someone else has a better idea
                Alex

                Comment

                Working...
                X