Multi time frame signal  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
User avatar
tito0224
Posts: 15
Joined: 01 May 2013
Has thanked: 2 times
Been thanked: 6 times

Multi time frame signal

Postby tito0224 » 15 May 2013

I would like to use the same signal criteria on two different time frames, ie. 5 min and 60 min and when they are both true enter a trade.

Is there an easy way to accomplish this?

I tried to plot the 60 minute data on the same chart and use the BarsOfData(1) method but I always only get the 5 minute data series and when I change the data_stream int input I get null result.

If I were to create a signal that would be applied to the 5 min chart, which uses the data loader to load in data for the same symbol but with a resolution of 60 minutes, Is there way to apply functions to results from the DataLoader? So that I can test the indicator values (ie sma value of 5 minute compared to sma value of 60 minute?)

Any help or guidance would be appreciated. Thank You.

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

Re: Multi time frame signal

Postby Henry MultiСharts » 16 May 2013

when I change the data_stream int input I get null result.
Hello tito0224,

Please right click on your chart and go to Format Instruments. Check "Data #" column. Make sure you are using the proper index value of the data series you need in the code.
There has been an issue with using/referencing multiple data series from the code discussed here. Use the suggested workaround if you encounter the same issue, the fix will be implemented in the next version of MultiCharts .Net.
If I were to create a signal that would be applied to the 5 min chart, which uses the data loader to load in data for the same symbol but with a resolution of 60 minutes, Is there way to apply functions to results from the DataLoader? So that I can test the indicator values (ie sma value of 5 minute compared to sma value of 60 minute?)
At the moment you need to create your own code to process the IDataLoader result and perform study calculation on it. We are going to add this functionality as "native solution" in one of the future versions of MultiCharts .Net.

User avatar
tito0224
Posts: 15
Joined: 01 May 2013
Has thanked: 2 times
Been thanked: 6 times

Re: Multi time frame signal

Postby tito0224 » 22 May 2013

Thanks.

I got BarsOfData(2) working correctly now. How do I get the data for the currently open Bar?

for example, we are currently trading in the 11:00 am bar. It is not complete yet, but I would like to get the Open, High, and Low of this bar. I used the below but only seem to get the last closed bar.

Code: Select all

var b = BarsOfData(2);
Output.WriteLine("------");
Output.WriteLine("Bar info: Open={0}, High{1}, Low={2}, Close={3}, Time={4}", b.OpenValue, b.HighValue, b.LowValue, b.CloseValue, b.TimeValue);
Output.WriteLine("Bar info: Open={0}, High{1}, Low={2}, Close={3}, Time={4}", b.Open[1], b.High[1], b.Low[1], b.Close[1], b.Time[1]);
Output.WriteLine("Bar info: Open={0}, High{1}, Low={2}, Close={3}, Time={4}", b.Open[0], b.High[0], b.Low[0], b.Close[0], b.Time[0]);
I get the following responses:

------
Bar info: Open=95.84, High96.05, Low=94.67, Close=95.24, Time=5/22/2013 10:00:00 AM
Bar info: Open=96.08, High96.19, Low=95.78, Close=95.85, Time=5/22/2013 9:00:00 AM
Bar info: Open=95.84, High96.05, Low=94.67, Close=95.24, Time=5/22/2013 10:00:00 AM
------
Bar info: Open=95.84, High96.05, Low=94.67, Close=95.24, Time=5/22/2013 10:00:00 AM
Bar info: Open=96.08, High96.19, Low=95.78, Close=95.85, Time=5/22/2013 9:00:00 AM
Bar info: Open=95.84, High96.05, Low=94.67, Close=95.24, Time=5/22/2013 10:00:00 AM
------
Bar info: Open=95.84, High96.05, Low=94.67, Close=95.24, Time=5/22/2013 10:00:00 AM
Bar info: Open=96.08, High96.19, Low=95.78, Close=95.85, Time=5/22/2013 9:00:00 AM
Bar info: Open=95.84, High96.05, Low=94.67, Close=95.24, Time=5/22/2013 10:00:00 AM
------
Bar info: Open=95.84, High96.05, Low=94.67, Close=95.24, Time=5/22/2013 10:00:00 AM
Bar info: Open=96.08, High96.19, Low=95.78, Close=95.85, Time=5/22/2013 9:00:00 AM
Bar info: Open=95.84, High96.05, Low=94.67, Close=95.24, Time=5/22/2013 10:00:00 AM
------

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

Re: Multi time frame signal  [SOLVED]

Postby Henry MultiСharts » 23 May 2013

You need to turn on IOG for intra bar calculations and uncheck "Realtime-History Matching" in Format->Signal->Format->Properties tab.

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

Re: Multi time frame signal

Postby Henry MultiСharts » 07 Jun 2013

There has been an issue with using/referencing multiple data series from the code discussed here.
This issue has been resolved in MultiCharts .NET 8.7 Beta 2.


Return to “MultiCharts .NET”