I wanted to live test a strategy the other day that trades different index CFDs but quickly had an order rejected because it was generated at the close of the last bar of the trading day, so I need to handle this within the script. Please let me know if this is the correct approach:

- The BR_FLAT flag is necessary, because otherwise the first selected asset is used to determine the trading hours based on when bars are unavailable in the history, which could end up "swallowing" legitimate bars from assets that have different trade hours.

- With BR_FLAT enabled, can I set asset-specific StartMarket and EndMarket times?

- If an order is generated at the close of the last bar before EndMarket, will this order be automatically delayed until the StartMarket open, or do I need to handle this in the script manually?