Hi there,
I have this print command that I want to produce an output only during live trading and not during backtesting. Any suggestions are greatly appreciated.
If (backtesting = false) then Print(" Date ", FormatDate("yyyy-MM-dd", ELDateToDateTime(Date)))
Print Command in Real-Time Trading & NOT during backtesting [SOLVED]
-
- Posts: 66
- Joined: 26 Nov 2015
- Has thanked: 7 times
- Been thanked: 3 times
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Print Command in Real-Time Trading & NOT during backtest
You can use the `GetAppInfo()` keyword for that. When used with the `aiRealTimeCalc` value between its parentheses, that keyword returns 1 when the script calculates on real-time data (thus live trading) and a value of 0 otherwise (when backtesting).I have this print command that I want to produce an output only during live trading and not during backtesting. Any suggestions are greatly appreciated.
If (backtesting = false) then Print(" Date ", FormatDate("yyyy-MM-dd", ELDateToDateTime(Date)))
For example:
Code: Select all
if (GetAppInfo(aiRealTimeCalc) = 1) then begin
Print(" Date ", FormatDate("yyyy-MM-dd", ELDateToDateTime(Date)));
end;
-
- Posts: 66
- Joined: 26 Nov 2015
- Has thanked: 7 times
- Been thanked: 3 times
Re: Print Command in Real-Time Trading & NOT during backtest [SOLVED]
Josh,
You are awesome. Thank YOU!
You are awesome. Thank YOU!