I would like to write out a boolean that returns false
if the last order (close
) has been performed less than 24 hours earlier.
I tried with this code, but it always returns false
:
bool OnePerDay()
{
if ( OrderSelect( 1, SELECT_BY_POS, MODE_HISTORY ) )
{
if ( OrderOpenTime() < 24*60*60 ) return( true );
}
return( false );
}
My goal is to perform at least one trade per day (or other time interval), so it should open a position and close it, but not perform other orders in less than 24 hours after.
false
. Btw, do you have any reasons, why you have not +1 voted on any single answer that was provided to you in the past? – user3666197