A simple question on realtime versus strategy testing New comment Bob 2009.08.13 05:07 Just trying to get an answer as to why this code seems to work differently when run in the two different modes. What should happen here is an alert should occur the first time a price arrives on a new day. This is what happens when run attached to a chart. However, when run in test mode a new day alert never occurs. What is going on here? datetime Yesterday; int LastDay = 0; bool started = false; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //---- Yesterday = 0; Alert("Init!"); //---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { //---- datetime Today; Today = 0; Today = TimeCurrent(); Alert( TimeToStr(Today),":",TimeSeconds(Today), " ",TimeToStr(Yesterday),":",TimeSeconds(Yesterday)); Alert (TimeDay(Today)," ",LastDay); if (TimeDay(Today) != LastDay) { Alert("New Day"); } Yesterday = Today; LastDay = TimeDay(Today); //---- return(0); } //+------------------------------------------------------------------+ Ray 2009.08.13 05:43 #1 Some functions don't work in the tester. Alerts is one of those things that are disabled during test mode. Bob 2009.08.13 06:00 #2 Thanks phy! I do get the output from the snippet below No matter what mode I am in - I don't get the alert for "New Day" Alert (TimeDay(Today)," ",LastDay); [Deleted] 2009.08.13 07:30 #3 Go in your EA properties in the first tab and make sure that "Disable alarms" is unchecked. . Jon Bob 2009.08.13 22:27 #4 Archael wrote >> Go in your EA properties in the first tab and make sure that "Disable alarms" is unchecked. . Jon Hi Jon and thanks! It already has alarms enabled I only get the ones outside of the if statement. New comment