retrieve a Close of a bar at a previous time?

Questions about MultiCharts .NET and user contributed studies.
drolles
Posts: 50
Joined: 03 Dec 2012
Has thanked: 4 times

retrieve a Close of a bar at a previous time?

Postby drolles » 28 Dec 2012

Hi,

How do I retrieve a Close of a bar at a previous time?

Thanks,

drolles

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

Re: retrieve a Close of a bar at a previous time?

Postby Henry MultiСharts » 28 Dec 2012

Hello drolles,

You can reference previous bar's values like that (ex. previous bar's close):

Code: Select all

Bars.Close[1]
You can reference previous study values like that (ex. previous moving average value):

Code: Select all

m_avg[1]

drolles
Posts: 50
Joined: 03 Dec 2012
Has thanked: 4 times

Re: retrieve a Close of a bar at a previous time?

Postby drolles » 28 Dec 2012

Henry,

Thanks for that.

I was meaning how to access a bar at a specific time in the past? E.g. 7am in the morning on the current date?

Thanks,

drolles

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

Re: retrieve a Close of a bar at a previous time?

Postby Henry MultiСharts » 28 Dec 2012

I was meaning how to access a bar at a specific time in the past? E.g. 7am in the morning on the current date?
It can be done with IInstrument.FullSymbolData Property


Return to “MultiCharts .NET”