{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "dotnet_interactive": { "language": "csharp" }, "vscode": { "languageId": "dotnet-interactive.csharp" } }, "outputs": [ { "data": { "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "Loading extensions from `C:\\Users\\miha\\.nuget\\packages\\plotly.net.interactive\\3.0.2\\interactive-extensions\\dotnet\\Plotly.NET.Interactive.dll`" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "//#r \"nuget: QuanTAlib;\"\n", "\n", "#r \"nuget: Plotly.NET;\"\n", "#r \"nuget: Plotly.NET.Interactive;\"\n", "#r \"..\\Source\\bin\\Debug\\net6.0\\QuanTAlib.dll\"\n", "\n", "using QuanTAlib;\n", "using Plotly.NET;\n", "using Plotly.NET.LayoutObjects;" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "dotnet_interactive": { "language": "csharp" }, "vscode": { "languageId": "dotnet-interactive.csharp" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\r\n", "\r\n", "\n", " \n", "
\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "int period = 25;\n", "GBM_Feed feed = new(50, Volatility: 1);\n", "TSeries data = feed.OHLC4;\n", "//List raw = new() { 0, 1, 1 ,1 ,1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0}; \n", "//TSeries data = new();\n", "//for (int i=0; i(data.t, data.v, false, data.GetType().Name).WithLineStyle(Width: 4, Color: Color.fromString(\"red\"));\n", "var line1 = Chart2D.Chart.Line(calc1.t, calc1.v, false, \"EMA_SMA\").WithLineStyle(Width: 2, Color: Color.fromString(\"purple\"));\n", "var line2 = Chart2D.Chart.Line(calc2.t, calc2.v, false, \"True EMA\").WithLineStyle(Width: 2, Color: Color.fromString(\"blue\"));\n", "\n", "var chart = Chart.Combine(new []{line0, line1, line2})\n", " .WithSize(1200,600)\n", " .WithMargin(Margin.init(30,10,40,30,1,false))\n", " .WithXAxisRangeSlider(RangeSlider.init(Visible:false));\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 }