Description
The Leavitt Projection indicator was created by Jay Leavitt (Stocks and Commodities Oct 2019, page11), who is most well known for creating the Volume Weighted Average Price indicator.
Respecting the slope of indicator and position of crossing zero level is giving the satisfied signals.
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
namespace cAlgo
{
[Levels(0)]
[Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class mLeavittProjection : Indicator
{
[Parameter("Period Fast (14)", DefaultValue = 14)]
public int inpPeriodFast { get; set; }
[Parameter("Period Slow (14)", DefaultValue = 30)]
public int inpPeriodSlow { get; set; }
[Output("Main")]
public IndicatorDataSeries outLeavittProjection { get; set; }
private IndicatorDataSeries _price, _delta;
private LinearRegressionForecast _lrffast, _lrfslow;
protected override void Initialize()
{
_price = CreateDataSeries();
_delta = CreateDataSeries();
_lrffast = Indicators.LinearRegressionForecast(_price, inpPeriodFast);
_lrfslow = Indicators.LinearRegressionForecast(_price, inpPeriodSlow);
}
public override void Calculate(int i)
{
_price[i] = (Bars.HighPrices[i] + Bars.LowPrices[i] + Bars.ClosePrices[i] + Bars.ClosePrices[i]) / 4;
_delta[i] = _lrffast.Result[i - 1] - _lrfslow.Result[i - 1];
outLeavittProjection[i] = _delta[i];
}
}
}
mfejza
Joined on 25.01.2022
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: mLeavittProjection.algo
- Rating: 5
- Installs: 646
- Modified: 13/09/2022 19:39
Note that publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section, please use the Copyright Infringement Notification form to submit a claim.
Comments
Log in to add a comment.
No comments found.