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?
StatusLine of multiple instruments [SOLVED]
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: StatusLine of multiple instruments
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.
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.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: StatusLine of multiple instruments
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 1014 times
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: StatusLine of multiple instruments
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.
Re: StatusLine of multiple instruments
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?
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?
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: StatusLine of multiple instruments
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.