How script run with multi data series?  [SOLVED]

Questions about MultiCharts and user contributed studies.
ragdoll
Posts: 49
Joined: 04 Apr 2019
Has thanked: 4 times

How script run with multi data series?

Postby ragdoll » 10 Nov 2020

Hi,

I have read the FAQ about multi data and tried to do some program. My guess is the Multicharts engine will evaluate each bar of the fastest data series. May I ask if there is any keywords of the language to have the script run only one calculation of each bar of slower data series please?

Thanks.

McGeorge
Posts: 49
Joined: 22 Jun 2018
Has thanked: 10 times
Been thanked: 6 times

Re: How script run with multi data series?  [SOLVED]

Postby McGeorge » 10 Nov 2020

If the fast data series is Data1 and the slow data series is Data2, then you can add a condition to execute the codes for Data2 such that:

If BarStatus (2) = 2 Then Begin
xxxxxxxx
End;

The first value of 2 refers to Data2, the second value of 2 refers to the closing tick of a bar.

ragdoll
Posts: 49
Joined: 04 Apr 2019
Has thanked: 4 times

Re: How script run with multi data series?

Postby ragdoll » 10 Nov 2020

Thanks so much.

May I ask if I have to place fastest data as data1 in current MC version please? Sometimes the data is added after several rounds of development which makes the refactor difficult.

Thanks.
If the fast data series is Data1 and the slow data series is Data2, then you can add a condition to execute the codes for Data2 such that:

If BarStatus (2) = 2 Then Begin
xxxxxxxx
End;

The first value of 2 refers to Data2, the second value of 2 refers to the closing tick of a bar.

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

Re: How script run with multi data series?

Postby TJ » 10 Nov 2020

Strategies trade on Data1.
That's why you place your primary trading logic on Data1.

If the detail of a faster fractal is not important in your analysis, then you can forgo having it as Data1.


Return to “MultiCharts”