StatusLine of multiple instruments  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
DasBoot
Posts: 6
Joined: 11 Feb 2013
Has thanked: 2 times

StatusLine of multiple instruments

Postby DasBoot » 14 Feb 2013

I am building the strategy trading many instruments at once and need to get the current StatusLine of each instrument.
Can you give me example how to do this?

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

Re: StatusLine of multiple instruments

Postby Henry MultiСharts » 14 Feb 2013

Hello DasBoot,

IStatusLine returns the values of the main data series only.
In order to get the values of an instrument, different from the main dataseries, you need to do one of the following:
1) For getting access to ask and bid values you can use ITradingProfile interface ->RT event.
2) For ask, bid and last values you can use IDataLoader interface-> InstrumentDataRequest Members-> Specify the QuoteField and add a flag Subscribe2RT.

DasBoot
Posts: 6
Joined: 11 Feb 2013
Has thanked: 2 times

Re: StatusLine of multiple instruments

Postby DasBoot » 14 Feb 2013

Could you provide code example for Subscribe2RT scenario?

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

Re: StatusLine of multiple instruments

Postby Henry MultiСharts » 11 Dec 2013

Attached is a sample code that subscribes to realtime data and outputs the realtime bar values in Output tab of PLEditor window then unsubscribes from realtime data
Attachments
Test_DataLoader_RT_MC85_v1.1.pln
(2.31 KiB) Downloaded 1005 times

Jobauma
Posts: 113
Joined: 16 Apr 2013
Has thanked: 25 times
Been thanked: 6 times

Re: StatusLine of multiple instruments

Postby Jobauma » 20 May 2014

I'm trying to access the previous values of open, high, low and close, but how do you assign the values to a series?

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

Re: StatusLine of multiple instruments

Postby Henry MultiСharts » 21 May 2014

Hello Jobauma,

Please specify what you mean exactly.

Jobauma
Posts: 113
Joined: 16 Apr 2013
Has thanked: 25 times
Been thanked: 6 times

Re: StatusLine of multiple instruments

Postby Jobauma » 21 May 2014

Basically what I've tried is to store the values on each close and want this to happen independently from the main timeframe you're on. The current values are great, but I want to use the values prior to those too. :)

Jobauma
Posts: 113
Joined: 16 Apr 2013
Has thanked: 25 times
Been thanked: 6 times

Re: StatusLine of multiple instruments

Postby Jobauma » 26 Jun 2014

This is what I'm trying to achieve.

Let's say the timeframe you apply the script to is 15M, while the resolution is 1M, "X" defines which candle on 1M.

Example: rt.High[X]

rt.High[0] = Current high on 1M
rt.High[1] = Previous high on 1M

Does anybody know how to solve this?

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

Re: StatusLine of multiple instruments

Postby Henry MultiСharts » 08 Jul 2014

Jobauma, you need to add second data series to your chart and then reference it in the code or use the DataLoader to obtain and process the required data.


Return to “MultiCharts .NET”