I'm looking for the correct way for my code to know if the strategy is ON for AutoTrading:
I've tried this without success:
Code: Select all
If Environment.IsRealTimeCalc AndAlso Environment.IsAutoTradingMode Then
Best,
R.
Code: Select all
If Environment.IsRealTimeCalc AndAlso Environment.IsAutoTradingMode Then
Hello Ram,
IApplicationInfo.IsAutoTradingMode Property - Indicates if auto-trading is on.
IsRealTimeCalc can be true in forward testing, with auto trading off.
when trying to look at the objects of IApplicationInfo i get only this:Reference to a non-shared member requires an object reference.
I think you need to use `Environment.IsAutoTradingMode` for your goal. That is similar as you did earlier, except without the `Environment.IsRealTimeCalc` property.When trying to use "IApplicationInfo.IsAutoTradingMode" I get an error:
Thx JoshM for your reply.I think you need to use `Environment.IsAutoTradingMode` for your goal. That is similar as you did earlier, except without the `Environment.IsRealTimeCalc` property.When trying to use "IApplicationInfo.IsAutoTradingMode" I get an error:
Code: Select all
If Environment.IsAutoTradingMode Then Output.WriteLine(DateTime.Now.ToString())