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?
Forcing data1 to calculate when data2 does not refresh
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Forcing data1 to calculate when data2 does not refresh
Can you post a screenshot (with notes) to illustrate the problem?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?
Re: Forcing data1 to calculate when data2 does not refresh
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.
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 395 times
-
- XMADEMO.wsp
- (34.98 KiB) Downloaded 398 times
-
- XMADEMOANNOTATED.jpg
- (533.64 KiB) Downloaded 514 times
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Forcing data1 to calculate when data2 does not refresh
How would you like the data2 XMA calculated?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.
On your chart it shows straight lines (light blue and orange). Is that how you would like them to show?
Re: Forcing data1 to calculate when data2 does not refresh
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.
- 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
Hello trader39,
Please go to Format->Study->Format "XMADemo"->Properties->uncheck the option "Realtime-history matching".
Please go to Format->Study->Format "XMADemo"->Properties->uncheck the option "Realtime-history matching".