Announcement

Collapse
No announcement yet.

Hull MA Alert

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

  • Hull MA Alert

    Does anyone know how to write an alert function into the HULL moving average so when the line turns from red to green or vice versa there is a audible alert?

    Preferably a simple beep.

    Thanks for the time

  • #2
    xlydj
    To make it easier for anyone who may consider trying to help you with your request you may want to provide the script you are referring to or a link to where it can be found.
    Not everyone uses that study [or the specific version of the study you are using if more than one version was posted in these forums] or knows where to find it.
    Alex

    Comment


    • #3
      Hull MA Source

      I downloaded the Hull MA from the Miscellaneous folder of the Specialty Scripts file share group.

      http://share.esignal.com/groupconten...us&groupid=114

      A study which would allow you to select your own .wav file for an alert when the average color changes would be great.

      Thanks
      Attached Files

      Comment


      • #4
        xlydj
        Following is an easy way to trigger an alert when the Hull moving average changes direction
        First create a new external variable called (for example) vLastAlert and set it intially to a value of -1 as follows

        PHP Code:
        var vLastAlert = -1
        Insert the above in line 33 of the script.
        Then replace the following existing section of the script (lines 124-129)

        PHP Code:
        if ( getBarState() == BARSTATE_NEWBAR ) {
          
          
        nPlot_1 nPlot;
          
          
        nBarCounter++;
         } 
        with the following code

        PHP Code:
        if ( getBarState() == BARSTATE_NEWBAR ) {
                if(
        nPlot nPlot_1){
                    if(
        vLastAlert != 1Alert.playSound("ding.wav");
                    
        vLastAlert 1;
                }
                if (
        nPlot nPlot_1){
                    if(
        vLastAlert != 2Alert.playSound("ding.wav");
                    
        vLastAlert 2;
                }
          
        nPlot_1 nPlot;
          
        nBarCounter++;
         } 
        This will trigger a sound alert when at the completion of the bar the Hull moving average has changed direction.
        If you have any problems in modifying the code post it as you have it and I or someone else will be available to assist you
        Alex

        Comment


        • #5
          Hull MA Alert

          Thanks

          Comment


          • #6
            xlydj
            My pleasure
            Alex

            Comment

            Working...
            X