AssignBackgroundColor Issues (format correction)


Category:
0
0

I’m having an issue where it seems like AssignBackgroundColor isn’t checking the current value of a plot. The line above it uses AssignColorValue, and works as expected. The goal is to have the column be colored orange if the criteria of the if statement are met.

The code is attached as well as a picture of the watchlist with the column in use. You can see in the picture that AssignColorValue is working as intended.

Also, a big thank you to Pete Hahn for his patience in getting me oriented with the forum.

Attachments:
Marked as spam
Posted by (Questions: 2, Answers: 3)
Asked on June 18, 2020 7:47 pm
204 views
0
Private answer

After all this I have to bring you some very bad news. The following lines in your code read several bars into the future:

def ExpH = if BarNumber() == 1 then Double.NaN else if CountH[-BarsRequiredToRemainInRange] >= BarsRequiredToRemainInRange then HHn[-BarsRequiredToRemainInRange] else if high <= ExpH[1] then ExpH[1] else Double.NaN;

def ExpL = if BarNumber() == 1 then Double.NaN else if CountL[-BarsRequiredToRemainInRange] >= BarsRequiredToRemainInRange then LLn[-BarsRequiredToRemainInRange] else if low >= ExpL[1] then ExpL[1] else Double.NaN;

The signals produced by this code are useless because future data is required to produce the plots. Which is the most likely reason you cannot get the background color to behave as you expect.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on June 18, 2020 8:17 pm
0
Thank you for this information. AssignValueColor works, so that will be good enough. Thanks again for all your hard work.
( at June 18, 2020 8:49 pm)