Rolling Open Close Chart

Created at 26 Feb 2024, 19:17
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!
CT

ctid2889667

Joined 26.02.2024

Rolling Open Close Chart
26 Feb 2024, 19:17


Hi All,

I am new to cTrader and its programming in C#. I am trying to work on below Tradingview code which gives a rolling chart for specified number of last bars on current chart. If we want a chart based on multiplier 10, it will take open of the bar 10 candles [index-10] before and close of current candle [index] to make an open close bar. It will be rolling chart so will keeping takin open of 10 candles away and close of new candle. Appreciate if some one can provide feedback on this. Here is the code for same in tradingview.

//@version=5

indicator(title='Rolling OHLC Candles', shorttitle='Rolling OHLC')

tf = input.int(5, 'Timeframe Multiplier', minval=1, step=1)

rollclose = close

rollopen = open[tf - 1]

rollhigh = tf == 1 ? high : ta.highest(high, tf)

rolllow = tf == 1 ? low : ta.lowest(low, tf)


 

Color = rollopen > rollclose ? #ef5350 : #26a69a

plotcandle(rollopen, rollhigh, rolllow, rollclose, title='Rolling OHLC Candles', color=Color, wickcolor=Color, bordercolor=Color)


Thanks.


@ctid2889667
Replies

PanagiotisCharalampous
27 Feb 2024, 06:52

Hi there,

Can you reform your post into specific questions? What exactly do you need to know?

Best regards,

Panagiotis


@PanagiotisCharalampous

ctid2889667
27 Feb 2024, 20:46 ( Updated at: 28 Feb 2024, 13:28 )

RE: Rolling Open Close Chart

PanagiotisCharalampous said: 

Hi there,

Can you reform your post into specific questions? What exactly do you need to know?

Best regards,

Panagiotis

Thanks for reply. Actually I have very basic knowledge of C# programming so was not able to convert above tradingview code to cAlgo. Just played with some examples and came up with below code which seems to work. I want to have it in a non overlay mode in a separate panel. This is too much for my programming knowledge. Need your help for this.

Here is the code:

 

@ctid2889667

PanagiotisCharalampous
28 Feb 2024, 08:33

Hi there,

Unfortunately I cannot write the indicator for you, neither I can debug it. I don't understand what it is supposed to do. However if you have specific questions, feel free to ask them. Else you can consider getting professional assistance.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
28 Feb 2024, 08:33

Hi there,

Unfortunately I cannot write the indicator for you, neither I can debug it. I don't understand what it is supposed to do. However if you have specific questions, feel free to ask them. Else you can consider getting professional assistance.

Best regards,

Panagiotis


@PanagiotisCharalampous