Label color change as current price fluctuates.


Category:
0
0

Mr. Hahn:

I’ve been working with /NQ Futures and I like to also watch /ES charts at the same time. I am working with TOS. Is it possible to add a line of code to my example that would change the color of my label as the current price fluctuates. In other words If the value goes up the label turns Green and if value goes down the label turns red.  I am presently using a 2 and a 5 minute candle chart. There are a few stocks that correlate closely with each of these future products that I like to watch without keeping a watch list on the screen. The thought is by seeing changes in correlating products might give a sign of what may be coming before the future product responds. Thanks for your assistance.

input SYMB = “RUT”;

def AD = close (symbol = SYMB);

AddLabel(1, “RUT: ” + ” = ” + AD, if Close < Last price value then Color.RED else Color.GREEN);

RESOLVED
Marked as spam
Posted by (Questions: 5, Answers: 5)
Asked on November 29, 2017 1:44 pm
754 views
0
Private answer

Given the other lines of code you already have, this is how you would write the final line:

AddLabel(yes, “RUT: ” + ” = ” + AD, if AD < AD[1] then Color.RED else Color.GREEN);

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on November 29, 2017 2:43 pm
0
Thanks for your work! I added this code to my charts to display the Dow jones. How would I display the number of points up or down for the day instead of the price of the selected symbol as a label?
( at February 12, 2018 1:11 pm)
0

You should be able to do that by changing this line:
def AD = close (symbol = SYMB);
to this:
def AD = close (symbol = SYMB, period = AggregationPeriod.DAY) – close(symbol = SYMB, period = AggregationPeriod.DAY)[1];
That is current daily close minus previous daily close.

( at February 12, 2018 1:43 pm)
0

Thank you again! Wow. Have to get my kids to learn this.

( at February 12, 2018 2:20 pm)
0
Private answer

Thanks for your assistance! One more thing, I once had a scan for Ichimoku above and below the cloud with confirmation. I thought it came from you. I don’t seem to find it here so I wonder if I am  just missing it. Thanks for your time.

Marked as spam
Posted by (Questions: 5, Answers: 5)
Answered on December 17, 2017 2:06 pm
0

Thanks again I found the scan I was looking for!

( at December 17, 2017 2:14 pm)