Login Page - Create Account

Support Board


Date/Time: Sun, 19 May 2024 01:12:07 +0000



Post From: How to draw rectangle using ACSIL that occupy all of bar space?

[2013-08-06 08:32:21]
Hendrixon - Posts: 130
Happened to me when I built a numbers bars study.
You can't use the rectangle tool since it draws from index to index or datetime to datetime, which always fall on the middle of a bar.
The only workaround I found is to draw a vertical line and give it some width.
Not the Vertical Line Tool.... just a simple line with a start and an end that make it vertical.

There is still a problem that if you change the chart's bars spacing/width, your "bars" won't change width since they are of course hard coded to a fixed pixel width.
If you do need it to follow changing bar spacing/width, its more complicated. you need to monitor the chart's spacing thru acsil, and give your bars a width option for every chart spacing (if-elseif-elseif-elseif etc).
From memory I remember needing to do something like this (though with horizontal lines) since it wasn't as simple as finding a single factor to do "my bar width = chart spacing * factor".


Good luck.
Date Time Of Last Edit: 2013-08-06 08:33:58