mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-16 01:28:05 +00:00
tests and cleanup
This commit is contained in:
@@ -9,8 +9,6 @@ public class AfirmaIndicator : IndicatorBase
|
||||
[InputParameter("Periods for lowpass cutoff", sortIndex: 2, 1, 2000, 1, 0)]
|
||||
public int Periods { get; set; } = 6;
|
||||
|
||||
|
||||
|
||||
[InputParameter("Window Type", sortIndex: 3, variants: [
|
||||
"Rectangular", Afirma.WindowType.Rectangular,
|
||||
"Hanning", Afirma.WindowType.Hanning1,
|
||||
@@ -32,6 +30,8 @@ public class AfirmaIndicator : IndicatorBase
|
||||
|
||||
protected override void InitIndicator()
|
||||
{
|
||||
base.InitIndicator();
|
||||
ma = new Afirma(periods: Periods, taps: Taps, window: Window);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ public class AlmaIndicator : IndicatorBase
|
||||
public AlmaIndicator() : base()
|
||||
{
|
||||
Name = "ALMA - Arnaud Legoux Moving Average";
|
||||
Description = "Arnaud Legoux Moving Average";
|
||||
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -5,28 +5,26 @@
|
||||
<IsLocalBuild Condition="'$(GITHUB_ACTIONS)' == ''">true</IsLocalBuild>
|
||||
<UpdateAssemblyInfo>true</UpdateAssemblyInfo>
|
||||
<GenerateGitVersionInformation>true</GenerateGitVersionInformation>
|
||||
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Drawing.Common" Version="8.0.0" />
|
||||
<Compile Include="..\..\lib\**\*.cs" Exclude="..\..\lib\obj\**">
|
||||
<Link>lib\%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="CopyCustomContent" AfterTargets="AfterBuild" Condition="'$(IsLocalBuild)' == 'true'">
|
||||
<Copy SourceFiles="$(OutputPath)\Averages.dll" DestinationFolder="$(QuantowerRoot)\Settings\Scripts\Indicators\QuanTAlib\Averages" />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\*.cs">
|
||||
<Link>%(Filename)%(Extension)</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\*.cs" />
|
||||
<Compile Include="*.cs" />
|
||||
<ProjectReference Include="..\..\lib\quantalib.csproj" Private="true" IncludeAssets="all" />
|
||||
<Reference Include="TradingPlatform.BusinessLayer">
|
||||
<HintPath>..\..\.github\TradingPlatform.BusinessLayer.dll</HintPath>
|
||||
<HintPath>..\..\.github\TradingPlatform.BusinessLayer.dll</HintPath>
|
||||
</Reference>
|
||||
<None Include="..\..\.github\TradingPlatform.BusinessLayer.xml">
|
||||
<Link>TradingPlatform.BusinessLayer.xml</Link>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
<Target Name="CopyCustomContent" AfterTargets="AfterBuild" Condition="'$(IsLocalBuild)' == 'true'">
|
||||
<Copy SourceFiles="$(OutputPath)\Averages.dll" DestinationFolder="$(QuantowerRoot)\Settings\Scripts\Indicators\QuanTAlib\Averages" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -12,6 +12,7 @@ public class DemaIndicator : IndicatorBase
|
||||
public DemaIndicator() : base()
|
||||
{
|
||||
Name = "DEMA - Double Exponential Moving Average";
|
||||
Description = "A faster-responding moving average that reduces lag by applying the EMA twice.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -15,6 +15,7 @@ public class DsmaIndicator : IndicatorBase
|
||||
public DsmaIndicator() : base()
|
||||
{
|
||||
Name = "DSMA - Deviation Scaled Moving Average";
|
||||
Description = "A moving average that adjusts its responsiveness based on price deviations from the mean.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -10,10 +10,10 @@ public class DwmaIndicator : IndicatorBase
|
||||
protected override AbstractBase QuanTAlib => ma!;
|
||||
public override string ShortName => $"DWMA {Period} : {SourceName}";
|
||||
|
||||
|
||||
public DwmaIndicator() : base()
|
||||
{
|
||||
Name = "DWMA - Double Weighted Moving Average";
|
||||
Description = "A moving average that applies double weighting to recent prices for increased responsiveness.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -16,7 +16,7 @@ public class EmaIndicator : IndicatorBase
|
||||
public EmaIndicator() : base()
|
||||
{
|
||||
Name = "EMA - Exponential Moving Average";
|
||||
Description = "Exponential Moving Average";
|
||||
Description = "Moving average that gives more weight to recent prices, reducing lag in trend following.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -13,6 +13,7 @@ public class EpmaIndicator : IndicatorBase
|
||||
public EpmaIndicator() : base()
|
||||
{
|
||||
Name = "EPMA - Endpoint Moving Average";
|
||||
Description = "Moving average that emphasizes the most recent data point, useful for identifying trend changes.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -10,10 +10,10 @@ public class FramaIndicator : IndicatorBase
|
||||
protected override AbstractBase QuanTAlib => ma!;
|
||||
public override string ShortName => $"FRAMA {Period} : {SourceName}";
|
||||
|
||||
|
||||
public FramaIndicator() : base()
|
||||
{
|
||||
Name = "FRAMA - Fractal Adaptive Moving Average";
|
||||
Description = "Adaptive moving average that adjusts its smoothing based on market fractal dimension.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -10,10 +10,10 @@ public class FwmaIndicator : IndicatorBase
|
||||
protected override AbstractBase QuanTAlib => ma!;
|
||||
public override string ShortName => $"FWMA {Period} : {SourceName}";
|
||||
|
||||
|
||||
public FwmaIndicator() : base()
|
||||
{
|
||||
Name = "FWMA - Fibonacci-Weighted Moving Average";
|
||||
Description = "Moving average that uses Fibonacci sequence for weighting, emphasizing recent and key historical prices.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -10,10 +10,10 @@ public class GmaIndicator : IndicatorBase
|
||||
protected override AbstractBase QuanTAlib => ma!;
|
||||
public override string ShortName => $"GMA {Period} : {SourceName}";
|
||||
|
||||
|
||||
public GmaIndicator() : base()
|
||||
{
|
||||
Name = "GMA - Gaussian-Weighted Moving Average";
|
||||
Description = "Moving average using Gaussian distribution for weighting, balancing recent and historical data.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -10,10 +10,10 @@ public class HmaIndicator : IndicatorBase
|
||||
protected override AbstractBase QuanTAlib => ma!;
|
||||
public override string ShortName => $"HMA {Period} : {SourceName}";
|
||||
|
||||
|
||||
public HmaIndicator() : base()
|
||||
{
|
||||
Name = "HMA - Hull Moving Average";
|
||||
Description = "Responsive moving average that reduces lag while maintaining smoothness in price action.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -10,6 +10,7 @@ public class HtitIndicator : IndicatorBase
|
||||
public HtitIndicator() : base()
|
||||
{
|
||||
Name = "HTIT - Hilbert Transform Instantaneous Trendline";
|
||||
Description = "Uses Hilbert Transform to identify the dominant cycle and generate a smooth, lag-free trendline.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -16,17 +16,14 @@ public class HwmaIndicator : IndicatorBase
|
||||
protected override AbstractBase QuanTAlib => ma!;
|
||||
public override string ShortName => $"HWMA {nA:F2} : {nB:F2} : {nC:F2} : {SourceName}";
|
||||
|
||||
|
||||
public HwmaIndicator() : base()
|
||||
{
|
||||
Name = "HWMA - Holt-Winter Moving Average";
|
||||
Description = "Triple exponential moving average that accounts for level, trend, and seasonal components.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
{
|
||||
//nA = 2 / (1 + (double)Period);
|
||||
//nB = 1 / (double)Period;
|
||||
//nC = 1 / (double)Period;
|
||||
ma = new Hwma(nA: nA, nB: nB, nC: nC);
|
||||
base.InitIndicator();
|
||||
}
|
||||
|
||||
@@ -12,10 +12,10 @@ public class JmaIndicator : IndicatorBase
|
||||
protected override AbstractBase QuanTAlib => ma!;
|
||||
public override string ShortName => $"JMA {Period} : {Phase} : {SourceName}";
|
||||
|
||||
|
||||
public JmaIndicator() : base()
|
||||
{
|
||||
Name = "JMA - Jurik Moving Average";
|
||||
Description = "Adaptive moving average with reduced lag and noise, adjustable smoothness and phase shift.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -14,10 +14,10 @@ public class KamaIndicator : IndicatorBase
|
||||
protected override AbstractBase QuanTAlib => ma!;
|
||||
public override string ShortName => $"KAMA {Period} : {Fast} : {Slow} : {SourceName}";
|
||||
|
||||
|
||||
public KamaIndicator() : base()
|
||||
{
|
||||
Name = "KAMA - Kaufman's Adaptive Moving Average";
|
||||
Description = "Adaptive moving average that adjusts to market volatility, reducing lag in trending markets.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -13,6 +13,7 @@ public class LtmaIndicator : IndicatorBase
|
||||
public LtmaIndicator() : base()
|
||||
{
|
||||
Name = "LTMA - Laguerre Transform Moving Average";
|
||||
Description = "Moving average using Laguerre polynomials, offering adjustable smoothing and lag reduction.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -7,7 +7,7 @@ public class MaafIndicator : IndicatorBase
|
||||
public int Period { get; set; } = 39;
|
||||
|
||||
[InputParameter("Threshold", sortIndex: 5, minimum: 0, maximum: 1, increment: 0.001, decimalPlaces: 3)]
|
||||
public double Threshold = 0.002;
|
||||
private double Threshold { get; set; } = 0.002;
|
||||
|
||||
private Maaf? ma;
|
||||
protected override AbstractBase QuanTAlib => ma!;
|
||||
@@ -16,11 +16,12 @@ public class MaafIndicator : IndicatorBase
|
||||
public MaafIndicator() : base()
|
||||
{
|
||||
Name = "MAAF - Median-Average Adaptive Filter";
|
||||
Description = "Adaptive filter combining median and average, reducing noise while preserving trend responsiveness.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
{
|
||||
base.InitIndicator();
|
||||
ma = new Maaf(Period: Period, Threshold: Threshold);
|
||||
ma = new Maaf(period: Period, threshold: Threshold);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,10 @@ public class MamaIndicator : IndicatorBase
|
||||
protected override AbstractBase QuanTAlib => ma!;
|
||||
public override string ShortName => $"MAMA : {Fast} : {Slow} : {SourceName}";
|
||||
|
||||
|
||||
public MamaIndicator() : base()
|
||||
{
|
||||
Name = "MAMA - MESA Adaptive Moving Average";
|
||||
Description = "Adaptive moving average using MESA algorithm to adjust to market cycles and reduce lag.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -9,15 +9,14 @@ public class MgdiIndicator : IndicatorBase
|
||||
[InputParameter("k Factor", sortIndex: 2, minimum: 0.0, maximum: 1.0, increment: 0.1, decimalPlaces: 2)]
|
||||
public double kfactor { get; set; } = 0.6;
|
||||
|
||||
|
||||
private Mgdi? ma;
|
||||
protected override AbstractBase QuanTAlib => ma!;
|
||||
public override string ShortName => $"MGDI {Period} : {kfactor:F2} : {SourceName}";
|
||||
|
||||
|
||||
public MgdiIndicator() : base()
|
||||
{
|
||||
Name = "MGDI - McGinley Dynamic Index";
|
||||
Description = "Adaptive moving average that adjusts to market speed, reducing whipsaws in trending markets.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -13,6 +13,7 @@ public class MmaIndicator : IndicatorBase
|
||||
public MmaIndicator() : base()
|
||||
{
|
||||
Name = "MMA - Modified Moving Average";
|
||||
Description = "Variation of EMA that reduces lag and smooths price action, balancing responsiveness and stability.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -13,6 +13,7 @@ public class PwmaIndicator : IndicatorBase
|
||||
public PwmaIndicator() : base()
|
||||
{
|
||||
Name = "PWMA - Pascal's Weighted Moving Average";
|
||||
Description = "Moving average using Pascal's triangle coefficients, emphasizing recent data with smooth transitions.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -19,7 +19,7 @@ public class QemaIndicator : IndicatorBase
|
||||
public QemaIndicator() : base()
|
||||
{
|
||||
Name = "QEMA - Quad Exponential Moving Average";
|
||||
Description = "Quad Exponential Moving Average";
|
||||
Description = "Combines four EMAs with different smoothing factors to reduce lag and improve trend following.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -16,6 +16,7 @@ public class RemaIndicator : IndicatorBase
|
||||
public RemaIndicator() : base()
|
||||
{
|
||||
Name = "REMA - Regularized Exponential Moving Average";
|
||||
Description = "EMA variant with regularization to reduce noise and improve stability in volatile markets.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -10,10 +10,10 @@ public class RmaIndicator : IndicatorBase
|
||||
protected override AbstractBase QuanTAlib => ma!;
|
||||
public override string ShortName => $"RMA {Period} : {SourceName}";
|
||||
|
||||
|
||||
public RmaIndicator() : base()
|
||||
{
|
||||
Name = "RMA - wildeR Moving Average";
|
||||
Name = "RMA - Wilder's Moving Average";
|
||||
Description = "Smoothed moving average that reduces whipsaws, commonly used in RSI calculations.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -13,6 +13,7 @@ public class SinemaIndicator : IndicatorBase
|
||||
public SinemaIndicator() : base()
|
||||
{
|
||||
Name = "SINEMA - Sine-Weighted Moving Average";
|
||||
Description = "Moving average using sine function for weighting, balancing recent and historical price data.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -10,10 +10,10 @@ public class SmaIndicator : IndicatorBase
|
||||
protected override AbstractBase QuanTAlib => ma!;
|
||||
public override string ShortName => $"SMA {Period} : {SourceName}";
|
||||
|
||||
|
||||
public SmaIndicator() : base()
|
||||
{
|
||||
Name = "SMA - Simple Moving Average";
|
||||
Description = "Basic moving average that calculates the arithmetic mean of prices over a specified period.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -10,10 +10,10 @@ public class SmmaIndicator : IndicatorBase
|
||||
protected override AbstractBase QuanTAlib => ma!;
|
||||
public override string ShortName => $"SMMA {Period} : {SourceName}";
|
||||
|
||||
|
||||
public SmmaIndicator() : base()
|
||||
{
|
||||
Name = "SMMA - Smoothed Moving Average";
|
||||
Description = "Moving average that gives more weight to recent data while retaining all historical data.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -19,6 +19,7 @@ public class T3Indicator : IndicatorBase
|
||||
public T3Indicator() : base()
|
||||
{
|
||||
Name = "T3 - Tillson T3 Moving Average";
|
||||
Description = "Triple exponential moving average with reduced lag and smoothing, adjustable via volume factor.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -13,6 +13,7 @@ public class TemaIndicator : IndicatorBase
|
||||
public TemaIndicator() : base()
|
||||
{
|
||||
Name = "TEMA - Triple Exponential Moving Average";
|
||||
Description = "Moving average that applies EMA three times to reduce lag and improve responsiveness to trends.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -10,10 +10,10 @@ public class TrimaIndicator : IndicatorBase
|
||||
protected override AbstractBase QuanTAlib => ma!;
|
||||
public override string ShortName => $"TRIMA {Period} : {SourceName}";
|
||||
|
||||
|
||||
public TrimaIndicator() : base()
|
||||
{
|
||||
Name = "TRIMA - Triangular Moving Average";
|
||||
Description = "Weighted moving average giving more importance to the middle of the period for smoother output.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -14,10 +14,10 @@ public class VidyaIndicator : IndicatorBase
|
||||
protected override AbstractBase QuanTAlib => ma!;
|
||||
public override string ShortName => $"VIDYA {Period} : {SourceName}";
|
||||
|
||||
|
||||
public VidyaIndicator() : base()
|
||||
{
|
||||
Name = "VIDYA - Variable Index Dynamic Average";
|
||||
Description = "Adaptive moving average that adjusts based on market volatility for improved trend following.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -10,10 +10,10 @@ public class WmaIndicator : IndicatorBase
|
||||
protected override AbstractBase QuanTAlib => ma!;
|
||||
public override string ShortName => $"WMA {Period} : {SourceName}";
|
||||
|
||||
|
||||
public WmaIndicator() : base()
|
||||
{
|
||||
Name = "WMA - Weighted Moving Average";
|
||||
Description = "Moving average that assigns higher weights to recent data points for improved responsiveness.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -10,10 +10,10 @@ public class ZlemaIndicator : IndicatorBase
|
||||
protected override AbstractBase QuanTAlib => ma!;
|
||||
public override string ShortName => $"ZLEMA {Period} : {SourceName}";
|
||||
|
||||
|
||||
public ZlemaIndicator() : base()
|
||||
{
|
||||
Name = "ZLEMA - Weighted Moving Average";
|
||||
Name = "ZLEMA - Zero-Lag Exponential Moving Average";
|
||||
Description = "EMA variant that reduces lag by using linear extrapolation, providing faster response to price changes.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -13,6 +13,7 @@ public class CurvatureIndicator : IndicatorBase
|
||||
public CurvatureIndicator()
|
||||
{
|
||||
Name = "CURVATURE - Rate of Change of Slope";
|
||||
Description = "Measures the rate of change of the slope, indicating acceleration or deceleration in price movement.";
|
||||
SeparateWindow = true;
|
||||
}
|
||||
|
||||
@@ -21,4 +22,4 @@ public class CurvatureIndicator : IndicatorBase
|
||||
curvature = new(Period);
|
||||
MinHistoryDepths = curvature.WarmupPeriod;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ public class EntropyIndicator : IndicatorBase
|
||||
public EntropyIndicator() : base()
|
||||
{
|
||||
Name = "ENTROPY - Entropy";
|
||||
Description = "Measures the randomness or uncertainty in price movements, useful for identifying market phases.";
|
||||
SeparateWindow = true;
|
||||
}
|
||||
|
||||
@@ -22,4 +23,4 @@ public class EntropyIndicator : IndicatorBase
|
||||
MinHistoryDepths = entropy.WarmupPeriod;
|
||||
base.InitIndicator();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ public class KurtosisIndicator : IndicatorBase
|
||||
public KurtosisIndicator() : base()
|
||||
{
|
||||
Name = "KURTOSIS - Relative Flatness";
|
||||
Description = "Measures the 'tailedness' of price distribution, indicating potential for extreme market movements.";
|
||||
SeparateWindow = true;
|
||||
}
|
||||
|
||||
@@ -22,4 +23,4 @@ public class KurtosisIndicator : IndicatorBase
|
||||
MinHistoryDepths = kurtosis.WarmupPeriod;
|
||||
base.InitIndicator();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,8 @@ public class MaxIndicator : IndicatorBase
|
||||
|
||||
public MaxIndicator() : base()
|
||||
{
|
||||
Name = "MAX - Maximum value (with decay) ";
|
||||
Name = "MAX - Maximum value (with decay)";
|
||||
Description = "Tracks the maximum value over a period, with a decay factor to gradually adjust to new highs.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
|
||||
@@ -12,6 +12,7 @@ public class MedianIndicator : IndicatorBase
|
||||
public MedianIndicator() : base()
|
||||
{
|
||||
Name = "MEDIAN - Median historical value";
|
||||
Description = "Calculates the middle value of price data over a specified period, less affected by outliers than mean.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
@@ -20,4 +21,4 @@ public class MedianIndicator : IndicatorBase
|
||||
MinHistoryDepths = med.WarmupPeriod;
|
||||
base.InitIndicator();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ public class MinIndicator : IndicatorBase
|
||||
public MinIndicator() : base()
|
||||
{
|
||||
Name = "MIN - Minimum value (with decay)";
|
||||
Description = "Tracks the minimum value over a period, with a decay factor to gradually adjust to new lows.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
@@ -24,4 +25,4 @@ public class MinIndicator : IndicatorBase
|
||||
Source = 3;
|
||||
base.InitIndicator();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ public class ModeIndicator : IndicatorBase
|
||||
public ModeIndicator() : base()
|
||||
{
|
||||
Name = "MODE - Most frequent historical value";
|
||||
Description = "Identifies the most frequently occurring price value over a specified period, indicating price clusters.";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
@@ -20,4 +21,4 @@ public class ModeIndicator : IndicatorBase
|
||||
MinHistoryDepths = mode.WarmupPeriod;
|
||||
base.InitIndicator();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,8 @@ public class PercentileIndicator : IndicatorBase
|
||||
|
||||
public PercentileIndicator() : base()
|
||||
{
|
||||
Name = "PERCENTILE - n-th Percentile ";
|
||||
Name = "PERCENTILE - n-th Percentile";
|
||||
Description = "Calculates the value below which a given percentage of observations falls within a specified period.";
|
||||
SeparateWindow = false;
|
||||
}
|
||||
|
||||
@@ -24,5 +25,4 @@ public class PercentileIndicator : IndicatorBase
|
||||
MinHistoryDepths = percentile.WarmupPeriod;
|
||||
base.InitIndicator();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using TradingPlatform.BusinessLayer;
|
||||
namespace QuanTAlib;
|
||||
|
||||
@@ -14,6 +13,7 @@ public class SkewIndicator : IndicatorBase
|
||||
public SkewIndicator() : base()
|
||||
{
|
||||
Name = "SKEW - Skewness";
|
||||
Description = "Measures the asymmetry of price distribution, indicating potential trend direction or reversal.";
|
||||
SeparateWindow = true;
|
||||
}
|
||||
|
||||
@@ -23,4 +23,4 @@ public class SkewIndicator : IndicatorBase
|
||||
MinHistoryDepths = skew.WarmupPeriod;
|
||||
base.InitIndicator();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ public class SlopeIndicator : IndicatorBase
|
||||
public SlopeIndicator()
|
||||
{
|
||||
Name = "SLOPE - Trend Slope";
|
||||
Description = "Measures the rate of change in price over a specified period, indicating trend strength and direction.";
|
||||
SeparateWindow = true;
|
||||
}
|
||||
|
||||
@@ -21,4 +22,4 @@ public class SlopeIndicator : IndicatorBase
|
||||
slope = new(Period);
|
||||
MinHistoryDepths = slope.WarmupPeriod;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,28 +5,26 @@
|
||||
<IsLocalBuild Condition="'$(GITHUB_ACTIONS)' == ''">true</IsLocalBuild>
|
||||
<UpdateAssemblyInfo>true</UpdateAssemblyInfo>
|
||||
<GenerateGitVersionInformation>true</GenerateGitVersionInformation>
|
||||
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Drawing.Common" Version="8.0.0" />
|
||||
<Compile Include="..\..\lib\**\*.cs" Exclude="..\..\lib\obj\**">
|
||||
<Link>lib\%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="CopyCustomContent" AfterTargets="AfterBuild" Condition="'$(IsLocalBuild)' == 'true'">
|
||||
<Copy SourceFiles="$(OutputPath)\Statistics.dll" DestinationFolder="$(QuantowerRoot)\Settings\Scripts\Indicators\QuanTAlib\Statistics" />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\*.cs">
|
||||
<Link>%(Filename)%(Extension)</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\*.cs" />
|
||||
<Compile Include="*.cs" />
|
||||
<ProjectReference Include="..\..\lib\quantalib.csproj" Private="true" IncludeAssets="all" />
|
||||
<Reference Include="TradingPlatform.BusinessLayer">
|
||||
<HintPath>..\..\.github\TradingPlatform.BusinessLayer.dll</HintPath>
|
||||
<HintPath>..\..\.github\TradingPlatform.BusinessLayer.dll</HintPath>
|
||||
</Reference>
|
||||
<None Include="..\..\.github\TradingPlatform.BusinessLayer.xml">
|
||||
<Link>TradingPlatform.BusinessLayer.xml</Link>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
<Target Name="CopyCustomContent" AfterTargets="AfterBuild" Condition="'$(IsLocalBuild)' == 'true'">
|
||||
<Copy SourceFiles="$(OutputPath)\Statistics.dll" DestinationFolder="$(QuantowerRoot)\Settings\Scripts\Indicators\QuanTAlib\Statistics" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -15,6 +15,7 @@ public class StddevIndicator : IndicatorBase
|
||||
public StddevIndicator() : base()
|
||||
{
|
||||
Name = "STDDEV - Standard Deviation";
|
||||
Description = "Measures price volatility by calculating the dispersion of prices from their average over a period.";
|
||||
SeparateWindow = true;
|
||||
}
|
||||
|
||||
@@ -24,4 +25,4 @@ public class StddevIndicator : IndicatorBase
|
||||
MinHistoryDepths = stddev.WarmupPeriod;
|
||||
base.InitIndicator();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -15,6 +15,7 @@ public class VarianceIndicator : IndicatorBase
|
||||
public VarianceIndicator() : base()
|
||||
{
|
||||
Name = "VAR - Variance";
|
||||
Description = "Measures the spread of price data around its mean, indicating volatility and potential trend changes.";
|
||||
SeparateWindow = true;
|
||||
}
|
||||
|
||||
@@ -25,4 +26,4 @@ public class VarianceIndicator : IndicatorBase
|
||||
MinHistoryDepths = variance.WarmupPeriod;
|
||||
base.InitIndicator();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ public class ZScoreIndicator : IndicatorBase
|
||||
public ZScoreIndicator() : base()
|
||||
{
|
||||
Name = "ZSCORE - Standard Score";
|
||||
Description = "Measures how many standard deviations a price is from the mean, indicating overbought/oversold levels.";
|
||||
SeparateWindow = true;
|
||||
}
|
||||
|
||||
@@ -22,5 +23,4 @@ public class ZScoreIndicator : IndicatorBase
|
||||
MinHistoryDepths = zScore.WarmupPeriod;
|
||||
base.InitIndicator();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ public class AtrIndicator : IndicatorBarBase
|
||||
public AtrIndicator()
|
||||
{
|
||||
Name = "ATR - Average True Range";
|
||||
Description = "Measures market volatility by calculating the average range between high and low prices.";
|
||||
SeparateWindow = true;
|
||||
}
|
||||
|
||||
@@ -20,4 +21,4 @@ public class AtrIndicator : IndicatorBarBase
|
||||
atr = new(Period);
|
||||
MinHistoryDepths = atr!.WarmupPeriod;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ public class HistoricalIndicator : IndicatorBase
|
||||
public HistoricalIndicator() : base()
|
||||
{
|
||||
Name = "HV - Historical Volatility";
|
||||
Description = "Measures price fluctuations over time, indicating market volatility based on past price movements.";
|
||||
SeparateWindow = true;
|
||||
}
|
||||
|
||||
@@ -25,4 +26,4 @@ public class HistoricalIndicator : IndicatorBase
|
||||
MinHistoryDepths = historical.WarmupPeriod;
|
||||
base.InitIndicator();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ public class RealizedIndicator : IndicatorBase
|
||||
public RealizedIndicator() : base()
|
||||
{
|
||||
Name = "RV - Realized Volatility";
|
||||
Description = "Measures actual price volatility over a specific period, useful for risk assessment and forecasting.";
|
||||
SeparateWindow = true;
|
||||
}
|
||||
|
||||
@@ -25,4 +26,4 @@ public class RealizedIndicator : IndicatorBase
|
||||
MinHistoryDepths = realized.WarmupPeriod;
|
||||
base.InitIndicator();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,9 @@ public class RviIndicator : IndicatorBase
|
||||
public RviIndicator() : base()
|
||||
{
|
||||
Name = "RVI - Relative Volatility Index";
|
||||
Description = "Measures the direction of volatility, helping to identify overbought or oversold conditions in price.";
|
||||
SeparateWindow = true;
|
||||
|
||||
// Adding upper and lower reference lines
|
||||
//AddLineSeries("UpperLevel", 80, System.Drawing.Color.Gray, 1, LineStyle.Dot);
|
||||
//AddLineSeries("LowerLevel", 20, System.Drawing.Color.Gray, 1, LineStyle.Dot);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
{
|
||||
|
||||
@@ -5,28 +5,26 @@
|
||||
<IsLocalBuild Condition="'$(GITHUB_ACTIONS)' == ''">true</IsLocalBuild>
|
||||
<UpdateAssemblyInfo>true</UpdateAssemblyInfo>
|
||||
<GenerateGitVersionInformation>true</GenerateGitVersionInformation>
|
||||
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Drawing.Common" Version="8.0.0" />
|
||||
<Compile Include="..\..\lib\**\*.cs" Exclude="..\..\lib\obj\**">
|
||||
<Link>lib\%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="CopyCustomContent" AfterTargets="AfterBuild" Condition="'$(IsLocalBuild)' == 'true'">
|
||||
<Copy SourceFiles="$(OutputPath)\Volatility.dll" DestinationFolder="$(QuantowerRoot)\Settings\Scripts\Indicators\QuanTAlib\Volatility" />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\*.cs">
|
||||
<Link>%(Filename)%(Extension)</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\*.cs" />
|
||||
<Compile Include="*.cs" />
|
||||
<ProjectReference Include="..\..\lib\quantalib.csproj" Private="true" IncludeAssets="all" />
|
||||
<Reference Include="TradingPlatform.BusinessLayer">
|
||||
<HintPath>..\..\.github\TradingPlatform.BusinessLayer.dll</HintPath>
|
||||
<HintPath>..\..\.github\TradingPlatform.BusinessLayer.dll</HintPath>
|
||||
</Reference>
|
||||
<None Include="..\..\.github\TradingPlatform.BusinessLayer.xml">
|
||||
<Link>TradingPlatform.BusinessLayer.xml</Link>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
<Target Name="CopyCustomContent" AfterTargets="AfterBuild" Condition="'$(IsLocalBuild)' == 'true'">
|
||||
<Copy SourceFiles="$(OutputPath)\Volatility.dll" DestinationFolder="$(QuantowerRoot)\Settings\Scripts\Indicators\QuanTAlib\Volatility" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -3,10 +3,11 @@ using TradingPlatform.BusinessLayer;
|
||||
using TradingPlatform.BusinessLayer.Chart;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Drawing.Drawing2D;
|
||||
using QuanTAlib;
|
||||
using System.Collections;
|
||||
using TradingPlatform.BusinessLayer.TimeSync;
|
||||
|
||||
namespace QuanTAlib;
|
||||
|
||||
#pragma warning disable CA1416 // Validate platform compatibility
|
||||
public abstract class IndicatorBase : Indicator, IWatchlistIndicator
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user