How to script a drawing "Trendline"?

Stoynks

Member
I think I meant the drawing "Price Level" but the same idea/concept.

Once I mark my trendline on the chart with a certain price, is it possible to automatically create two additional lines? One that's 90% of the main trendline and the other at 130%. Let's say I draw the main trendline at $5.00. It would also create a risk/stop-loss at $4.50 which is 90% of the main trendline. And at 130% of the main trendline, a line would be created at $6.50 which would be my reward or sell for profit.
 
Last edited:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

I think so. But, for example, for the Fibonacci Retracements, you can edit the properties. I just want to know if you can edit the properties for the drawing "Trendline" or "Price Level" by adding two additional lines with a 90% line and a 130% line. Would this be possible? Or is there anything similar to like this? Is there a drawing that I don't know of where you can have multiple price levels?
 
@Stoynks I see where you are going. The retracement drawings are saved as patterns and therefore they have some interactive properties. What you output from your drawing tools are saved as a graphics blob of points w/ no interactive properties.
 
Last edited:
@Stoynks Have you tried creating a simple study with adjustable inputs? Something similar to

Code:
input beginlevel = 5.00;

plot lowlevel = pricelevel - (.10 * beginlevel);
plot centerlevel = beginlevel;
plot highlevel = pricelevel + (1.3 * beginlevel);

You should be able to adjust the price level on that. Maybe try locking your toolbar onto each chart and adding this indicator as a selection to make accessing it easier.
 
@Stoynks Have you tried creating a simple study with adjustable inputs? Something similar to

Code:
input beginlevel = 5.00;

plot lowlevel = pricelevel - (.10 * beginlevel);
plot centerlevel = beginlevel;
plot highlevel = pricelevel + (1.3 * beginlevel);

You should be able to adjust the price level on that. Maybe try locking your toolbar onto each chart and adding this indicator as a selection to make accessing it easier.
Amazing work. Thank you for this. This makes it more convenient. Is it possible to make it more convenient to change the price rather than going to edit properties? Since the market is so volatile.
 
Amazing work. Thank you for this. This makes it more convenient. Is it possible to make it more convenient to change the price rather than going to edit properties? Since the market is so volatile.
@Stoynks The only way that I can think to make it more convenient would be to use a variable value rather than a defined input. What do you base your manually drawn price level off of?
 
@Stoynks The only way that I can think to make it more convenient would be to use a variable value rather than a defined input. What do you base your manually drawn price level off of?
I base my price level on condensation/support level so I'm not sure if TOS can accurately measure/or know when the price is condensing or at a support level. That's why It would be better if I manually handle the price level, and TOS just handles the 90% and 130% which I don't know if it's possible.

If TOS can implement the thinkscript you just created for me, the "beginlevel" as a drawing tool that way I can quickly create a price level using my cursor on the chart, that would be a godsend.
 
@Stoynks You can submit that as a request to TOS, but I'm afraid that it might not get much attention. If you do, market it to the TOS support team as "a risk-reward drawing tool that bases off of a price level", or something like that.

They have an empty spot anyway in their drawing tool collection, it needs filling in. 😉
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
338 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

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.

How do I get started?

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.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top