Calculating plots from series using different session rules

Questions about MultiCharts and user contributed studies.
User avatar
furytrader
Posts: 354
Joined: 30 Jul 2010
Location: Chicago, IL
Has thanked: 155 times
Been thanked: 217 times

Calculating plots from series using different session rules

Postby furytrader » 01 Nov 2010

I have come across a strange phenomenon in MultiCharts and I was wondering if anyone has seen this before and, if so, how they've dealt with it. It's a little complicated, so I'll try to explain it as clearly as possible:

On a single chart, I have two data series:

1) Data Series 1 is the e-Mini S&P 500 futures contract, 1 minute bar, showing 24/7 data;
2) Data Series 2 is the e-Mini S&P 500 futures contract, 15 minute bar, showing day-only session data

I have written a simple indicator that calculates two moving averages based on the data in series 2 at the end of the day session (i.e., 3:15 pm Chicago time). It then seeks to plot these levels on Data Series 1 as soon as the night session starts (at 3:30 pm Chicago time).

I've attached a chart image below that shows what this looks like. Also, here is the code for indicator:

Code: Select all

Inputs:
iSessionEnd(1515),
iFastMA(40),
iSlowMA(160);

Vars:
vFastMA(0),
vSlowMA(0);

If Time = iSessionEnd Then Begin
vFastMA = Average(Close of data2,iFastMA);
vSlowMA = Average(Close of data2,iSlowMA);
End;

Plot1(vFastMA,"FastMA");
Plot2(vSlowMA,"SlowMA");
Here is where it gets weird. When I look back at the overnight session a few days ago, the indicator is plotted fine, even though at the time the indicator is plotted, there is no data for data series 2 (since it's overnight and data series 2 always ends at 3:15 pm).

However for the current session, the indicator stops calculating at 3:15 pm and doesn't show anything after 3:15 pm, although there is data in data series 1 after that. The last plot for this indicator occurs at 3:15 pm. In other words, today, the indicator stops calculating at 3:15 even though the indicator is placed on data series 1 and data series 1 is showing data after 3:15 pm.

So here's the question: How do I get the indicator to show the data I want after 3:15 pm? I'm stumped. Thanks for any insights.
Attachments
MultiCharts Window 1.png
(60.92 KiB) Downloaded 197 times

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: Calculating plots from series using different session ru

Postby Dave Masalov » 02 Nov 2010

Dear furytrader,

This issue has been confirmed. We have added it to our fix list.

User avatar
furytrader
Posts: 354
Joined: 30 Jul 2010
Location: Chicago, IL
Has thanked: 155 times
Been thanked: 217 times

Re: Calculating plots from series using different session ru

Postby furytrader » 02 Nov 2010

Dave,

Thanks for the update. As a work-around, I wrote a separate indicator that pulls the moving average values from data series 2 into a shared data map (using the ELCollections.dll) which can then be retrieved at any time by indicators and strategies inserted into data series 1. This seems to work okay although, as you might imagine, it's more complicated than I'd like!

Thanks again.


Return to “MultiCharts”