Indicator Candlestick instead of 1 single data.

Created at 27 Feb 2019, 19:48
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!
TradeMingZhi's avatar

TradeMingZhi

Joined 05.02.2019

Indicator Candlestick instead of 1 single data.
27 Feb 2019, 19:48


Series1Hour = MarketData.GetSeries(Symbol, TimeFrame.Hour); 
Rsi1HourClose = Indicators.RelativeStrengthIndex(Series1Hour.Close, RsiPeriods); 
Rsi1HourLow = Indicators.RelativeStrengthIndex(Series1Hour.Low, RsiPeriods); 
Rsi1HourHigh = Indicators.RelativeStrengthIndex(Series1Hour.High, RsiPeriods);

Rsi1HourLow.Result.Minimum(14)
Rsi1HourHigh.Result.Maximum(14)

Rsi1Hour(Low/High).Result.(Minimum/High) are static (if price does not make new high/low) but they do not correlate to Close Rsi as These may range 40-50 and Close rsi may be above/below that range.


Rsi1HourClose.Result.Minimum(14)
Rsi1HourClose.Result.Maximum(14)

I am looking to have Candlestick type of data for Close Rsi. as Close rsi keeps changing every tick even when using Mimum/Maximum Result. As its behaving like line chart.

or any other solution that would provide the real maximum of close RSI that does not change every tick.

Thanks for help! :)


@TradeMingZhi
Replies

PanagiotisCharalampous
28 Feb 2019, 09:39

Hi wisegprs,

The RSI is calculated based on a single value i.e. the close value. This is why it cannot be represented as a candlestick but only as a line. The last value of the RSI is changing because the close price of the last candle is changing on every tick. As soon as the candle is finalized the RSI value will be finalized as well.

Best Regards,

Panagiotis


@PanagiotisCharalampous

TradeMingZhi
28 Feb 2019, 13:39

RE:

Panagiotis Charalampous said:

Hi wisegprs,

The RSI is calculated based on a single value i.e. the close value. This is why it cannot be represented as a candlestick but only as a line. The last value of the RSI is changing because the close price of the last candle is changing on every tick. As soon as the candle is finalized the RSI value will be finalized as well.

Best Regards,

Panagiotis

Yeah exactly, so i guess I will have to create my own RSI indicator that uses close price for last x bars, and the latest bar or 2 bars are High/Low instead.

Would that be possible? to combine dataseries like that?


@TradeMingZhi

PanagiotisCharalampous
28 Feb 2019, 13:53

Hi wisegprs,

Based on your description it seems possible.

Best Regards,

Panagiotis


@PanagiotisCharalampous

TradeMingZhi
26 Mar 2019, 12:52 ( Updated at: 21 Dec 2023, 09:21 )

RE:

Panagiotis Charalampous said:

Hi wisegprs,

Based on your description it seems possible.

Best Regards,

Panagiotis

 

Would you be able to help me with that one? I have been thinking of how to possibly make it work, even though I was thinking about it for 5+ hours I couldn't figure this out.

 

Basically I want to have RSI that uses High/Low for latest candle in the series and rest of candles to just be close.

Example Lines:

Rsi1Hour = Indicators.RelativeStrengthIndex(Series1Hour.Close, RsiPeriods);

Series1Hour.High.LastValue();
Series1Hour.Close

 

With what im trying to achieve it will work. The problem I am trying to counter is I have a bot that for example would enter long if:

RSI crossed over 50, and Exit the trade if RSI crossed 70.

However if we have a scenario where it crosses 50 and 70 at same time it will exit and not re enter if the RSI is over 70, however there are scenarios where it goes to 69.9 and it keeps entering everytime it goes under 70 and closes the trade whenever it goes over 70.

If the bot uses High. It will exit and do nothing till next candle then crosed statements will change.

I know perhaps i could Stop it from doing anything else till next bar, but It will conflict with my other entry conditions. So I this would help alot.

An example when this happens:


@TradeMingZhi

TradeMingZhi
27 Mar 2019, 14:07

Ok I came up with an elegant solution, no need for RSI High however you can still post if you feel like it as it would help me understand how to solve that particular problem :)


@TradeMingZhi

TradeMingZhi
27 Mar 2019, 14:38

oh no actually nope, i would need to have access to On1HourBar() On4HourBar() for it to work but there is no such command rip.


@TradeMingZhi

PanagiotisCharalampous
27 Mar 2019, 14:49

Hi wisegprs,

Developing such an indicator requires some effort so I cannot help you in this. If you need professional assistance, you can consider contacting a Consultant.

Best Regards,

Panagiotis


@PanagiotisCharalampous

TradeMingZhi
27 Mar 2019, 15:22

RE:

Panagiotis Charalampous said:

Hi wisegprs,

Developing such an indicator requires some effort so I cannot help you in this. If you need professional assistance, you can consider contacting a Consultant.

Best Regards,

Panagiotis

Okay Understandable, thanks for reading


@TradeMingZhi