I try to run the sample code for kerasneuralnetwork on the "EURUSD" instead of the "SPY".
I got the Error:
During the algorithm initialization, the following exception has occurred: KeyNotFoundException : EURUSD not found in portfolio. Request this data when initializing the algorithm. at QuantConnect.Scheduling.TimeRules.GetSecurity (QuantConnect.Symbol symbol) [0x0001b] in :0 at QuantConnect.Scheduling.TimeRules.AfterMarketOpen (QuantConnect.Symbol symbol, System.Double minutesAfterOpen, System.Boolean extendedMarketOpen) [0x0000d] in :0 at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in :0 at Initialize in main.py:line 53 KeyNotFoundException : EURUSD not found in portfolio. Request this data when initializing the algorithm. at QuantConnect.Scheduling.TimeRules.GetSecurity (QuantConnect.Symbol symbol) [0x0001b] in :0 at QuantConnect.Scheduling.TimeRules.AfterMarketOpen (QuantConnect.Symbol symbol, System.Double minutesAfterOpen, System.Boolean extendedMarketOpen) [0x0000d] in :0 at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in :0
Shailesh Raval
How did you run sample code for "EURUSD" instead of SPY?
You need to change/replace SPY with EURUSD and use AddForex instead of AddEquity()
Thanks
Shailesh
Antimarket
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!