I am backtesting a strategy over multiple markets and want to have a parameter that allows me to specify a time filter so that I don't trade x minutes prior to the market close. I could easily do this by specifying the time myself in each case but this is not ideal as some of these markets close at different times to others. Is there a way of writing code in the following way:
// Test on trade entry
if( time >= market open + nMins && time <= market close - nMins
&& //other tests )
{
enter trade
}
Where market open and close are universally understood time values that I don't need to specify in each case.
Thanks,
darmbk.

Comment