Accessing 1-min indicator from a Tick cBot
Created at 02 Mar 2021, 23:49
Accessing 1-min indicator from a Tick cBot
02 Mar 2021, 23:49
private RelativeStrengthIndex _rsi;
protected override void OnStart()
{
var rsiBars = MarketData.GetBars(TimeFrame.Minute);
_rsi = Indicators.RelativeStrengthIndex(rsiBars.ClosePrices, 14);
}
Say I am using this cBot on a 1-Tick chart, is this the way to have an RSI on a 1-minute time frame and do I access it from the OnBar using _rsi.Result.LastValue?
Also, I am assuming the indicator will stay updated with the latest values without me having to write extra code.
Just confirming...
PanagiotisCharalampous
03 Mar 2021, 08:08
Hi JeanPaul,
Yes this should work.
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous