Determining appropriate marker placement...

tocguy

New member
The site's search engine apparently only searches for words rather than phrases. A search for "number of bars" yields many results containing of. Useful, they is not. A post, we must create.
Ok, putting Yoda away now. =>:alien:

What seemed like what should be a trivial coding effort has run me headlong into a wall. One I suspect many here are all to familiar with. The goal, is to develop a means of determining placement above/below the candles for reversal markers. Sounds simple enuf and indeed they do display but the behavior varies a bit too much depending on the Price axis magnitude. For example, on $DJI the markers appear too far away from the price line whereas on a volatile <$10 stock the markers easily get lost in the noise.

From what I've been able to gather, ToS doesn't reveal the Price axis Min/Max values so developing a scale off those isn't do-able. Trying to determine the High/Low of a Zoomed/Scrolled Intraday tick chart is (impossible)? Yes, you can get some numbers but they don't correlate to what is actually displayed on the chart. Rather, they reflect the entire iData set.

Where I'm at:
For a universal placement method that takes Price axis scale magnitude into consideration the logical (IMHO) approach is to use Logarithms [Lg() in ThinkScript].

Code:
def markerOffset = .035 - Floor(Lg(price))/100; # percent above/below to show Up/Down arrow markers

The 0.035 was chosen experimentally and is added/subtracted to the unity multiplier to bump the vertical placement position of the marker.

Code:
plot CAHOLD = if ShowCAHOLD and _CAHOLD then Lows * (1 - markerOffset) else Double.NaN;
plot CBLOHD = if ShowCBLOHD and _CBLOHD then Highs * (1 + markerOffset) else Double.NaN;

While this works (sort of) it is in need of further refinement. What other methods are available to evaluate?
Markers.jpg
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
662 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