View Single Post
  #8 (permalink)  
Old 05-27-2007, 09:42 AM
HerbertH's Avatar
HerbertH HerbertH is offline
Member
 
Join Date: May 2006
Posts: 88
HerbertH is on a distinguished road
Quote:
Originally Posted by ryanklefas
Simple. And it could work. Then you could reset the boolean when a new day starts, at say:

Hour()==0 and Minute()==0.
Ryan, ticks do not always arrive at least once every minute. When that happens at 00:00, this would skip this EA to trade that day.

Perhaps it's batter to compare the daily bar timestamp: iTime(NULL,PERIOD_D1,0)


Lowphat's code would then be something like:


int init()
bool stoptrade=false;
datetime DailyBar=0;

if (stoptrade==false && DailyBar != iTime(NULL,PERIOD_D1,0))
{
if (logic)sell
if (logic)buy
stoptrade=true
DailyBar=iTime(NULL,PERIOD_D1,0);
}
__________________
Better being out wishing to be in, than being in wishing to be out.....
Reply With Quote