|
Answered my own question, now I have another
Does anyone know how to make the sendMail stop after sending one email?
To use a force index level alert...
Create an expert and replace the start function with this:
Force Index Level Alert
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
int top_lvl = 0.0055;
int low_lvl = -0.0055;
if (iForce(NULL,0,13,MODE_EMA,PRICE_TYPICAL,0)>top_lv l||(iForce(NULL,0,13,MODE_EMA,PRICE_TYPICAL,0)<low _lvl)) {
Alert("The Force is: "+iForce(NULL,0,13,MODE_EMA,PRICE_TYPICAL,0));
//SendMail("Force Levels","Time to trade");
}
//----
return(0);
}
//+------------------------------------------------------------------+
To use a macd level alert...
MACD level alert
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
int top_lvl = 0.004;
int low_lvl = -0.004;
if (iMACD(NULL,0,12,26,9,PRICE_MEDIAN,MODE_MAIN,0)>to p_lvl||iMACD(NULL,0,12,26,9,PRICE_MEDIAN,MODE_MAIN ,0)<low_lvl)
Alert("The MACD is: " + iMACD(NULL,0,12,26,9,PRICE_MEDIAN,MODE_MAIN,0));
//----
return(0);
}
//+------------------------------------------------------------------+
|