multiple time frame indicators
13 Jan 2016, 17:38
Hello,
I wondered if one could access an indicator on a multiple time frame basis, which doesn't take "DataSeries source" as a variable as seen here /api/guides/indicators#el12 ? I was hoping to use a number of stochastic indicators, each with a different time frame but it takes integer and MovingAverageType inputs. Is there a workaround for this?
Best regards.
Replies
j.kozlowski.net
14 Jan 2016, 11:02
Oh wow, I can't believe it's that basic. Huge thanks for your reply!
@j.kozlowski.net
huhax
14 Feb 2016, 15:51
RE: RE: RE:
Ok, I got rid of the above error by using your header, but there is still an issue.
stoc2 = Indicators.StochasticOscillator(anothertimeframe, 9, 3, 9, MovingAverageType.Exponential);
"anothertimeframe" here doesn't work alone. It works only, if I use "anothertimeframe.close", etc., but this gives results different from expected.
What can be wrong about this?
@huhax

DeletedUser2
14 Jan 2016, 02:33 ( Updated at: 16 Aug 2022, 15:13 )
RE:
using System; using System.Linq; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.Indicators; namespace cAlgo { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class NewcBot : Robot { [Parameter(DefaultValue = 0.0)] public double Parameter { get; set; } private MarketSeries anothertimeframe; private StochasticOscillator stoc1; private StochasticOscillator stoc2; protected override void OnStart() { // Put your initialization logic here anothertimeframe = MarketData.GetSeries(Symbol, TimeFrame.Minute5); stoc1 = Indicators.StochasticOscillator(MarketSeries, 9, 3, 9, MovingAverageType.Exponential); stoc2 = Indicators.StochasticOscillator(anothertimeframe, 9, 3, 9, MovingAverageType.Exponential); } protected override void OnTick() { // Put your core logic here } protected override void OnStop() { // Put your deinitialization logic here } } }@DeletedUser2