Trying to understand why I cant get the buy and sell conditions to fire on a "upNow" and "downNow" condition. Can anyone help me out or point me in the direction of some learning material that would help my situation?
Don't have an account? Join QuantConnect Today
QuantConnect Community Discussions
QUANTCONNECT COMMUNITY
LEAN 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 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.
The Open-Quant League is a quarterly competition between universities and investment clubs for the best-performing strategy. The previous quarter's code is open-sourced, and competitors must adapt to survive.
User seeks help troubleshooting buy/sell signals on SuperTrend with "upNow" and "downNow" conditions.
Continue ReadingRefer to our Research Guidelines for high quality research posts.
Create an account on QuantConnect for the latest community delivered to your inbox.
Sign Up Today
|
|
|||||||
|
|
||||||||
|
SuperTrend buy/sell signal troubleshooting
Axist | Axist Capital | March 2021
Trying to understand why I cant get the buy and sell conditions to fire on a "upNow" and "downNow" condition. Can anyone help me out or point me in the direction of some learning material that would help my situation?
QuantConnectâ„¢ 2025. All Rights Reserved
Derek Melchin
Hi Axist,
To check if the SuperTrend indicator value is "upNow" or "downNow", we need to call the `buySignals` and `sellSignals` methods. We recommend reviewing our Introduction to Financial Python tutorial and completing the Bootcamp lessons to get more familiar with our API.
In addtion, there is an error with the registerATR method. Refer to this related thread to resolve it.
Best,
Derek Melchin
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.
Axist
Thanks Derek. I'll go through those again, but I was calling the two Signals you mentioned I thought in the code. Regarding the registerATR error, that link you provided me 404s.
I appreciate the response!
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.
Axist
Realized my mistake with not calling the buy/sell signals with something like:
self.Schedule.On(self.DateRules.EveryDay("SPY"),
self.TimeRules.Every(timedelta(hours=1)),
self.buySignals)
self.Schedule.On(self.DateRules.EveryDay("SPY"),
self.TimeRules.Every(timedelta(hours=1)),
self.sellSignals)
Now just the registerATR error...
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.
Derek Melchin
Hi Axist,
The link above should now be working.
Best,
Derek Melchin
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.
Axist
I've read through that post several times and am bit confused how its applicable to my ATR error? Additionally I dont seem to be seeing this ATR error, infact my issue seems to be I dont know what the proper "SuperTrend.Value.Up" and "SuperTrend.Value.Down" are supposed to be, when I am trying to set a Buy and Sell Signal definition. I've tried throwing debugs around to see what this should be, but this is the error it keeps giving me during the runtime error:
Runtime Error: In Scheduled Event 'SPY: EveryDay: Every 60 min', AttributeError : 'SuperTrendTester' object has no attribute 'atrUp' at buySignals if self.superTrend.Value is self.atrUp: return === at Python.Runtime.PyObject.Invoke (Python.Runtime.PyObject[] args) [0x00061] at <64cb66ee133d4796a89bc88ae6b16a1f>:0 at QuantConnect.Scheduling.ScheduleManager+<>c__DisplayClass15_0.<On>b__0 (System.String name in main.py:line 98 AttributeError : 'SuperTrendTester' object has no attribute 'atrUp'
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.
Axist
Thank you very much for this! I did some back tracing and I get now the atrDown[0] is the result of the CalculateSuperTrend function defined in the SuperTrend class. That makes sense now.
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.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!