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.
Announcement
Collapse
No announcement yet.
MACD cross alerts
Collapse
X
-
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.
AlexAttached Files
-
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
AlexAttached Files
Comment
-
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
-
MACD(Alerts).efs
Originally posted by ACM View PostVia 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
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
-
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 PostHello 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
-
MACD(Alerts).efs
Originally posted by ACM View PostJim
Uncheck it [in the tree] in Edit Chart. Once you do that it will not display but still run and generate alerts
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
-
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
-
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 PostI'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
-
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
-
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 PostThanks 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
Comment