RAQ

How to find the length of the candle body


Q:

I want to get the length of the candle body. I wanted to take the difference between the open and close. Can that be done and how?

 

A:

Yes, it can be done.

 

Drag and drop a Variable Element  from the New Elements toolbox pane onto the Drawing pad. Click the (+) to configure it:


 

 

Set the of data type to double, and perhaps give it a nice name, like CandleBody

 


 

 

 Click the Assignment tab and enter: High[0] – Low[0]

 


 

 Three points:

(1)

The brackets [] get the value for the “candle shift”, for any of the 4 values (High, low, Open, Close) where 0 is the current candle. There is more info about shift here:


 

(2)

You should put logic in front of this to detect if the High value is greater or less than the Low value

 

(3)

Always click the Build button after you have edited the Assignment tab to see if you have accidently injected any syntax errors.

 


 

 

Finally, I am going to add a function to the Toolbox to make this easier. Look for it in the next release (4.0.0.77) under the “Bar” menu.