View Single Post
  #6 (permalink)  
Old 04-14-2007, 12:06 PM
lowphat's Avatar
lowphat lowphat is offline
Senior Member
 
Join Date: Sep 2005
Posts: 199
lowphat is on a distinguished road
could you do something like this or would it be bad practice?

Code:
if (NewBar() == true) allowtrade=true;

if (allowtrade)//entry
   {
   if(logic)buy;
   if(logic)sell;
   allowtrade=false;
   }

}
Code:
bool NewBar()
{
   static datetime lastbar = 0;
   datetime curbar = Time[0];
   if(lastbar!=curbar)
   {
      lastbar=curbar;
      return (true);
   }
   else
   {
      return(false);
   }
}

Last edited by lowphat; 04-14-2007 at 12:10 PM.
Reply With Quote