I can't seem to get this simple IF condition to work:
// Hours when the system can trade Long or Short positions : 9am to 11:30am and 2pm to 4:12pm
// or from 9am to 4:12 according to the Lunch_Break switch:
if ( Lunch_Break == true )
( ( (vTime.getHours() >= (9+TimeZone_vs_NYC)) && (vTime.getHours() < (12+TimeZone_vs_NYC))
&& ! ( (vTime.getHours()==(11+TimeZone_vs_NYC)) && (vTime.getMinutes() >= 30) ) )
|| ( (vTime.getHours() >= (14+TimeZone_vs_NYC)) && (vTime.getHours() == (16+TimeZone_vs_NYC) && vTime.getMinutes() == 12) ) );
else if ( Lunch_Break == false)
( (vTime.getHours() >= (9+TimeZone_vs_NYC)) && (vTime.getHours() < (16+TimeZone_vs_NYC) && vTime.getMinutes() == 12) );
{
Separately, both instructions are executing correctly but only the else if condition is executed even if the switch is set to true.
Thank you again for your kind help.
Cheers.
Andrei
// Hours when the system can trade Long or Short positions : 9am to 11:30am and 2pm to 4:12pm
// or from 9am to 4:12 according to the Lunch_Break switch:
if ( Lunch_Break == true )
( ( (vTime.getHours() >= (9+TimeZone_vs_NYC)) && (vTime.getHours() < (12+TimeZone_vs_NYC))
&& ! ( (vTime.getHours()==(11+TimeZone_vs_NYC)) && (vTime.getMinutes() >= 30) ) )
|| ( (vTime.getHours() >= (14+TimeZone_vs_NYC)) && (vTime.getHours() == (16+TimeZone_vs_NYC) && vTime.getMinutes() == 12) ) );
else if ( Lunch_Break == false)
( (vTime.getHours() >= (9+TimeZone_vs_NYC)) && (vTime.getHours() < (16+TimeZone_vs_NYC) && vTime.getMinutes() == 12) );
{
Separately, both instructions are executing correctly but only the else if condition is executed even if the switch is set to true.
Thank you again for your kind help.
Cheers.
Andrei
Comment