Logging the Time of an Alert for Future Reference

TNTrader5159

Active member
To determine which end of an engulfing bar surpassed the minimum number of bars required first, is it possible to hold the time one end of the bar surpasses them in queue (as with the time of an alert upon that condition being met), and upon the other end of the bar surpassing the minimum number of bars in the other direction to compare the two times and determine which came first intra-bar?

For example, with a 3-bar minimum (reflecting an overall minimum ratio of 3:1 for bars vs prior bars engulfed), the high of a 5-minute bar surpasses the 3 previous bars' highs at 11:30:36 AM. Then at 11:32:03 the low of that same 5-minute bar surpasses the 3 previous bars' lows. Upon comparing the two times, you know which came first. Saying the open must be higher than the close works most of the time but not always.

A possible answer would be to use the two most recent bars and have the previous one surpass the highs of the minimum 6 previous bars (same minimum 3:1 ratio) and the current bar surpass the lows of the 7 bars before it that would include the previous bar.

That solves the problem and still allows the chart to "turn over" every 5 minutes for better accuracy than with using 10-minute bars. You effectively trade on a 10-minute time-frame using 5-minute bars here.

Also we must consider that if the previous bar engulfs said range on its own and the current bar is inside it, we have a better ratio that would loosely be double that of the 2 bars engulfing the previous 6 or more bars basis this indicator without provision for that possibility.

This seems the way to go for best accuracy, if the time-alert method outlined above is not feasible.

What say y'all?
 
Last edited:
Solution
To determine which end of an engulfing bar surpassed the minimum number of bars required first, is it possible to hold the time one end of the bar surpasses them in queue (as with the time of an alert upon that condition being met), and upon the other end of the bar surpassing the minimum number of bars in the other direction to compare the two times and determine which came first intra-bar?

For example, with a 3-bar minimum (reflecting an overall minimum ratio of 3:1 for bars vs prior bars engulfed), the high of a 5-minute bar surpasses the 3 previous bars' highs at 11:30:36 AM. Then at 11:32:03 the low of that same 5-minute bar surpasses the 3 previous bars' lows. Upon comparing the two times, you know which came first. Saying...
To determine which end of an engulfing bar surpassed the minimum number of bars required first, is it possible to hold the time one end of the bar surpasses them in queue (as with the time of an alert upon that condition being met), and upon the other end of the bar surpassing the minimum number of bars in the other direction to compare the two times and determine which came first intra-bar?

For example, with a 3-bar minimum (reflecting an overall minimum ratio of 3:1 for bars vs prior bars engulfed), the high of a 5-minute bar surpasses the 3 previous bars' highs at 11:30:36 AM. Then at 11:32:03 the low of that same 5-minute bar surpasses the 3 previous bars' lows. Upon comparing the two times, you know which came first. Saying the open must be higher than the close works most of the time but not always.

A possible answer would be to use the two most recent bars and have the previous one surpass the highs of the minimum 6 previous bars (same minimum 3:1 ratio) and the current bar surpass the lows of the 7 bars before it that would include the previous bar.

That solves the problem and still allows the chart to "turn over" every 5 minutes for better accuracy than with using 10-minute bars. You effectively trade on a 10-minute time-frame using 5-minute bars here.

Also we must consider that if the previous bar engulfs said range on its own and the current bar is inside it, we have a better ratio that would loosely be double that of the 2 bars engulfing the previous 6 or more bars basis this indicator without provision for that possibility.

This seems the way to go for best accuracy, if the time-alert method outlined above is not feasible.

What say y'all?

no, can not record any signals, during a bar, except low and high. all variable values will fluctuate during the current bar, but only the values that exist when the bar closes, will be able to be read, by future bars.
 
Solution
no, can not record any signals, during a bar, except low and high. all variable values will fluctuate during the current bar, but only the values that exist when the bar closes, will be able to be read, by future bars.
Thanks for the clarification, so I'll work around the inexactitude. I wonder if TD Ameritrade would consider developing a comparative time stamp indicator for the highs and lows or other facets of a live or mature bar. I guess I could ask huh.
 
To determine which end of an engulfing bar surpassed the minimum number of bars required first, is it possible to hold the time one end of the bar surpasses them in queue (as with the time of an alert upon that condition being met), and upon the other end of the bar surpassing the minimum number of bars in the other direction to compare the two times and determine which came first intra-bar?

if your desired timeframe is greater than 1 minute, like day or hour, then a smaller time (like 1 minute) could be used to gather data.

set chart at 5 minute.
in a study, use 2nd aggregation, set to the longer time, to gather your primary data.
then use chart data to 'evaluate' the bars that occur during the longer time.

example,
chart - 5 minute
2nd agg set to 60 minute , results in 60/5 = 12 chart bars per longer (agg) time. evaluate the highs and lows , (or some desired variable) during each group of bars.
 
if your desired timeframe is greater than 1 minute, like day or hour, then a smaller time (like 1 minute) could be used to gather data.

set chart at 5 minute.
in a study, use 2nd aggregation, set to the longer time, to gather your primary data.
then use chart data to 'evaluate' the bars that occur during the longer time.

example,
chart - 5 minute
2nd agg set to 60 minute , results in 60/5 = 12 chart bars per longer (agg) time. evaluate the highs and lows , (or some desired variable) during each group of bars.
Yes, I was planning to do just that for time-frames of 2 minutes or greater so it will be most accurate, eg 2 bars must engulf at least 6, 3 engulf 9, 4 engulf 12, etc. For a single bar, I can do as you have done just using close > open or vice versa that will make it right most of the time on historical charts and accurate for real-time alerts as long as close is used for the trigger point as the price crosses the engulfed range to complete the pattern. For say two bars and up, the last bar must be the trigger bar, so that will clearly identify which end came first high or low. If using say 10 bars engulfing 30, if the "engulfment" takes place in an earlier bar within those 10, it would show up on the 9/27 ratio or 8/24 etc. So examining all timeframes from 1-minute on up as high as you wanna go is the way to find the most and most accurate trade opportunities, as long as it doesn't consume too many computing resources.

So all that said, thanks a billion for your guidance! I have begun coding my system a segment at a time and get excited when no red enshrouds my code and it produces the results I want.
 
Last edited by a moderator:

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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