Announcement

Collapse
No announcement yet.

MACD cross alerts

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

  • MACD cross alerts

    Can someone please walk me through on how i would be able to get macd cross alerts on my esignal. Im looking at 6 month time frames with daily intervals. I would like to plug in 20 or 30 stocks and be alerted everytime the 12 day crosses the 26 day. Thank you.

  • #2
    alny22
    The attached efs will trigger an alert window when the MACD line crosses above/below 0 which is essentially the same as the 12 period MA crossing over/under the 26 period MA.
    The popup Alert window includes information on symbol and interval besides the direction of the cross and can be used on any time frame.
    Alex
    Attached Files

    Comment


    • #3
      Via PM I was asked to modify the formula to alert on crosses between the MACD and Signal lines.
      The attached efs now does that. I have also added the condition to trigger the alert only on a confirmed cross rather than on every tick as in the prior iteration of the formula.
      All parameters for the MACD study can be modified through Edit Studies
      Alex
      Attached Files

      Comment


      • #4
        Thank you, Alex

        Alex,
        I appreciate you sharing your work and that you posted it on the BB rather than through a PM. Thank yo for honoring your commitment to esignal and our group. Your work helps us all learn rather than just one person. Time for a raise!

        Harndog

        Comment


        • #5
          Harndog
          As always thank you for your very generous thoughts
          For the record I am not an employee of eSignal
          Alex

          Comment


          • #6
            I would like an audio alert when the MACD crosses however both of the above formulas say 'syntax error' when I try to use them. Is there an up to date formula for an audio alert for a MACD cross? THANKS!!!

            Comment


            • #7
              MACD(Alerts).efs

              Originally posted by ACM View Post
              Via PM I was asked to modify the formula to alert on crosses between the MACD and Signal lines.
              The attached efs now does that. I have also added the condition to trigger the alert only on a confirmed cross rather than on every tick as in the prior iteration of the formula.
              All parameters for the MACD study can be modified through Edit Studies
              Alex
              Hello Alex or anyone else who may know..

              Is there a way to have this Macd(alerts).efs play the sound but not show up as a study in the chart window? i.e. I like the alert but don't need to see the actual study below the chart as it takes up to much space.

              Regards,

              Jim

              Comment


              • #8
                Jim
                Uncheck it [in the tree] in Edit Chart. Once you do that it will not display but still run and generate alerts
                Alex


                Originally posted by morpheous View Post
                Hello Alex or anyone else who may know..

                Is there a way to have this Macd(alerts).efs play the sound but not show up as a study in the chart window? i.e. I like the alert but don't need to see the actual study below the chart as it takes up to much space.

                Regards,

                Jim

                Comment


                • #9
                  MACD(Alerts).efs

                  Originally posted by ACM View Post
                  Jim
                  Uncheck it [in the tree] in Edit Chart. Once you do that it will not display but still run and generate alerts
                  Alex
                  Of course so simple, thanks Alex!

                  Alex is it possible to add a variable to this alert? I'm not savvy with programming but I would like add that the alert sounds when MACD crosses and above a 60 period MA for longs and below 60 MA for shorts. Could you help me with this please?

                  Regards,

                  Jim

                  Comment


                  • #10
                    I've been trying to learn EFS language even downloaded esignal 10.6 so I could use the Formula Wizard. I tried to add the vSMA20 lines below but I get a syntax error.. any ideas why?
                    Jim




                    if(getBarState()==BARSTATE_NEWBAR){

                    if(vMACD.getValue(MACDStudy.HIST,-2)<0 && vMACD.getValue(MACDStudy.HIST,-1)>0) &&
                    close() > vSMA20.getValue(MAStudy.MA)
                    {
                    Alert.playSound("ding.wav");
                    Alert.addToList(getSymbol()+" "+getInterval(),"Crossing Up",Color.black,Color.blue);
                    }
                    if(vMACD.getValue(MACDStudy.HIST,-2)>0 && vMACD.getValue(MACDStudy.HIST,-1)<0) && close() < vSMA20.getValue(MAStudy.MA){
                    Alert.playSound("buzz.wav");
                    Alert.addToList(getSymbol()+" "+getInterval(),"Crossing Down",Color.black,Color.red);
                    }
                    }

                    Comment


                    • #11
                      Jim
                      The error is most likely due to the fact that you did not initialize the MAStudy but are attempting to retrieve its values.
                      The images enclosed below illustrate what you need to do to accomplish what you want (comments are in the screenshots)
                      Alex








                      Originally posted by morpheous View Post
                      I've been trying to learn EFS language even downloaded esignal 10.6 so I could use the Formula Wizard. I tried to add the vSMA20 lines below but I get a syntax error.. any ideas why?
                      Jim




                      if(getBarState()==BARSTATE_NEWBAR){

                      if(vMACD.getValue(MACDStudy.HIST,-2)<0 && vMACD.getValue(MACDStudy.HIST,-1)>0) &&
                      close() > vSMA20.getValue(MAStudy.MA)
                      {
                      Alert.playSound("ding.wav");
                      Alert.addToList(getSymbol()+" "+getInterval(),"Crossing Up",Color.black,Color.blue);
                      }
                      if(vMACD.getValue(MACDStudy.HIST,-2)>0 && vMACD.getValue(MACDStudy.HIST,-1)<0) && close() < vSMA20.getValue(MAStudy.MA){
                      Alert.playSound("buzz.wav");
                      Alert.addToList(getSymbol()+" "+getInterval(),"Crossing Down",Color.black,Color.red);
                      }
                      }

                      Comment


                      • #12
                        Thanks Alex however this script doesn't seem to generate any alerts? I copied the formula as you wrote and have no syntax errors.

                        I noticed that in the above you have changed the previous MACStudy.HIST < or > 0 to MACDStudy.MACD < or > MACDStudy.Signal. I realize this is the same however why the change?

                        Jim

                        Comment


                        • #13
                          Jim
                          FYI I used the formula attached to post #3 of this thread as the base for the modifications (whereas you seem to be using the one attached to post #2). Anyhow I tested it (prior to posting) and it generated the alerts
                          That said checking for the histogram to cross above/below 0 is no different than checking for MACD line to cross above/below the Signal line
                          The main point is regardless of which method you use you still need to apply the other two modifications I provided and then modify the conditional statement as necessary (adapting the related modification to whichever version you are using).
                          Alex


                          Originally posted by morpheous View Post
                          Thanks Alex however this script doesn't seem to generate any alerts? I copied the formula as you wrote and have no syntax errors.

                          I noticed that in the above you have changed the previous MACStudy.HIST < or > 0 to MACDStudy.MACD < or > MACDStudy.Signal. I realize this is the same however why the change?

                          Jim

                          Comment


                          • #14
                            Thanks Alex, works now.

                            Jim

                            Comment


                            • #15
                              Jim
                              You are welcome
                              Alex


                              Originally posted by morpheous View Post
                              Thanks Alex, works now.

                              Jim

                              Comment

                              Working...
                              X