How can I detect using code, the backtest modelling mode

 
I would like to be able to check by code whether the backtest is using open price, control prices and tick data/mode. So that I can restrict the use of open price. How can I do that?
Reason: