Accessing 1-min indicator from a Tick cBot

Created at 02 Mar 2021, 23:49
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
JE

JeanPaul

Joined 17.10.2020

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...

 


@JeanPaul
Replies

PanagiotisCharalampous
03 Mar 2021, 08:08

Hi JeanPaul,

Yes this should work.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

JeanPaul
03 Mar 2021, 13:26

RE:

PanagiotisCharalampous said:

Hi JeanPaul,

Yes this should work.

Best Regards,

Panagiotis 

Join us on Telegram

Thank you.


@JeanPaul