# Plots High/Low Price at Highest Volume
input barsago =60;
def Volbar = BarNumber();
def HighVolBar = if ((volume - Lowest(volume, barsago)) /
(Highest(volume, barsago) - Lowest(volume, barsago))) >= 1
then Volbar
else Double.NaN;
def VolHighLevel = if !IsNaN(HighVolBar) then high else VolHighLevel[1];
def VolLowLevel = if !IsNaN(HighVolBar) then low else VolLowLevel[1];
plot HighLine = if Volbar >= HighestAll(HighVolBar) then VolHighLevel else Double.NaN;
plot LowLine = if Volbar >= HighestAll(HighVolBar) then VolLowLevel else Double.NaN;
HighLine.SetDefaultColor(Color.CYAN);
HighLine.SetLineWeight(2);
LowLine.SetDefaultColor(Color.Red);
LowLine.SetLineWeight(2);
# End Plots High/Low Price at Highest Volume
Hi ChadHi @Rome,
What particular bar? I use a couple indicators to show high low of the 'x' days with highest volume... Very useful. Or high / low of yesterdays high and low is useful too as it sometimes works as support / resistance.
Thanks,
Chad
nashtech.xyz
I need the formula I described earlier. I'm not a programmer and I don't understand how to write the date in it. If this is some super difficult task, I am ready to pay for the services within reasonable limits!@Armageddon Welcome to the usethinkscript forums... How far have you gotten in your attempt...??? We're willing to help you learn if you're willing to invest some effort... We shouldn't be expected to simply write code to suit your needs without you attempting to learn the Thinkscript that you expect to help you make money... Our purpose here isn't to simply make your visions become reality... Post what you've come up with to date and we'll go from there... If you haven't started, do research here in the forums to locate code that can be modified to your needs, unless you find something that works as-is...
I understand that you are a new member but you might as well get started out on the right foot...
[USER = 10270] @Armageddon [/ USER] Используйте ввод и GetYYYYMMDD (), и вы сможете добиться того, чего хотите. Посмотрите на пример по ссылке. Не должно быть больше 5 строк кода. Сообщите мне, если вам понадобится помощь.
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Date---Time/GetYYYYMMDD
input endDate = 20210104;
def cond = if GetYYYYMMDD() == endDate then low else cond[1];
plot Price = cond;
Price.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Wow! My friend! Thank you very much!!!!!@Armageddon Below is my code you can compare it with what you have.
Code:input endDate = 20210104; def cond = if GetYYYYMMDD() == endDate then low else cond[1]; plot Price = cond; Price.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
The truth does not work on small timeframes. But thanks anyway! If there is an opportunity to correct it, it will be super!!!@Armageddon Below is my code you can compare it with what you have.
Code:input endDate = 20210104; def cond = if GetYYYYMMDD() == endDate then low else cond[1]; plot Price = cond; Price.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Everything is red! Something didn't work out for me or I didn't do it right. Can you write the formula completely and so that the level (0) disappears, and then the graph narrows because of it?Let me pay you a little for your work, just tell me where!?!@Armageddon Change low to low(period = aggregationperiod.day).
input endDate = 20210104;
def cond = if GetYYYYMMDD() == endDate then low(period = aggregationperiod.day) else cond[1];
plot Price = cond;
Price.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
On a short timeframe, still no. It shows some level of "0". On the daily chart, the level is drawn very well, the only drawback is that it shows the same level of "0" until a certain date, and because of this, the chart is narrow@Armageddon Works for me. I don't see any red. Post a ss if you can.
Code:input endDate = 20210104; def cond = if GetYYYYMMDD() == endDate then low(period = aggregationperiod.day) else cond[1]; plot Price = cond; Price.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
I've already ticked all sorts of boxes.all the same, the daily chart narrows due to the fact that the level "0" is visible. And on a short timeframe, it is always " 0"@generic Your code works great for me as well. @Armageddon Do you have "Fit studies" un-checked in the settings? If you do, what symbol are you trying it on, what aggregation, and do you have extended hours on or off?
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Start a new thread and receive assistance from our community.
useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.
We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.
If you are new, or just looking for guidance, here are some helpful links to get you started.