Making plot the same color as candle


Category:
0
0

Hahn,

I have a lower study that plots a number value. How can I color code that value the same color as the candlestick for that day? So if there was a green candlestick on July 27th I need the plot color green. If there was a red candlestick on July 28th I need the plot yellow. Thank you Hahn!

Marked as spam
Posted by (Questions: 34, Answers: 56)
Asked on July 28, 2017 5:32 pm
72 views
0
Private answer

Without any source code I will provide a rough template. You will need to adapt this to your code.

plot signal = close > close[1]
signal.AssignValueColor(Color.CURRENT);

Just doing this freehand. I have not tested this on the platform. You can read more here: http://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look—Feel/AssignValueColor.html

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on July 28, 2017 7:48 pm
0

It says cannot call AssignValueColor. What should I do?

signal.AssignValueColor(Color.CURRENT);

( at August 1, 2017 12:35 pm)
0

Well I did mention you will have to adapt this to fit your code. You did not provide any code so there is very little I can do to solve the issue. You can take these three lines of code and paste them into a new study. This can perhaps show you how it works and help you understand how to apply it to your code:

declare lower;
plot signal = close > open;
signal.AssignValueColor(if signal then Color.UPTICK else Color.DOWNTICK);

( at August 1, 2017 12:42 pm)