Custom Indicator Downloads

Completed

Comments

3 comments

  • jeshayle singh

    Hi Blake some of the indicators look familiar. Did you get the ideas from the Ray Freeman course?

    Also I have a code for Linear Regression Forecast but its written in c#. I was wondering if you are able to code it into .js?

    I also have the mlq4 code for mt4 if that helps. Its a great indicator and I am willing to pay if the price is right.

    c# is below.

    Regards Jeshayle

    using cAlgo.API;

    namespace cAlgo
    {
        /// <summary>
        /// Linear Regression
        /// </summary>
        [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
        public class LinearRegression : Indicator
        {
            [Parameter()]
            public DataSeries Source { get; set; }

            [Parameter(DefaultValue = 14)]
            public int Period { get; set; }

            [Output("Main")]
            public IndicatorDataSeries Result { get; set; }

            public override void Calculate(int index)
            {
                double sumX = 0, sumY = 0, sumXY = 0, sumXPower = 0;

                for (int i = 0; i < Period; i++)
                {
                    sumXPower += i * i;
                    sumX += i;
                    sumY += Source[index - i];
                    sumXY += i * Source[index - i];
                }

                Result[index] = (sumXPower * sumY - sumX * sumXY) / (sumXPower * Period - sumX * sumX);
            }
        }
    }

    0
    Comment actions Permalink
  • Tiki Dave

    Aloha!  Can you point to any articles describing what the indicator should look like?  I found this, is this what you're after?

    https://www.linnsoft.com/techind/linear-regression-forecast

    0
    Comment actions Permalink
  • Tiki Dave

    Just to close out your thread Jeshayle, I coded up the Linear Regression study, see here for details:

    https://tradovate.zendesk.com/hc/en-us/community/posts/115009396428-Linear-Regression-Forecast-Indicator

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk