Posted 2/21/2010 20:29:05
|
|
|
|
RSI.LookBack(1) throws the following error
An exception of type System.ArgumentOutOfRangeException was thrown.
Value must be between 0 and 0, value was 1
Parameter name: nBars
at RightEdge.Common.RList`1.LookBack(Int32 nBars)
at MySymbolScript.NewBar() in y:\0-TradingSystem\TradingSystems\ETFTrader\ETFTrader\ETFTrader.cs:line 55
at RightEdge.Common.SymbolScriptCollection`1.NewBar()
at MySystemBase.NewBar() in y:\0-TradingSystem\TradingSystems\ETFTrader\ETFTrader\BaseClasses.cs:line 31
at RightEdge.Common.Internal.SystemRunner.CallSystemNewBar(FrequencyNewBarEventArgs args)
at RightEdge.Common.Internal.SystemRunner.ProcessBarEvents(IEnumerable`1 eventList)
at RightEdge.Common.FrequencyManager.x189467b274f1add6(NewBarEventArgs xce8d8c7e3c2c2426)
at RightEdge.Shared.SystemWrapper.RunSystem(SystemData systemData, SharedSystemRunData runData, ServiceFactory brokerFactory)
at RightEdge.Shared.SystemWrapper.RunSystem(String filename, ServiceFactory brokerFactory, PluginReference dataStore, SystemParameters systemParameterOverrides)
at RightEdge.Shared.SystemWrapper.RunSystem(String filename, ServiceFactory brokerFactory, PluginReference dataStore, SystemParameters systemParameterOverrides)
at RightEdge.Shared.TradingModuleWrapper.Run(String filename, ServiceAppDomainFactory brokerFactoryFactory, PluginReference dataStore, SystemParameters systemParameterOverrides)
at RightEdge.Shared.TradingModuleWrapper.RunSystem(SharedSystemRunData systemRunData, ServiceAppDomainFactory brokerFactoryFactory, Func`2 dataStoreFactory)
at RightEdge.SystemProgress.InitAndRunSystem()
|
|
Posted 2/22/2010 02:46:50
|
|
|
|
make sure you have enough bars to use lookback 1.
RSI.Count > 1 or Bars.Count > 1
|
|
Posted 2/22/2010 07:02:20
|
|
|
|
| Ok, that gets me around the error, but it seems RSI lookback is never > 1, is there anyway to do an RSI lookback?
|
|
Posted 2/22/2010 08:46:58
|
|
|
|
It should be Count > 1. The situation is arising because you're telling RSI to lookback 1 bar on bar 0. Obviously, this is not possible, hence the exception.
So if you put a check RSI.Count > 1, you'll know there is at least one value you can lookback to.
|
|
Posted 2/22/2010 15:39:38
|
|
|
|
| Thanks Bill, that makes sense
|
|
|
|