Using Real Time History Matching

Questions about MultiCharts and user contributed studies.
AMarsland
Posts: 28
Joined: 30 Sep 2010
Has thanked: 5 times
Been thanked: 1 time

Using Real Time History Matching

Postby AMarsland » 26 Jan 2021

Hi there,

Just want to be clear on when an order is sent to the broker when I have two, or more data sets creating the signal and I have selected Real Time History Matching in Advanced Section of Backtesting Tab in Strategy Properties.

Let's say I have:

Data1: 5 minute Futures Index data.
Data2: 5 minute Stock Market Internal data.

and my pseudo code:

if time = 8:35 and Data2 is > n then Buy...

Am I correct in assuming that only when a new tick from the next bars time is recorded on both data sets that the order will be sent to the broker.

So when time stamp is:

Data1 08::36:01
Data2 08:35:59

No order sent...

But

when next time stamp of data2 changes:

Data1 08:36:02
Data2 08:36:02

Order is sent.

Many thanks for any help and clarification,

Anthony

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

Re: Using Real Time History Matching

Postby TJ » 26 Jan 2021

Signal works in Data1.

Unless your code specifies otherwise, other data series are not consulted.

AMarsland
Posts: 28
Joined: 30 Sep 2010
Has thanked: 5 times
Been thanked: 1 time

Re: Using Real Time History Matching

Postby AMarsland » 29 Jan 2021

Hi TJ,

Thank you for your input. I'd rally appreciate your help here...

I'm assuming that MC uses Data time stamps as the feed for TIME function. Not computer time… Am I correct in my assumption?

Maybe an example will make my query clear.

Pseudo Code:
if Time = 0835 and Close of Data2 > 800 then Buy Close Limit;

Data1 E-Mini S&P
timeStamp 08:34:59:000 3500 received by computer 08:34:59:500
timeStamp 08:34:59:500 3501 received by computer 08:34:59:800
timeStamp 08:35:00:000 3502 received by computer 08:35:00:200

Data2 Tick
timeStamp 08:34:59:000 500 received by computer 08:34:59:500
timeStamp 08:34:59:500 900 received by computer 08:34:59:900
timeStamp 08:35:00:000 1000 received by computer 08:35:00:500


Which of the below scenarios is correct when using Real Time History Matching:

Data1 time is used for calculation at 08:35:00:200 with Data1 close of 3501
and data2 close of 500. Therefore no order sent.

Or

Data1 and Data2 time is used for calculation at 08:35:00:500 with Data1 close of 3501
And data2 close of 900. Therefore order sent.

Anthony

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

Re: Using Real Time History Matching

Postby TJ » 29 Jan 2021

Hi TJ,

Thank you for your input. I'd rally appreciate your help here...

I'm assuming that MC uses Data time stamps as the feed for TIME function. Not computer time… Am I correct in my assumption?
. . .

Anthony
You can sent an email to support@multicharts.com for a definitive answer.

User avatar
Vlada MultiCharts
Posts: 293
Joined: 22 Apr 2020
Has thanked: 8 times
Been thanked: 76 times

Re: Using Real Time History Matching

Postby Vlada MultiCharts » 05 Mar 2021

Hello AMarsland,

The Time keyword returns a numerical value indicating the closing time of the current bar.
On the screenshot your ticks are numbered from 1 to 6 and are placed in the order of being received.

On the main data series, tick-3:

Code: Select all

timeStamp 08: 34: 59: 500 3501 received by computer at 08: 34: 59: 800
will close a 5-minute bar after receiving tick-5:

Code: Select all

timeStamp 08:35:00: 000 3502 received by computer at 08: 35: 00: 200
The script will be calculated and the order will be placed in the buffer.
On the additional data series, tick-4:

Code: Select all

timeStamp 08: 34: 59: 500 900 received by computer at 08:34:59 : 900
will close the 5-minute bar after receiving tick-6

Code: Select all

timeStamp 08: 35: 00: 000 1000 received by computer at 08: 35: 00: 500
The script will be calculated, according to the conditions of your script the order calculated on Close Data1 and Data2 will be sent on the close of the bar on Data2.

Please check the attached screenshot for more details.
MultiCharts_Forum #52979.png
(31.54 KiB) Not downloaded yet


The additional keyword is:
computerdatetime - Returns a double-precision decimal DateTime value indicating the computer's current date and time.

AMarsland
Posts: 28
Joined: 30 Sep 2010
Has thanked: 5 times
Been thanked: 1 time

Re: Using Real Time History Matching

Postby AMarsland » 21 Apr 2021

Hi there Vlada,

Thanks so much. Very useful info.

Anthony


Return to “MultiCharts”