View Single Post
  #5 (permalink)  
Old 04-14-2007, 11:21 AM
Kalenzo's Avatar
Kalenzo Kalenzo is offline
Senior Member
 
Join Date: Dec 2005
Location: Bydgoszcz - Poland
Posts: 693
Kalenzo is on a distinguished road
Quote:
Originally Posted by ralph.ronnquist
PHP Code:
bool opened_on_current_bar false;

for (
int i OrdersTotal() - 1>=0i-- ) {
    if ( ! 
OrderSelectiSELECT_BY_POS ) )
        continue;
    if ( 
OrderOpenTime() >= Time] ) {
        
opened_on_current_bar true;
        break;
    }
}
// Here the variable opened_on_current_bar is set appropriately 
Nice code but the condition OrderOpenTime() >= Time[0] will not work.
First some basic information:
OrderOpenTime() and Time[] are int's and they are like timestamp.
Time[0] is the current time value.

But lets say that we will use normal hours just for education purposes.
Assuming that we are currently on bar 12.00 on 1h chart, we open trade at 12.01, and lets say that we are 1 minute after that time (12.02).

Now lets check this condition:
if 12.01 >= 12.02 opened_on_current_bar = true;

will this code work ? I don't think so. And where is the magic number condition? Hm... try again
__________________
You need proffesional mql coder? Contact me! I will help you!
........................................
http://www.fxservice.eu/
........................................
Reply With Quote