ℹ️ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0.1 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/ |
| Last Crawled | 2026-04-08 22:14:45 (3 days ago) |
| First Indexed | 2024-11-29 16:19:03 (1 year ago) |
| HTTP Status Code | 200 |
| Meta Title | Help with bollinger band strategy - QuantConnect.com |
| Meta Description | Help needed to fix Bollinger Band strategy; only 1 trade in a year despite multiple expected trades. |
| Meta Canonical | null |
| Boilerpipe Text | I am trying to create a strategy based on bollinger bands, but something must be wrong as only 1 trade is being made over a year which doesn't make sense as mutliple trades should be made each day...
The concept is:
The system should only trade between 10 pm and 8 am UTC, and a trade should only be made if there are no other open positions.
If the closing price of the EURUSD is above or equal to the Upper Bollinger band, then Sell. The trade should be closed when the price hits the lower bollinger band or it should be stopped out if the price hits the Stop (Which is set as the upper bollinger band at 6 std dev)
And if the closing price of the EURUSD is below or equal to the Lower Bollinger band, then Buy. The trade should be closed when the price hits the Upper bollinger band or it should be stopped out if the price hits the Stop (Which is set as the lower bollinger band at 6 std dev)
I can't figure out what is wrong in my code as only 1 trade is being made over a year period. Anyone can help? |
| Markdown | Toggle navigation
↑↓ to select, press **enter** to go, use **esc** to exit
- [Pricing](https://www.quantconnect.com/pricing/ "Pricing")
- [Research](https://www.quantconnect.com/research/ "Explore comprehensive financial research, providing insights, analysis, and trends for informed decision-making.")
- [Strategies](https://www.quantconnect.com/strategies/ "Jumpstart your algorithm development with a selection of top community strategies that update weekly.")
- [Data](https://www.quantconnect.com/datasets/ "Download free historical data from our Data Library")
- [Documentation Docs Docs](https://www.quantconnect.com/docs/ "Learn more about how to make the most of QuantConnect in the documentation")
- [Algorithm Lab Lab Lab](https://www.quantconnect.com/terminal/ "Backtest your algorithms on historical data.")
- [Sign In](https://www.quantconnect.com/login/ "Sign In to QuantConnect")
Toggle navigation
Forum

- [Pricing](https://www.quantconnect.com/pricing/ "Pricing")
- [Research](https://www.quantconnect.com/research/ "Explore comprehensive financial research, providing insights, analysis, and trends for informed decision-making.")
- [Strategies](https://www.quantconnect.com/strategies/ "Jumpstart your algorithm development with a selection of top community strategies that update weekly.")
- [Datasets](https://www.quantconnect.com/datasets/ "Download free historical data from our Data Library.")
- [Documentation](https://www.quantconnect.com/docs/ "Learn more about how to make the most of QuantConnect in the documentation")
- [Algorithm Lab](https://www.quantconnect.com/terminal/ "Backtest your algorithms on historical data.")
- [Sign in](https://www.quantconnect.com/login?target=Forum "Sign In with Email")
- Don't have an account? Join QuantConnect Today
- [Sign up for Free](https://www.quantconnect.com/signup "Sign up")

QUANTCONNECT COMMUNITY
[Research](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/#research) [Announcements](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/#announcements) [Lean](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/#lean)
[COMMUNITY COMMUNITY FEED](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/#newest) \|
[Announcements](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/#competition) [Lean](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/#lean) [Data Issues](https://www.quantconnect.com/datasets/issues)
***
### Quant League Is Moving Forward as Strategies
Quant League is evolving into Strategies, our new home for sharing, discovering, and exploring trading strategies, with improved organization and a better overall experience. Q4-2025 will be the final Quant League.
[Explore Strategies](https://www.quantconnect.com/strategies)
OPEN LEAGUE PRO LEAGUE
No Results
- [«](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/)
- [1](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/)
- [»](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/)

### Radically Open-Source Algorithmic Trading Engine
[LEAN](https://www.lean.io/) is the open-source algorithmic trading engine powering QuantConnect. Founded in 2012 LEAN has been built by a global community of 180+ engineers and powers more than 300+ hedge funds today.

### Join Our Discord Channel
Join QuantConnect's Discord server for real-time support, where a vibrant community of traders and developers awaits to help you with any of your QuantConnect needs.
pending review
This research is under review. To publish this research attract three community upvotes.
***
#### Draft Discussions
***
#### Bookmarked Discussions
***
Loading...
- [«](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/)
- [»](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/)
[ Share New Research](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/)
Refer to our [Research Guidelines](https://www.quantconnect.com/docs/v2/cloud-platform/community/research) for high quality research posts.
[ Start New Discussion](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/) [Sign up](https://www.quantconnect.com/terminal)
***
##### SEARCH DISCUSSIONS

***
***
##### TOP 5 Research Publications
\-
***
##### 484,400 Quants.
[Become a Quant](https://www.quantconnect.com/terminal)
Online Now
[Code of Conduct](https://www.quantconnect.com/codeofconduct)
***
##### VOTE FOR UPCOMING FEATURES
Share your input and vote on our future direction.
[LEAN Roadmap](https://www.quantconnect.com/roadmap)
***
#####
Create an account on QuantConnect for the latest delivered to your inbox.
[Sign Up Today](https://www.quantconnect.com/signup)
| | | | | | | |
|---|---|---|---|---|---|---|
|  | | | | | | |
| | | | | | | |
|  Answers | |  Backtests | |  Comments | |  Live Traded |
[Research](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/#research) [Announcements](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/#announcements) [Lean](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/#lean)
[COMMUNITY COMMUNITY FEED](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/#newest) \|
[Announcements](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/#competition) [Lean](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/#lean) [Data Issues](https://www.quantconnect.com/datasets/issues)
***
pending review
This research is under review. To publish this research attract three community upvotes.
draft post
This discussion is a draft. Click [here]() to publish this discusison.
# Help with bollinger band strategy
***
I am trying to create a strategy based on bollinger bands, but something must be wrong as only 1 trade is being made over a year which doesn't make sense as mutliple trades should be made each day...
**The concept is:**
The system should only trade between 10 pm and 8 am UTC, and a trade should only be made if there are no other open positions.
If the closing price of the EURUSD is above or equal to the Upper Bollinger band, then Sell. The trade should be closed when the price hits the lower bollinger band or it should be stopped out if the price hits the Stop (Which is set as the upper bollinger band at 6 std dev)
And if the closing price of the EURUSD is below or equal to the Lower Bollinger band, then Buy. The trade should be closed when the price hits the Upper bollinger band or it should be stopped out if the price hits the Stop (Which is set as the lower bollinger band at 6 std dev)
I can't figure out what is wrong in my code as only 1 trade is being made over a year period. Anyone can help?
[Update Backtest](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/)
***
***
Cancel

[![]()](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/) person upvoted this people upvoted this
***
[David Morris]()
\| \| Accepted Answer

[Permalink](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/ "Link")
[Update Backtest](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/)
***
***
Cancel
- [Notebook](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/)
Remove
Disclaimer
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.

[Twitter](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/) [Facebook](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/) [LinkedIn](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/) [Copy Link]()
Gurumeher Sawhney
16\.5k ,
The statements are correct we just needed to change the layout of the conditional statements. It checked if it was not invested, but if it was the rest of the logic was skipped. Also the long and short strategies were conflicting by having them right after each other so for the sake of simplicity I commented out the long strategy.
***
***
David Morris
209 ,
Excellent! Thank you for this\!
For the buy strategy would you suggest I create a separate algorithm? or is there a way to have them not conflicting?
***
Gurumeher Sawhney
16\.5k ,
Having a buy and sell strategy in the same algorithm depends on the portfolio structure. It is possible to have them in the same algorithm, but then holdings shouldn't be set to 1 or -1, since it affects the entire portfolio.
***
Apollos Hill
10k ,
Hi Gurumeher,
Should we set the holdings to a specific share quantity rather than allocating a percentage of portfolio using SetHoldings 1 or -1?
***
Gurumeher Sawhney
16\.5k ,
With respect to the example above, it would be hard to allocate a percentage of the portfolio using SetHoldings 1 or -1 because when a long or short signal is created, the allocation would then take over the entire portfolio, This overlapping would create a problem and the strategy would not work.
It would be easier to use a specific share quantity because then one could manage the short and long strategies separately, Code for risk management and portfolio construction would be recommended for this situation. When allocating the share quantity it would be useful to record the current positions for future trading signals.
https://www.quantconnect.com/docs/algorithm-reference/trading-and-orders
***
[David Morris]() INVESTOR
\|

[Permalink](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/ "Link")
[Update Backtest](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/)
***
***
Cancel
***
***
- [Notebook](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/)
Accept Answer
Disclaimer
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Reply

[![]()](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/) person upvoted this people upvoted this
\|

[![]()](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/) person upvoted this people upvoted this
![Profile Image]()
Reply
Loading...
- [1](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/p1)
[Load More ](javascripts:void\(0\))
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can [continue your Boot Camp training progress](https://www.quantconnect.com/learning) from the terminal. We hope to see you in the community soon\!
***
##### Allocate to this Strategy
Institutional clients can contact the author and allocate capital to this strategy.
[Learn More](https://www.quantconnect.com/appointments)
***
##### Organization

[Organization Website]()
***
##### Team
![]()
[Show More]()
***
##### Clone Strategy
Copy this strategy code to your QuantConnect account and deploy it live with your brokerage.
[Clone]()
***
##### Previous Ranking
Browse strategies and organization entries from previous quarter's competitions.
***
Author:
***
##### IN THIS RESEARCH
***
##### PARTICIPANTS
[![]()](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/)
***
##### Discussion Awards
***
##### SHARE RESEARCH
##### SHARE DISCUSSION
##### SHARE ARTICLE
##### SHARE
[]() []() []()
***
##### Actions
[ View in Strategy Explorer](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/) [ Award Discussion]()
[ ](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/)
[ Print Research](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/)
[ ]()
[Comments]()
![award-icon]()
[What is an Award?](https://www.quantconnect.com/blog/recognizing-community-excellence/)
[Research](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/#research) [Announcements](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/#announcements) [Lean](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/#lean)
[COMMUNITY COMMUNITY FEED](https://www.quantconnect.com/forum/discussion/4022/help-with-bollinger-band-strategy/#newest) \|
[Data Issues](https://www.quantconnect.com/datasets/issues)
***
## Join QuantConnect for Free
[Sign Up](https://www.quantconnect.com/login/?target=Forum)

QuantConnect™ 2026. All Rights Reserved
Technology
- [Algorithm Lab](https://www.quantconnect.com/terminal/)
- [Documentation](https://www.quantconnect.com/docs/)
- [Research](https://www.quantconnect.com/research/)
- [Build vs. Buy](https://www.quantconnect.com/buildvsbuy/)
- [Tutorials](https://www.quantconnect.com/tutorials/)
- [Data Library](https://www.quantconnect.com/datasets/)
- [Learning Articles](https://www.quantconnect.com/learning/articles/)
- [System Status](https://status.quantconnect.com/)
- [Settings](https://www.quantconnect.com/settings/)
- [Discussions List](https://www.quantconnect.com/forum/list/1/community/)
Company
- [About](https://www.quantconnect.com/about/)
- [Affiliates](https://www.quantconnect.com/affiliates/)
- [Our Blog](https://www.quantconnect.com/blog/)
- [Contact](https://www.quantconnect.com/contact/)
- [Pricing](https://www.quantconnect.com/pricing/)
- [Integration Partners](https://www.quantconnect.com/integration-partners/)
- [QuantConnect Swag](https://quantconnect.printify.me/)
- [Terms & Conditions](https://www.quantconnect.com/terms/)
- [Privacy Policy](https://www.quantconnect.com/privacy/)
[LEAN](https://www.quantconnect.com/lean)
- [Fork](https://github.com/QuantConnect/Lean/fork) [5,000](https://github.com/QuantConnect/Lean/network)
- [Star](https://github.com/QuantConnect/Lean) [18,000](https://github.com/QuantConnect/Lean/stargazers)

QuantConnect™ 2026. All Rights Reserved
Technology
- [Algorithm Lab](https://www.quantconnect.com/terminal/)
- [Documentation](https://www.quantconnect.com/docs/)
- [Research](https://www.quantconnect.com/research/)
- [Build vs. Buy](https://www.quantconnect.com/buildvsbuy/)
- [Tutorials](https://www.quantconnect.com/tutorials/)
- [Data Library](https://www.quantconnect.com/datasets/)
- [Learning Articles](https://www.quantconnect.com/learning/articles/)
- [System Status](https://status.quantconnect.com/)
- [Settings](https://www.quantconnect.com/settings/)
- [Discussions List](https://www.quantconnect.com/forum/list/1/community/)
Company
- [About](https://www.quantconnect.com/about/)
- [Affiliates](https://www.quantconnect.com/affiliates/)
- [Our Blog](https://www.quantconnect.com/blog/)
- [Contact](https://www.quantconnect.com/contact/)
- [Pricing](https://www.quantconnect.com/pricing/)
- [Integration Partners](https://www.quantconnect.com/integration-partners/)
- [QuantConnect Swag](https://quantconnect.printify.me/)
- [Terms & Conditions](https://www.quantconnect.com/terms/)
- [Privacy Policy](https://www.quantconnect.com/privacy/)
[LEAN](https://www.quantconnect.com/lean)
- [Fork](https://github.com/QuantConnect/Lean/fork) [5,000](https://github.com/QuantConnect/Lean/network)
- [Star](https://github.com/QuantConnect/Lean) [18,000](https://github.com/QuantConnect/Lean/stargazers) |
| Readable Markdown | I am trying to create a strategy based on bollinger bands, but something must be wrong as only 1 trade is being made over a year which doesn't make sense as mutliple trades should be made each day...
**The concept is:**
The system should only trade between 10 pm and 8 am UTC, and a trade should only be made if there are no other open positions.
If the closing price of the EURUSD is above or equal to the Upper Bollinger band, then Sell. The trade should be closed when the price hits the lower bollinger band or it should be stopped out if the price hits the Stop (Which is set as the upper bollinger band at 6 std dev)
And if the closing price of the EURUSD is below or equal to the Lower Bollinger band, then Buy. The trade should be closed when the price hits the Upper bollinger band or it should be stopped out if the price hits the Stop (Which is set as the lower bollinger band at 6 std dev)
I can't figure out what is wrong in my code as only 1 trade is being made over a year period. Anyone can help? |
| Shard | 112 (laksa) |
| Root Hash | 1078739049721434312 |
| Unparsed URL | com,quantconnect!www,/forum/discussion/4022/help-with-bollinger-band-strategy/ s443 |