if close of previous candle > $10 and current price <= $10

califorlina

New member
Plus
Hi, I'm new and need your help! I'm trying to create a market conditions study that acts like a stop limit buy order but is only triggered when the actual close of a completed 1 hour candle is >= $10 and current price <= $10. Any thinkscript help on this is greatly appreciated!

This is what I have so far. I want to know if the second condition stays active for several candles once the first condition is triggered, or if there's a better way to do this. Thanks.
1743520391396.png
 
Last edited by a moderator:
Solution
@califorlina In a Conditional Order you can't have a criteria be met and still monitor it... This is a limitation of the TOS platform... I'm assuming you are working on Conditional Orders here... Once a criteria is met, that leg disappears... You would need another leg of your OCO in order to monitor for another criteria to be met... Your current logic appears to be correct for what you have described...

You might be able to add another criteria after your present one, but it's hard to say whether it would perform as expected... We'd need more details to help beyond what I have posted below...

Ruby:
(close[1] >= 10 and close <= 10 within <x> bars) and <your extra criteria here>
@califorlina In a Conditional Order you can't have a criteria be met and still monitor it... This is a limitation of the TOS platform... I'm assuming you are working on Conditional Orders here... Once a criteria is met, that leg disappears... You would need another leg of your OCO in order to monitor for another criteria to be met... Your current logic appears to be correct for what you have described...

You might be able to add another criteria after your present one, but it's hard to say whether it would perform as expected... We'd need more details to help beyond what I have posted below...

Ruby:
(close[1] >= 10 and close <= 10 within <x> bars) and <your extra criteria here>
 
Solution
@califorlina In a Conditional Order you can't have a criteria be met and still monitor it... This is a limitation of the TOS platform... I'm assuming you are working on Conditional Orders here... Once a criteria is met, that leg disappears... You would need another leg of your OCO in order to monitor for another criteria to be met... Your current logic appears to be correct for what you have described...

You might be able to add another criteria after your present one, but it's hard to say whether it would perform as expected... We'd need more details to help beyond what I have posted below...

Ruby:
(close[1] >= 10 and close <= 10 within <x> bars) and <your extra criteria here>
Thank you Ruby. I will test your recommendation and reply back with results. I appreciate you!
 
Hi, I'm new and need your help! I'm trying to create a market conditions study that acts like a stop limit buy order but is only triggered when the actual close of a completed 1 hour candle is >= $10 and current price <= $10. Any thinkscript help on this is greatly appreciated!

This is what I have so far. I want to know if the second condition stays active for several candles once the first condition is triggered, or if there's a better way to do this. Thanks.
a shorter formula would be,
close crosses below 10
 

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
445 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