{ "cells": [ { "cell_type": "code", "execution_count": 51, "metadata": { "dotnet_interactive": { "language": "csharp" }, "vscode": { "languageId": "dotnet-interactive.csharp" } }, "outputs": [ { "data": { "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "#r \"nuget: QuanTAlib;\"\n", "#r \"nuget: Plotly.NET;\"\n", "#r \"nuget: Plotly.NET.Interactive;\"\n", "\n", "using QuanTAlib;\n", "using Plotly.NET;\n", "using Plotly.NET.LayoutObjects;\n" ] }, { "cell_type": "code", "execution_count": 52, "metadata": { "dotnet_interactive": { "language": "csharp" }, "vscode": { "languageId": "dotnet-interactive.csharp" } }, "outputs": [], "source": [ "Yahoo_Feed data = new(Symbol: \"MSFT\", Period: 200);\n", "ZLEMA_Series calc1 = new(data.OHLC4,20,true);\n", "HMA_Series calc2 = new(data.OHLC4,20, true);\n", "HEMA_Series calc3 = new(data.OHLC4,20, true);" ] }, { "cell_type": "code", "execution_count": 53, "metadata": { "dotnet_interactive": { "language": "csharp" }, "vscode": { "languageId": "dotnet-interactive.csharp" } }, "outputs": [ { "ename": "Error", "evalue": "(21,5): error CS7017: Member definition, statement, or end-of-file expected", "output_type": "error", "traceback": [ "(21,5): error CS7017: Member definition, statement, or end-of-file expected" ] } ], "source": [ "var layout = Layout.init( \n", " PlotBGColor : Color.fromString(\"#1e1e1e\"),\n", " PaperBGColor : Color.fromString(\"#1e1e1e\"),\n", " Font:Font.init(Size:10, Color: Color.fromString(\"#ffffff\")));\n", "\n", "var yAxis = LinearAxis.init(\n", " GridColor:Color.fromString(\"#252525\")); \n", "\n", "var candles = Chart2D.Chart.Candlestick(data.Open.v, data.High.v, data.Low.v, data.Close.v, data.Open.t, \"\");\n", "var line1 = Chart2D.Chart.Line(calc1.t, calc1.v,false,\"\").WithLineStyle(Width: 2, Color: Color.fromString(\"yellow\"));\n", "var line2 = Chart2D.Chart.Line(calc2.t, calc2.v, false,\"\").WithLineStyle(Width: 3, Color: Color.fromString(\"red\"));\n", "var line3 = Chart2D.Chart.Line(calc3.t, calc3.v, false,\"\").WithLineStyle(Width: 2, Color: Color.fromString(\"blue\"));\n", "var chart = Chart.Combine(new []{candles, line1, line2, line3})\n", " .WithSize(1200,600)\n", " .WithMargin(Margin.init(30,10,40,30,1,false))\n", " .WithXAxisRangeSlider(RangeSlider.init(Visible:false))\n", " .WithYAxis(yAxis)\n", " .WithXAxis(yAxis)\n", " .WithTitle(\"MSFT\")\n", " .WithLayout(layout);\n", "\n", "chart" ] } ], "metadata": { "kernelspec": { "display_name": ".NET (C#)", "language": "C#", "name": ".net-csharp" }, "language_info": { "file_extension": ".cs", "mimetype": "text/x-csharp", "name": "C#", "pygments_lexer": "csharp", "version": "9.0" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }