Mov Avg crosses for a period of time

Handsome_Rob

New member
I have an indicator that uses two moving averages that cross, the problem im having is that sometimes i get false triggering when they cross briefly and then repaint. So my question is, Is there a way to specify a time in minutes that they must remain crossed to have a direction change plotted? I am trying to trade on hourly bars, so I do not want to use bars as a measure of time.

plot buy = (AvgExp crosses above AvgExp1);

Thank you!
 
Solution
I want to use it for conditional trading... the false triggers ive seen tend to be brief, so a time period that must elapse after the cross over before the buy signal is plotted would help to error correct the indicator. Waiting till the end of the bar would be much too slow.

you didn't mention any specifics, so you will only get general advice.

if you have a chart set to hour, that is the shortest time increment in which data can be evaluated.
you would have to set the chart to the desired time in minutes. then use a longer time of hour, as a second aggregation time, to generate the averages.
instead of trying to interpret the averages, look at the candles. if averages are crossing more than once, then the candles are...

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

I want to use it for conditional trading... the false triggers ive seen tend to be brief, so a time period that must elapse after the cross over before the buy signal is plotted would help to error correct the indicator. Waiting till the end of the bar would be much too slow.
 
I want to use it for conditional trading... the false triggers ive seen tend to be brief, so a time period that must elapse after the cross over before the buy signal is plotted would help to error correct the indicator. Waiting till the end of the bar would be much too slow.

you didn't mention any specifics, so you will only get general advice.

if you have a chart set to hour, that is the shortest time increment in which data can be evaluated.
you would have to set the chart to the desired time in minutes. then use a longer time of hour, as a second aggregation time, to generate the averages.
instead of trying to interpret the averages, look at the candles. if averages are crossing more than once, then the candles are consolidating. look up consolidating on the site, to find some studies and add some code, to give a warning that a crossing may not indicate a move.

i don't know what conditional trading is supposed to imply. the term has no meaning. every indicator ever made, displays things based on conditions.

posts related to consolidation
https://usethinkscript.com/threads/trendbox-for-tos.13956/#post-117639
 
Solution
Thank you for the responses @BenTen and @halcyonguy, I apologize for my ignorance here, I am new to thinkscript. What I meant by conditional trading is to excecute a buy or sell order for me when the condition is met... automatically.

@halcyonguy I will explore using a short chart with a longer aggregation time, and thanks for the link on consolidation.

I am still learning what TOS will or wont do, I appreciate the help.
 
Thnks @BenTen, I do realize that TOS will not do fully automated trading....

I was able to use 1 min charts with a 60 min aggregation and, with some fiddling, get what appears to be very good behavior for my indicator.

thank you both for the responses!
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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