How can I get the pip-size for bricks on a Renko chart?

Created at 10 Jul 2020, 12:45
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!
RG

rgasch

Joined 14.12.2017

How can I get the pip-size for bricks on a Renko chart?
10 Jul 2020, 12:45


Does anybody know if there is an API which can tell me the brick size (in pips) for a renko chart? 

To clarify, when I set my chart to renko (on the top chart-type selector), I'd like to retrieve the value set for pip size programatically. 

Thank you for any hints :-) 


@rgasch
Replies

PanagiotisCharalampous
13 Jul 2020, 08:55

Hi rgasch,

Just get one of the previous bricks and check the difference in pips between the open and close prices e.g.

 var size = Math.Abs(Bars.ClosePrices.Last(1) - Bars.OpenPrices.Last(1)) / Symbol.PipSize;

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

koktos632
13 Jul 2020, 08:59

RE:

2 PanagiotisCharalampous
How to know the Renko chart is selected, please?

 

 


@koktos632

PanagiotisCharalampous
13 Jul 2020, 09:48

Hi koktos632,

You can check the Timeframe property.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

rgasch
13 Jul 2020, 10:54

RE:

Simple and effective, thank you very much!

 

PanagiotisCharalampous said:

Hi rgasch,

Just get one of the previous bricks and check the difference in pips between the open and close prices e.g.

 var size = Math.Abs(Bars.ClosePrices.Last(1) - Bars.OpenPrices.Last(1)) / Symbol.PipSize;

Best Regards,

Panagiotis 

Join us on Telegram

 

 


@rgasch

rgasch
16 Jul 2020, 00:43

RE:

The formula/code you provided makes perfect sense, but for some reason I have a USDCAD chart (renko size = 5 pips) where this returns "10" as a result. Any ideas what could be causing this? 

Thank you in advance

 

PanagiotisCharalampous said:

Hi rgasch,

Just get one of the previous bricks and check the difference in pips between the open and close prices e.g.

 var size = Math.Abs(Bars.ClosePrices.Last(1) - Bars.OpenPrices.Last(1)) / Symbol.PipSize;

Best Regards,

Panagiotis 

Join us on Telegram

 

 


@rgasch

PanagiotisCharalampous
16 Jul 2020, 08:42

Hi rgasch,

It works fine for me. Can you provide some more information e.g. the code you are using, screenshots etc?

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

rgasch
16 Jul 2020, 12:36

RE:

I'm an idiot who made a stupid programming error ... 

Thank you for getting back to me. 

 


@rgasch