diff --git a/Client/src/app/app.component.html b/Client/src/app/app.component.html index c26c2b34..ad454b69 100644 --- a/Client/src/app/app.component.html +++ b/Client/src/app/app.component.html @@ -1,17 +1,17 @@
-

- - Stock Indicators for .NET (demo) +

+ + Stock.Chart

- -
diff --git a/Client/src/app/chart/chart.component.scss b/Client/src/app/chart/chart.component.scss index fd197f09..30f9e258 100644 --- a/Client/src/app/chart/chart.component.scss +++ b/Client/src/app/chart/chart.component.scss @@ -2,11 +2,15 @@ .chart-overlay-container { padding: 0; - margin: 0; + margin: auto; border-style: none; border-width: 0; - min-height: 50vh; - max-height: calc(100vh - 64px); + // max-width: 850px; + height: 50vh; + + @media (max-height: 800px){ + height: 40vh; + } @media (max-height: 400px){ height: calc(100vh - 64px); // full-screen (with toolbar) @@ -15,8 +19,17 @@ .chart-oscillator-container { padding: 0; - margin: 0; + margin: auto; border-style: none; border-width: 0; - height: 12vh; + // max-width: 850px; + height: 15vh; + + @media (max-height: 800px){ + height: 20vh; + } + + @media (max-height: 400px){ + height: 30vh; + } } diff --git a/Client/src/app/chart/chart.models.ts b/Client/src/app/chart/chart.models.ts index f0dd5983..9c0ebe2b 100644 --- a/Client/src/app/chart/chart.models.ts +++ b/Client/src/app/chart/chart.models.ts @@ -33,7 +33,6 @@ export interface IndicatorParamConfig { paramName: string; dataType: string; order: number; - required: boolean; defaultValue: number; minimum: number; maximum: number; diff --git a/Client/src/app/chart/picker/pick-list.component.ts b/Client/src/app/chart/picker/pick-list.component.ts index 6523b92d..f9d505ef 100644 --- a/Client/src/app/chart/picker/pick-list.component.ts +++ b/Client/src/app/chart/picker/pick-list.component.ts @@ -31,8 +31,8 @@ export class PickListComponent { } openEditor(event: MouseEvent, listing: IndicatorListing): void { - this.listRef.closeAll(); event.preventDefault(); + this.listRef.closeAll(); const pickerRef = this.picker.open(PickFormComponent, { minWidth: '300px', @@ -44,8 +44,8 @@ export class PickListComponent { } removeSelection(event: MouseEvent, ucid: string): void { - this.listRef.closeAll(); event.preventDefault(); + // this.listRef.closeAll(); this.cs.deleteSelection(ucid); } diff --git a/Client/src/app/styles-theme.scss b/Client/src/app/styles-theme.scss index dc705f29..64975657 100644 --- a/Client/src/app/styles-theme.scss +++ b/Client/src/app/styles-theme.scss @@ -7,9 +7,9 @@ // ref: https://www.materialpalette.com // Define a light theme -$light-primary: mat.define-palette(mat.$indigo-palette); -$light-accent: mat.define-palette(mat.$pink-palette); -$light-warn: mat.define-palette(mat.$red-palette); +$light-primary: mat.define-palette(mat.$grey-palette); +$light-accent: mat.define-palette(mat.$blue-gray-palette); +$light-warn: mat.define-palette(mat.$deep-orange-palette); $light-theme: mat.define-light-theme( ( color: ( diff --git a/Server/WebApi/Controllers/MainController.cs b/Server/WebApi/Controllers/MainController.cs index cc27a37c..bce609cc 100644 --- a/Server/WebApi/Controllers/MainController.cs +++ b/Server/WebApi/Controllers/MainController.cs @@ -17,9 +17,11 @@ public string Get() } [HttpGet("quotes")] - public IActionResult GetQuotes() + public IActionResult GetQuotes( + string symbol = "QQQ", + string timeSpan = "DAILY") { - IEnumerable quotes = FetchQuotes.Get(); + IEnumerable quotes = FetchQuotes.Get(symbol, timeSpan); return Ok(quotes.TakeLast(limitLast)); } @@ -32,6 +34,26 @@ public IActionResult GetIndicators() ////////////////////////////////////////// // INDICATORS (sorted alphabetically) + [HttpGet("ADL")] + public IActionResult GetAdl( + int smaPeriods = 3) + { + try + { + IEnumerable quotes = FetchQuotes.Get(); + + IEnumerable results = + quotes.GetAdl(smaPeriods) + .TakeLast(limitLast); + + return Ok(results); + } + catch (ArgumentOutOfRangeException rex) + { + return BadRequest(rex.Message); + } + } + [HttpGet("ADX")] public IActionResult GetAdx(int lookbackPeriods = 14) { @@ -70,6 +92,26 @@ public IActionResult GetAroon(int lookbackPeriods = 25) } } + [HttpGet("ATR")] + public IActionResult GetAtr( + int lookbackPeriods = 14) + { + try + { + IEnumerable quotes = FetchQuotes.Get(); + + IEnumerable results = + quotes.GetAtr(lookbackPeriods) + .TakeLast(limitLast); + + return Ok(results); + } + catch (ArgumentOutOfRangeException rex) + { + return BadRequest(rex.Message); + } + } + [HttpGet("BB")] public IActionResult GetBollingerBands( int lookbackPeriods = 20, @@ -92,7 +134,9 @@ public IActionResult GetBollingerBands( } [HttpGet("CHEXIT-LONG")] - public IActionResult GetChandelierLong(int lookbackPeriods, double multiplier) + public IActionResult GetChandelierLong( + int lookbackPeriods, + double multiplier) { try { @@ -111,7 +155,9 @@ public IActionResult GetChandelierLong(int lookbackPeriods, double multiplier) } [HttpGet("CHEXIT-SHORT")] - public IActionResult GetChandelierShort(int lookbackPeriods, double multiplier) + public IActionResult GetChandelierShort( + int lookbackPeriods, + double multiplier) { try { @@ -148,6 +194,25 @@ public IActionResult GetChop(int lookbackPeriods) } } + [HttpGet("DONCHIAN")] + public IActionResult GetDonchian(int lookbackPeriods = 20) + { + try + { + IEnumerable quotes = FetchQuotes.Get(); + + IEnumerable results = + quotes.GetDonchian(lookbackPeriods) + .TakeLast(limitLast); + + return Ok(results); + } + catch (ArgumentOutOfRangeException rex) + { + return BadRequest(rex.Message); + } + } + [HttpGet("ELDER-RAY")] public IActionResult GetElderRay(int lookbackPeriods = 13) { @@ -167,8 +232,27 @@ public IActionResult GetElderRay(int lookbackPeriods = 13) } } + [HttpGet("EPMA")] + public IActionResult GetEpma(int lookbackPeriods) + { + try + { + IEnumerable quotes = FetchQuotes.Get(); + + IEnumerable results = + quotes.GetEpma(lookbackPeriods) + .TakeLast(limitLast); + + return Ok(results); + } + catch (ArgumentOutOfRangeException rex) + { + return BadRequest(rex.Message); + } + } + [HttpGet("EMA")] - public IActionResult GetEMA(int lookbackPeriods) + public IActionResult GetEma(int lookbackPeriods) { try { @@ -186,6 +270,26 @@ public IActionResult GetEMA(int lookbackPeriods) } } + [HttpGet("FISHER")] + public IActionResult GetFisher( + int lookbackPeriods = 10) + { + try + { + IEnumerable quotes = FetchQuotes.Get(); + + IEnumerable results = + quotes.GetFisherTransform(lookbackPeriods) + .TakeLast(limitLast); + + return Ok(results); + } + catch (ArgumentOutOfRangeException rex) + { + return BadRequest(rex.Message); + } + } + [HttpGet("FRACTAL")] public IActionResult GetFractal(int windowSpan = 2) { @@ -205,6 +309,25 @@ public IActionResult GetFractal(int windowSpan = 2) } } + [HttpGet("GATOR")] + public IActionResult GetGator() + { + try + { + IEnumerable quotes = FetchQuotes.Get(); + + IEnumerable results = + quotes.GetGator() + .TakeLast(limitLast); + + return Ok(results); + } + catch (ArgumentOutOfRangeException rex) + { + return BadRequest(rex.Message); + } + } + [HttpGet("HTL")] public IActionResult GetHTL() { @@ -226,9 +349,9 @@ public IActionResult GetHTL() [HttpGet("KELTNER")] public IActionResult GetKeltner( - int emaPeriods = 20, - decimal multiplier = 2, - int atrPeriods = 10) + int emaPeriods = 20, + decimal multiplier = 2, + int atrPeriods = 10) { try { @@ -268,6 +391,25 @@ public IActionResult GetMacd( } } + [HttpGet("MFI")] + public IActionResult GetMfi(int lookbackPeriods) + { + try + { + IEnumerable quotes = FetchQuotes.Get(); + + IEnumerable results = + quotes.GetMfi(lookbackPeriods) + .TakeLast(limitLast); + + return Ok(results); + } + catch (ArgumentOutOfRangeException rex) + { + return BadRequest(rex.Message); + } + } + [HttpGet("PSAR")] public IActionResult GetParabolicSar( decimal accelerationStep = 0.02m, @@ -289,6 +431,27 @@ public IActionResult GetParabolicSar( } } + [HttpGet("ROC")] + public IActionResult GetRoc( + int lookbackPeriods, + int smaPeriods) + { + try + { + IEnumerable quotes = FetchQuotes.Get(); + + IEnumerable results = + quotes.GetRoc(lookbackPeriods, smaPeriods) + .TakeLast(limitLast); + + return Ok(results); + } + catch (ArgumentOutOfRangeException rex) + { + return BadRequest(rex.Message); + } + } + [HttpGet("RSI")] public IActionResult GetRsi( int lookbackPeriods = 14) @@ -309,6 +472,45 @@ public IActionResult GetRsi( } } + [HttpGet("SLOPE")] + public IActionResult GetSlope( + int lookbackPeriods = 14) + { + try + { + IEnumerable quotes = FetchQuotes.Get(); + + IEnumerable results = + quotes.GetSlope(lookbackPeriods) + .TakeLast(limitLast); + + return Ok(results); + } + catch (ArgumentOutOfRangeException rex) + { + return BadRequest(rex.Message); + } + } + + [HttpGet("SMA")] + public IActionResult GetSma(int lookbackPeriods) + { + try + { + IEnumerable quotes = FetchQuotes.Get(); + + IEnumerable results = + quotes.GetSma(lookbackPeriods) + .TakeLast(limitLast); + + return Ok(results); + } + catch (ArgumentOutOfRangeException rex) + { + return BadRequest(rex.Message); + } + } + [HttpGet("STO")] public IActionResult GetStoch( int lookbackPeriods = 14, @@ -374,6 +576,26 @@ public IActionResult GetSuperTrend( } } + [HttpGet("VORTEX")] + public IActionResult GetVortex( + int lookbackPeriods = 14) + { + try + { + IEnumerable quotes = FetchQuotes.Get(); + + IEnumerable results = + quotes.GetVortex(lookbackPeriods) + .TakeLast(limitLast); + + return Ok(results); + } + catch (ArgumentOutOfRangeException rex) + { + return BadRequest(rex.Message); + } + } + [HttpGet("ZIGZAG-CLOSE")] public IActionResult GetZigZagClose( decimal percentChange) diff --git a/Server/WebApi/Models/Model.Metadata.cs b/Server/WebApi/Services/Models.cs similarity index 98% rename from Server/WebApi/Models/Model.Metadata.cs rename to Server/WebApi/Services/Models.cs index 4a39b25d..5a783c03 100644 --- a/Server/WebApi/Models/Model.Metadata.cs +++ b/Server/WebApi/Services/Models.cs @@ -32,7 +32,6 @@ public class IndicatorParamConfig public string ParamName { get; set; } public string DataType { get; set; } public int Order { get; set; } - public bool Required { get; set; } public double? DefaultValue { get; set; } public double Minimum { get; set; } // greater than public double Maximum { get; set; } // less than diff --git a/Server/WebApi/Services/Service.Metadata.cs b/Server/WebApi/Services/Service.Metadata.cs index 9a34b90e..70ad6162 100644 --- a/Server/WebApi/Services/Service.Metadata.cs +++ b/Server/WebApi/Services/Service.Metadata.cs @@ -18,6 +18,47 @@ public static IEnumerable IndicatorList(string baseUrl) List listing = new() { + // Accumulation Distribution Line (ADL) + new IndicatorList + { + Name = "Accumulation Distribution Line (ADL)", + Uiid = "ADL", + LegendTemplate = "ADL w/ SMA([P1])", + Endpoint = $"{baseUrl}/ADL/", + Category = "volume-based", + ChartType = "oscillator", + Parameters = new List + { + new IndicatorParamConfig { + DisplayName = "SMA Periods", + ParamName = "smaPeriods", + DataType = "int", + Order = 1, + DefaultValue = 3, + Minimum = 1, + Maximum = 50 + } + }, + Results = new List{ + new IndicatorResultConfig { + DisplayName = "Accumulation Distribution Line", + TooltipTemplate = "ADL", + DataName = "adl", + DataType = "number", + LineType = "solid", + DefaultColor = standardBlue + }, + new IndicatorResultConfig { + DisplayName = "SMA of ADL", + TooltipTemplate = "ADL SMA([P1])", + DataName = "adlSma", + DataType = "number", + LineType = "solid", + DefaultColor = standardRed + } + } + }, + // Average Directional Index (ADX) new IndicatorList { @@ -58,7 +99,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "lookbackPeriods", DataType = "int", Order = 1, - Required = true, DefaultValue = 14, Minimum = 2, Maximum = 250 @@ -141,7 +181,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "lookbackPeriods", DataType = "int", Order = 1, - Required = true, DefaultValue = 25, Minimum = 1, Maximum = 250 @@ -197,7 +236,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "lookbackPeriods", DataType = "int", Order = 1, - Required = true, DefaultValue = 25, Minimum = 1, Maximum = 250 @@ -215,6 +253,72 @@ public static IEnumerable IndicatorList(string baseUrl) } }, + // Average True Range + new IndicatorList + { + Name = "Average True Range (ATR)", + Uiid = "ATR", + LegendTemplate = "ATR([P1])", + Endpoint = $"{baseUrl}/ATR/", + Category = "price-characteristic", + ChartType = "oscillator", + Parameters = new List + { + new IndicatorParamConfig { + DisplayName = "Lookback Periods", + ParamName = "lookbackPeriods", + DataType = "int", + Order = 1, + DefaultValue = 14, + Minimum = 2, + Maximum = 250 + } + }, + Results = new List{ + new IndicatorResultConfig { + DisplayName = "Average True Range", + TooltipTemplate = "ATR([P1])", + DataName = "atr", + DataType = "number", + LineType = "solid", + DefaultColor = standardBlue + } + } + }, + + // Average True Range Percent + new IndicatorList + { + Name = "Average True Range (ATR) Percent", + Uiid = "ATRP", + LegendTemplate = "ATR([P1]) %", + Endpoint = $"{baseUrl}/ATR/", + Category = "price-characteristic", + ChartType = "oscillator", + Parameters = new List + { + new IndicatorParamConfig { + DisplayName = "Lookback Periods", + ParamName = "lookbackPeriods", + DataType = "int", + Order = 1, + DefaultValue = 14, + Minimum = 2, + Maximum = 250 + } + }, + Results = new List{ + new IndicatorResultConfig { + DisplayName = "Average True Range Percent", + TooltipTemplate = "ATR([P1]) %", + DataName = "atrp", + DataType = "number", + LineType = "solid", + DefaultColor = standardBlue + } + } + }, + // Bollinger Bands new IndicatorList { @@ -232,7 +336,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "lookbackPeriods", DataType = "int", Order = 1, - Required = true, DefaultValue = 20, Minimum = 2, Maximum = 250 @@ -242,7 +345,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName= "standardDeviations", DataType = "number", Order = 2, - Required = true, DefaultValue = 2, Minimum = 0.01, Maximum = 10 @@ -301,7 +403,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "lookbackPeriods", DataType = "int", Order = 1, - Required = true, DefaultValue = 22, Minimum = 1, Maximum = 250 @@ -311,7 +412,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "multiplier", DataType = "number", Order = 2, - Required = true, DefaultValue = 3, Minimum = 1, Maximum = 10 @@ -345,7 +445,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "lookbackPeriods", DataType = "int", Order = 1, - Required = true, DefaultValue = 22, Minimum = 1, Maximum = 250 @@ -355,7 +454,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "multiplier", DataType = "number", Order = 2, - Required = true, DefaultValue = 3, Minimum = 1, Maximum = 10 @@ -420,7 +518,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "lookbackPeriods", DataType = "int", Order = 1, - Required = true, DefaultValue = 14, Minimum = 1, Maximum = 250 @@ -438,6 +535,65 @@ public static IEnumerable IndicatorList(string baseUrl) } }, + // Donchian Channels + new IndicatorList + { + Name = "Donchian Channels", + Uiid = "DONCHIAN", + LegendTemplate = "DONCHIAN([P1])", + Endpoint = $"{baseUrl}/DONCHIAN/", + Category = "price-channel", + ChartType = "overlay", + Order = Order.BehindPrice, + Parameters = new List + { + new IndicatorParamConfig { + DisplayName = "Lookback Periods", + ParamName = "lookbackPeriods", + DataType = "int", + Order = 1, + DefaultValue = 20, + Minimum = 1, + Maximum = 250 + } + }, + Results = new List{ + new IndicatorResultConfig { + DisplayName = "Upper Band", + TooltipTemplate = "DONCHIAN([P1]) Upper Band", + DataName = "upperBand", + DataType = "number", + LineType = "solid", + LineWidth = 1, + DefaultColor = standardOrange, + Fill = new ChartFill + { + Target = "+2", + ColorAbove = darkGrayTransparent, + ColorBelow = darkGrayTransparent + } + }, + new IndicatorResultConfig { + DisplayName = "Centerline", + TooltipTemplate = "DONCHIAN([P1]) Centerline", + DataName = "centerline", + DataType = "number", + LineType = "dash", + LineWidth = 1, + DefaultColor = standardOrange + }, + new IndicatorResultConfig { + DisplayName = "Lower Band", + TooltipTemplate = "DONCHIAN([P1]) Lower Band", + DataName = "lowerBand", + DataType = "number", + LineType = "solid", + LineWidth = 1, + DefaultColor = standardOrange + } + } + }, + // Elder-ray new IndicatorList { @@ -454,7 +610,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "lookbackPeriods", DataType = "int", Order = 1, - Required = true, DefaultValue = 13, Minimum = 1, Maximum = 250 @@ -482,6 +637,39 @@ public static IEnumerable IndicatorList(string baseUrl) } }, + // Endpoint Moving Average + new IndicatorList + { + Name = "Endpoint Moving Average (EPMA)", + Uiid = "EPMA", + LegendTemplate = "EPMA([P1])", + Endpoint = $"{baseUrl}/EPMA/", + Category = "moving-average", + ChartType = "overlay", + Parameters = new List + { + new IndicatorParamConfig { + DisplayName = "Lookback Periods", + ParamName = "lookbackPeriods", + DataType = "int", + Order = 1, + DefaultValue = 10, + Minimum = 1, + Maximum = 250 + } + }, + Results = new List{ + new IndicatorResultConfig { + DisplayName = "EPMA", + TooltipTemplate = "EPMA([P1])", + DataName = "epma", + DataType = "number", + LineType = "solid", + DefaultColor = standardBlue + } + } + }, + // Exponential Moving Average new IndicatorList { @@ -498,7 +686,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "lookbackPeriods", DataType = "int", Order = 1, - Required = true, DefaultValue = 20, Minimum = 1, Maximum = 250 @@ -516,6 +703,47 @@ public static IEnumerable IndicatorList(string baseUrl) } }, + // Fisher Transform + new IndicatorList + { + Name = "Ehlers Fisher Transform", + Uiid = "FISHER", + LegendTemplate = "FISHER([P1])", + Endpoint = $"{baseUrl}/FISHER/", + Category = "price-transform", + ChartType = "oscillator", + Parameters = new List + { + new IndicatorParamConfig { + DisplayName = "Lookback Periods", + ParamName = "lookbackPeriods", + DataType = "int", + Order = 1, + DefaultValue = 10, + Minimum = 1, + Maximum = 250 + } + }, + Results = new List{ + new IndicatorResultConfig { + DisplayName = "Fisher Transform", + TooltipTemplate = "Fisher Transform", + DataName = "fisher", + DataType = "number", + LineType = "solid", + DefaultColor = standardBlue + }, + new IndicatorResultConfig { + DisplayName = "Trigger", + TooltipTemplate = "Trigger", + DataName = "trigger", + DataType = "number", + LineType = "solid", + DefaultColor = standardRed + } + } + }, + // Fractal (Williams) new IndicatorList { @@ -532,7 +760,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "windowSpan", DataType = "int", Order = 1, - Required = true, DefaultValue = 2, Minimum = 1, Maximum = 100 @@ -606,7 +833,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "emaPeriods", DataType = "int", Order = 1, - Required = true, DefaultValue = 20, Minimum = 2, Maximum = 250 @@ -616,7 +842,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName= "multiplier", DataType = "number", Order = 2, - Required = true, DefaultValue = 2, Minimum = 0.01, Maximum = 10 @@ -626,7 +851,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName= "atrPeriods", DataType = "number", Order = 3, - Required = true, DefaultValue = 10, Minimum = 2, Maximum = 250 @@ -669,6 +893,70 @@ public static IEnumerable IndicatorList(string baseUrl) } }, + // Money Flow Index + new IndicatorList + { + Name = "Money Flow Index (MFI)", + Uiid = "MFI", + LegendTemplate = "MFI([P1])", + Endpoint = $"{baseUrl}/MFI/", + Category = "oscillator", + ChartType = "volume-based", + ChartConfig = new ChartConfig + { + MinimumYAxis = 0, + MaximumYAxis = 100, + + Thresholds = new List + { + new ChartThreshold { + Value = 80, + Color = thresholdRed, + Style = "dash", + Fill = new ChartFill + { + Target = "+2", + ColorAbove = "transparent", + ColorBelow = thresholdGreen + } + }, + new ChartThreshold { + Value = 20, + Color = thresholdGreen, + Style = "dash", + Fill = new ChartFill + { + Target = "+1", + ColorAbove = thresholdRed, + ColorBelow = "transparent" + } + } + } + }, + Parameters = new List + { + new IndicatorParamConfig { + DisplayName = "Lookback Periods", + ParamName = "lookbackPeriods", + DataType = "int", + Order = 1, + DefaultValue = 14, + Minimum = 1, + Maximum = 250 + } + }, + Results = new List{ + new IndicatorResultConfig { + DisplayName = "MFI", + TooltipTemplate = "MFI([P1])", + DataName = "mfi", + DataType = "number", + LineType = "solid", + DefaultColor = standardBlue + } + } + }, + // Moving Average Convergence/Divergence new IndicatorList { @@ -696,7 +984,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "fastPeriods", DataType = "int", Order = 1, - Required = true, DefaultValue = 12, Minimum = 1, Maximum = 200 @@ -706,7 +993,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "slowPeriods", DataType = "int", Order = 2, - Required = true, DefaultValue = 26, Minimum = 1, Maximum = 250 @@ -716,7 +1002,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "signalPeriods", DataType = "int", Order = 3, - Required = true, DefaultValue = 9, Minimum = 1, Maximum = 50 @@ -767,7 +1052,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName= "accelerationStep", DataType = "number", Order = 1, - Required = true, DefaultValue = 0.02, Minimum = 0.000001, Maximum = 2500 @@ -777,7 +1061,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName= "maxAccelerationFactor", DataType = "number", Order = 2, - Required = true, DefaultValue = 0.2, Minimum = 0.000001, Maximum = 2500 @@ -796,6 +1079,56 @@ public static IEnumerable IndicatorList(string baseUrl) } }, + // Rate of Change + new IndicatorList + { + Name = "Rate of Change", + Uiid = "ROC", + LegendTemplate = "ROC([P1],[P2])", + Endpoint = $"{baseUrl}/ROC/", + Category = "oscillator", + ChartType = "oscillator", + Parameters = new List + { + new IndicatorParamConfig { + DisplayName = "Lookback Periods", + ParamName = "lookbackPeriods", + DataType = "int", + Order = 1, + DefaultValue = 14, + Minimum = 1, + Maximum = 250 + }, + new IndicatorParamConfig { + DisplayName = "SMA Periods", + ParamName = "smaPeriods", + DataType = "int", + Order = 2, + DefaultValue = 3, + Minimum = 1, + Maximum = 50 + } + }, + Results = new List{ + new IndicatorResultConfig { + DisplayName = "Rate of Change", + TooltipTemplate = "ROC([P1],[P2])", + DataName = "roc", + DataType = "number", + LineType = "solid", + DefaultColor = standardBlue + }, + new IndicatorResultConfig { + DisplayName = "SMA of ROC", + TooltipTemplate = "STO %D([P2])", + DataName = "rocSma", + DataType = "number", + LineType= "solid", + DefaultColor = standardRed + } + } + }, + // Relative Strength Index new IndicatorList { @@ -843,7 +1176,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "lookbackPeriods", DataType = "int", Order = 1, - Required = true, DefaultValue = 14, Minimum = 1, Maximum = 250 @@ -861,6 +1193,105 @@ public static IEnumerable IndicatorList(string baseUrl) } }, + // Slope + new IndicatorList + { + Name = "Slope", + Uiid = "SLOPE", + LegendTemplate = "SLOPE([P1])", + Endpoint = $"{baseUrl}/SLOPE/", + Category = "price-characteristic", + ChartType = "oscillator", + Parameters = new List + { + new IndicatorParamConfig { + DisplayName = "Lookback Periods", + ParamName = "lookbackPeriods", + DataType = "int", + Order = 1, + DefaultValue = 14, + Minimum = 1, + Maximum = 250 + } + }, + Results = new List{ + new IndicatorResultConfig { + DisplayName = "Slope", + TooltipTemplate = "SLOPE([P1])", + DataName = "slope", + DataType = "number", + LineType = "solid", + DefaultColor = standardBlue + } + } + }, + + // Linear Regression + new IndicatorList + { + Name = "Linear Regression", + Uiid = "LINEAR", + LegendTemplate = "LINEAR([P1])", + Endpoint = $"{baseUrl}/SLOPE/", + Category = "price-characteristic", + ChartType = "overlay", + Parameters = new List + { + new IndicatorParamConfig { + DisplayName = "Lookback Periods", + ParamName = "lookbackPeriods", + DataType = "int", + Order = 1, + DefaultValue = 14, + Minimum = 1, + Maximum = 250 + } + }, + Results = new List{ + new IndicatorResultConfig { + DisplayName = "Linear Regression", + TooltipTemplate = "LINEAR([P1])", + DataName = "line", + DataType = "number", + LineType = "solid", + DefaultColor = standardBlue + } + } + }, + + // Simple Moving Average + new IndicatorList + { + Name = "Simple Moving Average (SMA)", + Uiid = "SMA", + LegendTemplate = "SMA([P1])", + Endpoint = $"{baseUrl}/SMA/", + Category = "moving-average", + ChartType = "overlay", + Parameters = new List + { + new IndicatorParamConfig { + DisplayName = "Lookback Periods", + ParamName = "lookbackPeriods", + DataType = "int", + Order = 1, + DefaultValue = 10, + Minimum = 1, + Maximum = 250 + } + }, + Results = new List{ + new IndicatorResultConfig { + DisplayName = "SMA", + TooltipTemplate = "SMA([P1])", + DataName = "sma", + DataType = "number", + LineType = "solid", + DefaultColor = standardBlue + } + } + }, + // Stochastic Oscillator new IndicatorList { @@ -905,7 +1336,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "lookbackPeriods", DataType = "int", Order = 1, - Required = true, DefaultValue = 14, Minimum = 1, Maximum = 250 @@ -915,7 +1345,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "signalPeriods", DataType = "int", Order = 2, - Required = true, DefaultValue = 3, Minimum = 1, Maximum = 250 @@ -993,7 +1422,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "rsiPeriods", DataType = "int", Order = 1, - Required = true, DefaultValue = 14, Minimum = 1, Maximum = 250 @@ -1003,7 +1431,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "stochPeriods", DataType = "int", Order = 2, - Required = true, DefaultValue = 14, Minimum = 1, Maximum = 250 @@ -1013,7 +1440,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "signalPeriods", DataType = "int", Order = 3, - Required = true, DefaultValue = 3, Minimum = 1, Maximum = 50 @@ -1023,7 +1449,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "stochPeriods", DataType = "int", Order = 4, - Required = true, DefaultValue = 1, Minimum = 1, Maximum = 50 @@ -1066,7 +1491,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "lookbackPeriods", DataType = "int", Order = 1, - Required = true, DefaultValue = 10, Minimum = 1, Maximum = 50 @@ -1076,7 +1500,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName= "multiplier", DataType = "number", Order = 2, - Required = true, DefaultValue = 3, Minimum = 0.1, Maximum = 10 @@ -1111,6 +1534,47 @@ public static IEnumerable IndicatorList(string baseUrl) } }, + // Vortex Indicator + new IndicatorList + { + Name = "Vortex Indicator", + Uiid = "VORTEX", + LegendTemplate = "VORTEX([P1])", + Endpoint = $"{baseUrl}/VORTEX/", + Category = "price-trend", + ChartType = "oscillator", + Parameters = new List + { + new IndicatorParamConfig { + DisplayName = "Lookback Periods", + ParamName = "lookbackPeriods", + DataType = "int", + Order = 1, + DefaultValue = 14, + Minimum = 2, + Maximum = 100 + } + }, + Results = new List{ + new IndicatorResultConfig { + DisplayName = "VI+", + TooltipTemplate = "VI+", + DataName = "pvi", + DataType = "number", + LineType = "solid", + DefaultColor = standardGreen + }, + new IndicatorResultConfig { + DisplayName = "VI+", + TooltipTemplate = "VI-", + DataName = "nvi", + DataType = "number", + LineType = "solid", + DefaultColor = standardRed + } + } + }, + // Zig Zag (close) new IndicatorList { @@ -1127,7 +1591,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "percentChange", DataType = "number", Order = 1, - Required = true, DefaultValue = 5, Minimum = 1, Maximum = 200 @@ -1161,7 +1624,6 @@ public static IEnumerable IndicatorList(string baseUrl) ParamName = "percentChange", DataType = "number", Order = 1, - Required = true, DefaultValue = 5, Minimum = 1, Maximum = 200 diff --git a/Server/WebApi/Services/Service.Quotes.cs b/Server/WebApi/Services/Service.Quotes.cs index 9cbf8ee2..057afbf4 100644 --- a/Server/WebApi/Services/Service.Quotes.cs +++ b/Server/WebApi/Services/Service.Quotes.cs @@ -8,9 +8,11 @@ namespace WebApi.Services; internal static class FetchQuotes { - internal static IEnumerable Get(string symbol = "QQQ") + internal static IEnumerable Get( + string symbol = "QQQ", + string timeSpan = "DAILY") { - string blobName = $"{symbol}-DAILY.json"; + string blobName = $"{symbol}-{timeSpan}.json"; try {