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

lec0456's avatar
lec0456 · 5 years ago

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.

lec0456's avatar
lec0456 · 5 years ago

Recently udated to indicate when the trading day and week begins according to how cTrader agregates daily and weekly data.  Finally got it right.

lec0456's avatar
lec0456 · 6 years ago

Recently updated to include the Time zone offset which changes depending on the part of the year you are trading in.

lec0456's avatar
lec0456 · 9 years ago

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];}
    }

lec0456's avatar
lec0456 · 9 years ago

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.

lec0456's avatar
lec0456 · 9 years ago

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.

lec0456's avatar
lec0456 · 10 years ago

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! 

lec0456's avatar
lec0456 · 11 years ago
This looks interesting. So, how do you trade with it?
lec0456's avatar
lec0456 · 11 years ago
Robo Forex and Fibo Group are also using Cyprus time. Actually, I think its best because it divides the day properly. Once New York closes on a particular day, the Australian Session begins on the following day. For example, if the NY session closes on the 15th at 4:59pm EST at 5pm EST the Australian Session begins and it is the 16th in Australia. Cyprus time is 12am. During the summer months when there is a gap between the NY and Australian Sessions, Cyprus time still falls in between, nicely dividing the trading day data. I guess that's why Cyprus is the center of the Forex Universe:)
lec0456's avatar
lec0456 · 11 years ago
I added the following lines: TimeZoneInfo LocalTimeZone = TimeZoneInfo.FindSystemTimeZoneById("UTC"); //GMT Time w/ no daylight savings For Divisa Capitol and IC Markets //Print("Local Time Zone Name:{0} Offset:{1} DST:{2} ",LocalTimeZone.DisplayName,LocalTimeZone.BaseUtcOffset,LocalTimeZone.SupportsDaylightSavingTime); [Levels(8,9,10,11,12,13,14,15,16)]
lec0456's avatar
lec0456 · 11 years ago
Ok, had to update the code. Sorry. It turns out that IC markets uses UTC Time not London time(GMT Standard Time) as originally coded. You might think they are the same but London used daylight savings and UTC does not, so you would be off by an hour during the summer. I couldn't really verify that until March 30th when it kicked in for London. Also, I verified that Divisa Capitol uses UTC as well, same as IC Markets and Lqd Markets uses Cyprus Time same as FX Pro and Trader's Way. So, now the indicator should be accurate for all platforms. I also added a levels statement to display the times consistently and a print statement to verify time zone info if necessary. Hope it helps!

Last Jobs Comments

lec0456's avatar
lec0456 · 10 years ago

What if mine provides 2000%+ ?