Market price of the current bar
Market price of the current bar
25 Jul 2021, 13:34
Hello everyone,
I am trying to build my own bot and need some help.
Could someone help me how to find the current market price of the bar.
Just like Bars.OpenPrices.Last(0), Bars.ClosePrices.Last(0), Bars.HighPrices.Last(0), Bars.LowPrices.Last(0), is there a method(or other way) to find the current price.
Any help is much appreciated.
Thank you.
Replies
8089669
27 Jul 2021, 00:32
RE:
Thank you Amusleh,
I realized that Symbol.Bid or Symbol.Ask can be used after posting the query in the forum.
But Bars.ClosePrices.LastValue is something new i learnt. Thank you.
amusleh said:
Hi,
You can use Symbol.Bid or Symbol.Ask if you want to get the latest Bid/Ask price of a symbol.
If you want to get the latest bar close Price you can use Bars.ClosePrices.LastValue.
For historical bars, you can use the Bars collection index and iterate over them.
@8089669
amusleh
26 Jul 2021, 08:44
Hi,
You can use Symbol.Bid or Symbol.Ask if you want to get the latest Bid/Ask price of a symbol.
If you want to get the latest bar close Price you can use Bars.ClosePrices.LastValue.
For historical bars, you can use the Bars collection index and iterate over them.
@amusleh