Information
Username: | lec0456 |
Member since: | 14 Nov 2012 |
Last login: | 09 Nov 2023 |
Status: | Active |
Activity
Where | Created | Comments |
---|---|---|
Algorithms | 7 | 11 |
Forum Topics | 191 | 324 |
Jobs | 0 | 1 |
Last Algorithm Comments
Recently udated to indicate when the trading day and week begins according to how cTrader agregates daily and weekly data. Finally got it right.
Recently updated to include the Time zone offset which changes depending on the part of the year you are trading in.
Sure, its just a sma wit an sma applied to it. It removes some of the choppyness between close periods.
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
namespace cAlgo
{
[Indicator(IsOverlay = true, ScalePrecision = 7,TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class mySmoothSMA : Indicator
{
[Parameter()]
public DataSeries Source { get; set; }
[Parameter(DefaultValue = 24)]
public int paramPeriods { get; set; }
[Parameter(DefaultValue = 3)]
public int paramSmoothing { get; set; }
[Output("SMA", Color = Colors.Red)]
public IndicatorDataSeries Result { get; set; }
private SimpleMovingAverage sma;
private SimpleMovingAverage smoothsma;
protected override void Initialize()
{sma = Indicators.SimpleMovingAverage(Source, paramPeriods);
smoothsma = Indicators.SimpleMovingAverage(sma.Result, paramSmoothing);}
public override void Calculate(int index){ Result[index] = smoothsma.Result[index];}
}
}
if you are live it will give you a different value depending on when you run it. but it works for me.just the way you mention. As far as daylight saving, the system time functions take care of that when you convert. so, all is good.
if you are live it will give you a different value depending on when you run it. but it works for me.just the way you mention. As far as daylight saving, the system time functions take care of that when you convert. so, all is good.
So, just uploaded a big update to this indicator related to all the recent platform changes in handling the Time. So now the robot uses the timezone set by the new timezone attribute of the indicator. Before, there would have been issues if you set the indicator timezone to something different from the broker timezone, but now they are one and the same. Good Luck!
Last Jobs Comments
What if mine provides 2000%+ ?
I got the cBot to build with the source code. It seems like that function will not work if you have other visual studio objects in separate files. So, i put them all into one file and it worked.