Backgroundcolor between period
- This topic has 5 replies, 2 voices, and was last updated 6 years ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
Forums › ProRealTime English forum › ProBuilder support › Backgroundcolor between period
Hi all!
I need your help. I tryed to build an indicator that draws a background color between two Dates. The problem is that i want the indicator to draw the backgroundcolor every year so i don’t want the year as a input parameter.
Example:
“Draw Backgroundcolor RED Between 1.5. Until 15.10.”
Thanks for help.
This is an excellent example: https://www.prorealcode.com/prorealtime-indicators/supertrend-sar-background-indicator/
Since your refers to times 01:50 and 15:10 you need to use it ON TF’s <= 10 minutes.
You can use it on any TF that CLOSES on that time.
For Daily or greater TF’s you cannot refer times at all, since ProBuilder does not support Multiple Time Frames.
sorry perhaps i wrongly expressed.
if we have the 1st of may then i want the backgroundcolor until 15th of october. I need that on daily TFs and i want it to work every year in the past and the future
1 2 3 4 5 6 7 8 9 10 11 12 |
// Backgroundcolor between 10.5 - 12.12. Date1ADay = 10 Date1AMonth=5 If openday>Date1ADay and openmonth>Date1AMonth then BACKGROUNDCOLOR(255,0,0) endif return |
I did not test it:
1 2 3 4 5 6 |
// Backgroundcolor between 10.5 - 12.12. ChangeBackground = (Day >= 5 AND Month = 5) OR (Day <= 12 AND Month = 12) OR (Month >= 6 AND Month <= 11) If ChangeBackground then BACKGROUNDCOLOR(255,0,0) endif return |