Login Page - Create Account

Support Board


Date/Time: Sat, 01 Mar 2025 07:34:46 +0000



[Programming Help] - Drawing Price Retracements with ACSIL

View Count: 495

[2021-09-24 21:25:28]
User404097 - Posts: 10
Hi, I am trying to systematically draw a price retracement as it is happening real time and updating it when a new bar closes. Currently, when I set my beginValue = sc.Low/High[startIndex], it properly puts my 100% line to the Low/High of the candle (bottom/Top of the wick). However the problem arises when I update my EndValue to be the lastVisibleBar's sc.Low/High. It is putting my 0% line at the sc.Low/High of the actual bar and not the wick. Im confused because it seems like I am missing something very trivial but cannot figure out why my EndValue is a tick or 2 too low/high on every retracement that my code draws.

I am drawing retracements for long in one custom study and short in another to keep code cleaner and to avoid problems when I need to draw both long/short at the same time.

Any help would be greatly appreciated, thanks.
[2021-09-24 22:28:30]
User404097 - Posts: 10
I think I may have figured out what I am doing wrong. I am taking the sc.Low/High of the bar directly when it opens, giving me the open price instead of the desired price.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account