Buy if price is above price for 30-seconds

we2323

New member
Hello, hope everyone is well. I don't have much in the way of coding, especially think script so I could use your guy's help on this. I have had some times where I'll place a buy-stop and the price will barely kiss that price, my order will execute, then the price will drop down and it'll punch my stop:(
Seems to happen alot.
An idea would be to have this buy not execute unless the price has been at or above said price for x amount of time.
Example: The price of XYS is 2.30, I want to buy at 2.50 so the code would be something like "buy at market price if XYS is at 2.50 or above 2.50 for 30 seconds, if price falls below 2.50 reset 30 second timer."
If there is a better way to work this I'm open ears but I think there is some form of a working strategy behind this idea.
Hope this all makes sense and thanks!
 
Solution
ToS does not work on time aggregations lower (shorter) than 1 minute.

That said, you can experiment with tick charts which will allow aggregations of much shorter than 1 minute, but are aggregated on the number of trades rather than the time elapsed. It changes... lots of things. :)

But mostly, it seems like you need to look at things like trade size, average true range, and risk:reward ratios in you trading strategy. That is, if a stock is moving an average of $0.12 per bar and you set your stop at $0.04 it will likely be triggered almost instantly. If you set it at $0.36, you will have some wiggle room for the stock to move (hopefully in your direction eventually). You will need to adjust your position size to limit your overall...
ToS does not work on time aggregations lower (shorter) than 1 minute.

That said, you can experiment with tick charts which will allow aggregations of much shorter than 1 minute, but are aggregated on the number of trades rather than the time elapsed. It changes... lots of things. :)

But mostly, it seems like you need to look at things like trade size, average true range, and risk:reward ratios in you trading strategy. That is, if a stock is moving an average of $0.12 per bar and you set your stop at $0.04 it will likely be triggered almost instantly. If you set it at $0.36, you will have some wiggle room for the stock to move (hopefully in your direction eventually). You will need to adjust your position size to limit your overall risk exposure so that a 36-cent stop does not expose you to a total risk of 9 times the 4-cent stop (your position will need to be 9 times smaller for the same risk).

There is a lot of information around on position sizing and risk. This is not meant to be a complete analysis of how to examine and adjust your risk.

-mashume
 
Solution

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

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
488 Online
Create Post

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