Forcing data1 to calculate when data2 does not refresh

Questions about MultiCharts and user contributed studies.
trader39
Posts: 105
Joined: 08 Jan 2006
Has thanked: 8 times
Been thanked: 5 times

Forcing data1 to calculate when data2 does not refresh

Postby trader39 » 02 May 2013

I run my most of my charts on stocks with all sessions (eg 24/7) data as 5 min bars in data 1, and regular session (ie default) data as 5 min bars in data 2. My study calculates some exponential averages(among other things) on data 1 and some on data2. During regular session (from 9:30 to 4:00 New York time) everything calculates and displays perfectly, including the moving averages for the premarket period, which are backfilled on the chart for the pre open period just after 930. The problem is, the all session averages do not calculate and display in premarket. I cannot see them until it is too late to use them!

I am already using "RecalcLastBarAfter(15);" and it does not help.

I realize I can split the all session and regular session average calculations into separate indicators and then everything will display and calculate in real time, however parts of my indicator must reference both types of averages, so this will not meet my needs. What should I do?

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

Re: Forcing data1 to calculate when data2 does not refresh

Postby TJ » 02 May 2013

I run my most of my charts on stocks with all sessions (eg 24/7) data as 5 min bars in data 1, and regular session (ie default) data as 5 min bars in data 2. My study calculates some exponential averages(among other things) on data 1 and some on data2. During regular session (from 9:30 to 4:00 New York time) everything calculates and displays perfectly, including the moving averages for the premarket period, which are backfilled on the chart for the pre open period just after 930. The problem is, the all session averages do not calculate and display in premarket. I cannot see them until it is too late to use them!

I am already using "RecalcLastBarAfter(15);" and it does not help.

I realize I can split the all session and regular session average calculations into separate indicators and then everything will display and calculate in real time, however parts of my indicator must reference both types of averages, so this will not meet my needs. What should I do?
Can you post a screenshot (with notes) to illustrate the problem?

trader39
Posts: 105
Joined: 08 Jan 2006
Has thanked: 8 times
Been thanked: 5 times

Re: Forcing data1 to calculate when data2 does not refresh

Postby trader39 » 02 May 2013

Here is an annotated screenshot with simplified demo code and workspace attached as well. The screenshot illustrates the post-market session today, but exactly the same problem occurs in premarket; the indicator simply refuses to calculate until the market opens, at which time all the intervening values are filled in at once, too late to trade from.

Please advise how to get this to calculate in real time during pre- and post-regular market hours, so it can be used for trading in these periods.
Attachments
XMADEMO.pla
(221.79 KiB) Downloaded 392 times
XMADEMO.wsp
(34.98 KiB) Downloaded 395 times
XMADEMOANNOTATED.jpg
(533.64 KiB) Downloaded 514 times

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

Re: Forcing data1 to calculate when data2 does not refresh

Postby TJ » 02 May 2013

Here is an annotated screenshot with simplified demo code and workspace attached as well. The screenshot illustrates the post-market session today, but exactly the same problem occurs in premarket; the indicator simply refuses to calculate until the market opens, at which time all the intervening values are filled in at once, too late to trade from.

Please advise how to get this to calculate in real time during pre- and post-regular market hours, so it can be used for trading in these periods.
How would you like the data2 XMA calculated?
On your chart it shows straight lines (light blue and orange). Is that how you would like them to show?

trader39
Posts: 105
Joined: 08 Jan 2006
Has thanked: 8 times
Been thanked: 5 times

Re: Forcing data1 to calculate when data2 does not refresh

Postby trader39 » 03 May 2013

The XMAs on data 2 calculate during the regular session, they stay unchanged during pre and post market. Showing them unchanged in pre- post- market is fine.

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

Re: Forcing data1 to calculate when data2 does not refresh

Postby Henry MultiСharts » 03 May 2013

Hello trader39,

Please go to Format->Study->Format "XMADemo"->Properties->uncheck the option "Realtime-history matching".


Return to “MultiCharts”