♥ 0 |
Hello Pete, I couldn’t find if this question has been answered. How do you create watchlist column that calculates percentage change from open to close? Similar to normal percent change, If positive then text will be green, If negative then text will be red .
Best
Marked as spam
|
Please log in to post questions.
Is it possible to make this a chart study that calculates this value above each candle? And only shows for the current candle using the input “Draw as: Value @ High”??
I am willing to pay for this project/ solution
The painting style, “Value @ High” does not display decimal values. Only whole numbers. But here is the code for that:
def dailyPercentChange = Round(100 * (close / open – 1), 2);
plot data = if IsNaN(close[-1]) then dailyPercentChange else Double.NaN;
data.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE);
testing now and dropping cash in the hat. Thanks
So I tested this so far and seems like the code is not accutaly capturing the percent change from the open price of the day to the current prices close
Instead, it looks like it is captuing only for the current (candle open to close)
In order to test this, I am using ONDEMAND and the trendline tool to draw the pertcange from open. I will try this agan in a live market enviroment
I dont mind if it uses who number percenagtes only
From my answer: “You set this column to a daily time frame.” So your observations are correct. This only measure from open to close of the current candle. With the intention the user will set the aggregation period to DAY.
Yes, I see the mistake. It works perfect as a watchlist column that is set to today.
now, how do we get it to work on the 1-minute chart and starting counting the percent change from the first candles open price to the current candles close price ?
That would be an entirely different approach, and a bit more complicated.
I understand, can we take that path?
Not here. In the Q&A forum we have one set of specifications per post. Adding a new set of specifications muddies the water and confuses the viewers.
Should i open a new post under chart studies?