Is AutoTrading is ON  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
Ram
Posts: 90
Joined: 25 Nov 2014
Has thanked: 17 times
Been thanked: 5 times

Is AutoTrading is ON

Postby Ram » 18 Feb 2015

Hi All,

I'm looking for the correct way for my code to know if the strategy is ON for AutoTrading:

Image

I've tried this without success:

Code: Select all

If Environment.IsRealTimeCalc AndAlso Environment.IsAutoTradingMode Then
Thx much in advance!
Best,
R.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Is AutoTrading is ON

Postby Henry MultiСharts » 18 Feb 2015

Hello Ram,

IApplicationInfo.IsAutoTradingMode Property - Indicates if auto-trading is on.
IsRealTimeCalc can be true in forward testing, with auto trading off.

Ram
Posts: 90
Joined: 25 Nov 2014
Has thanked: 17 times
Been thanked: 5 times

Re: Is AutoTrading is ON

Postby Ram » 18 Feb 2015

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 use "IApplicationInfo.IsAutoTradingMode" I get an error:
Reference to a non-shared member requires an object reference.
when trying to look at the objects of IApplicationInfo i get only this:
Image

Don't know if it's relevant or not but the code is in an indicator and not in a signal.

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Is AutoTrading is ON

Postby JoshM » 18 Feb 2015

When trying to use "IApplicationInfo.IsAutoTradingMode" I get an error:
I think you need to use `Environment.IsAutoTradingMode` for your goal. That is similar as you did earlier, except without the `Environment.IsRealTimeCalc` property.

Image
Attachments
scr.18-02-2015 20.33.26.png
(4.47 KiB) Downloaded 1202 times

Ram
Posts: 90
Joined: 25 Nov 2014
Has thanked: 17 times
Been thanked: 5 times

Re: Is AutoTrading is ON

Postby Ram » 19 Feb 2015

When trying to use "IApplicationInfo.IsAutoTradingMode" I get an error:
I think you need to use `Environment.IsAutoTradingMode` for your goal. That is similar as you did earlier, except without the `Environment.IsRealTimeCalc` property.

Image
Thx JoshM for your reply.

I've tried:

Code: Select all

If Environment.IsAutoTradingMode Then Output.WriteLine(DateTime.Now.ToString())
and it doesn't seems to do the trick whether the strategy is ON or NOT I don't get any print out..

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Is AutoTrading is ON  [SOLVED]

Postby Henry MultiСharts » 19 Feb 2015

Ram,

"IApplicationInfo.IsAutoTradingMode" will not work in an indicator. It will work in a signal only.

Ram
Posts: 90
Joined: 25 Nov 2014
Has thanked: 17 times
Been thanked: 5 times

Re: Is AutoTrading is ON

Postby Ram » 25 Feb 2015

Ram,

"IApplicationInfo.IsAutoTradingMode" will not work in an indicator. It will work in a signal only.
Thanks.


Return to “MultiCharts .NET”