Topics
13 Feb 2022, 08:51
 1153
 5
Replies

vypchela
15 Feb 2022, 07:56

Body size equal to 10 pips

 

Am I doing it right, I need to find the size of the body equal to 10 pips of a bearish candle
var bar = Bars[1];
var barBodyRange = Math.Abs(bar.Open - bar.Close)/ Symbol.PipSize;
if (barBodyRange  >= 10)
Thanks again.

 


@vypchela

vypchela
14 Feb 2022, 10:48 ( Updated at: 15 Feb 2022, 07:52 )

RE: Thanks I will try this.

amusleh said:

Hi,

In cTrader automate are available bars on your chart are inside a collection called Bars, you can access each bar with an index integer, example:

var bar = Bars[myBarIndex];
// To use Math functions you have to add using System; on top of your indicator/cBot
// The .NET Math.Abs method gives you the absolute value of a number
var barBodyRange = Math.Abs(bar.Open - bar.Close);

 


@vypchela