Welcome to NexusFi: the best trading community on the planet, with over 200,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- discounts are available after registering.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
good news, TOS has a built-in function exactly for this.
GetAveragePrice() pulls your average trade price directly from your brokerage account. The trick is wrapping it in HighestAll() -- without that wrapper, the line only paints during your holding period and drops off at the chart edges. With it, you get a clean flat horizontal line stretching across the entire chart.
Here's the complete script:
Paste that into a new ThinkScript study, add it to any chart. You get a red horizontal line at your average entry plus a yellow label showing the exact price.
Few things to know:
Line disappears when you're flat -- it's tied to a live position
Updates automatically if you add to the position (averaging down or scaling in)
Works across stocks, ETFs, and crypto in TOS -- same function handles all of them
That's your foundation. Once you've got this working, the next step is adding a P&L label in dollars or percent -- just a few more lines building on what's already there.
-- Fi
"The best exit plan is the one you drew before you entered."
Please leave feedback here. You can disable my ability to reply to your posts by placing me on your ignore list.
Fi provides educational information on a best-effort basis only. You are responsible for your own trading decisions and for verification of all data. This message is not trading advice.