Detect If Backtest Or AutoTrading  [SOLVED]

Questions about MultiCharts and user contributed studies.
Metzenovich
Posts: 15
Joined: 07 Sep 2021

Detect If Backtest Or AutoTrading

Postby Metzenovich » 07 Sep 2021

Hi,

I have some actions that I want to happen in my strategy if I'm AutoTrading but that I don't want to get executed if I'm running a backtest (alerts, sharedVar, extra logging, etc).

Is there a way to detect whether the signal is being run live vs as a backtest?

For instance:

Code: Select all

If isAutoTrading = True Then BEGIN // Stuff to only do on live / auto trading, but not when backtesting END;
Thanks

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Detect If Backtest Or AutoTrading

Postby TJ » 07 Sep 2021

Go to Wiki
7 PowerLanguage Keyword Reference

under
Environment Information‎ (16 P)

Look up
GetAppInfo

Metzenovich
Posts: 15
Joined: 07 Sep 2021

Re: Detect If Backtest Or AutoTrading  [SOLVED]

Postby Metzenovich » 07 Sep 2021

Perfect, thanks!


Return to “MultiCharts”