Login Page - Create Account

Support Board


Date/Time: Fri, 22 Nov 2024 17:05:01 +0000



Post From: Help with Conditional Candle Coloring Based on AV-BV Values Across Different Time Interval

[2024-10-07 07:18:52]
User133078 - Posts: 3
Hello everyone,

I'm working on a script to color my 30-minute candles based on specific AV-BV criteria, but I'm encountering some issues.

Here's what I'm trying to achieve:

Between 3:30 PM and 4:00 PM: color the candle if AV-BV > 2600
Between 4:00 PM and 4:30 PM: color the candle if AV-BV > 2000
Between 4:30 PM and 5:00 PM: color the candle if AV-BV > 1500
And so on.


The problem is that when I apply my formula, it also colors candles outside the defined time ranges, which is not what I want.

Additionally, I've created a separate study for each different time interval, but I'm not sure if that's the right approach (see screenshot).

Here’s the code I’m using: (LOOK SCREENSHOT)
=IF((BARTIME >TIME(15,30,00)),(BARTIME<TIME(16,00,00)),(AV-BV>2600))
=IF((BARTIME >TIME(16,00,00)),(BARTIME<TIME(16,30,00)),(AV-BV>2100))
…etc

Do you have any suggestions on how to ensure each time interval is correctly colored based on its specific AV-BV condition? And is using a separate study for each time interval the right way to go?

Thanks in advance for your help!

imageCapture.PNG / V - Attached On 2024-10-07 07:13:35 UTC - Size: 81.97 KB - 29 views
imageCaptssssure.PNG / V - Attached On 2024-10-07 07:13:46 UTC - Size: 151.93 KB - 29 views
Attachment Deleted.