bag...
bag...
28 Jul 2019, 07:52
namespace cAlgo.Robots
{
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class NewcBot : Robot
{
[Parameter(DefaultValue = 0.0)]
public double Parameter { get; set; }
private StochasticOscillator _stochastic;
private AverageTrueRange _atr;
protected override void OnStart()
{
_stochastic = Indicators.StochasticOscillator(9, 3, 3, MovingAverageType.Triangular);
_atr = Indicators.AverageTrueRange(180, MovingAverageType.Triangular);
Print("_atr start: " + _atr.Result.LastValue + " _stochastic start: " + _stochastic.PercentD.LastValue);
}
protected override void OnTick()
{
Print("_atr: " + _atr.Result.LastValue + " _stochastic: " + _stochastic.PercentD.LastValue);
}
protected override void OnStop()
{
}
}
}
Replies
PanagiotisCharalampous
29 Jul 2019, 10:34
Hi Vitaly,
This is caused because you use a number of periods for which backtesting doesn't have data loaded at the moment.
Best Regards,
Panagiotis
@PanagiotisCharalampous
Vitali Gajdabrus
29 Jul 2019, 09:35 ( Updated at: 21 Dec 2023, 09:21 )
RE:
Vitali Gajdabrus said:
the problem is solved by reducing the period from 180 to 21 ...
_atr = Indicators.AverageTrueRange(21, MovingAverageType.Triangular);
@Vitali Gajdabrus