Hi,
there are some cases where I would like my strategy to know if it is running in the tester or for real. For example, in the tester, the strategy might want to use data from a database, indexed by date, and for, say the last month.
When running for real, we can use a Calendar object (it initializes to the current time and date), substract one month and use that.
However, the same will not work in the tester since the strategy really would like to know what the current time is _in the tester context_
One workaround I found is to use the timestamp of the current tick received, that is a good approximation of real and "tester" current time. However, to differentiate the tester/non-tester cases, to use more accurate means, and also to allow the same code to run without difference in the tester or for real, it would be useful to be able to interrogate the context or something else to find out.
|