Files
QuanTAlib/docs/crossovers.ipynb
T
Miha Kralj 59ca5c2395 GitVersion
GitVersion
2022-11-12 20:06:54 -08:00

150 lines
32 KiB
Plaintext

{
"cells": [
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
},
"vscode": {
"languageId": "dotnet-interactive.csharp"
}
},
"outputs": [
{
"data": {
"text/html": [
"<div><div></div><div></div><div></div></div>"
]
},
"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": 12,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
},
"vscode": {
"languageId": "dotnet-interactive.csharp"
}
},
"outputs": [],
"source": [
"String Sym = \"IBM\";\n",
"Alphavantage_Feed data = new(Symbol: Sym);\n",
"ZLEMA_Series calc1 = new(data.OHLC4,20);\n",
"HMA_Series calc2 = new(data.OHLC4,20);\n",
"HEMA_Series calc3 = new(data.OHLC4,20);"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
},
"vscode": {
"languageId": "dotnet-interactive.csharp"
}
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"<div>\n",
" <div id=\"9d18e089-f1c1-4acd-8009-21b4458a77d6\"><!-- Plotly chart will be drawn inside this DIV --></div>\r\n",
"<script type=\"text/javascript\">\r\n",
"\r\n",
" var renderPlotly_9d18e089f1c14acd800921b4458a77d6 = function() {\r\n",
" var fsharpPlotlyRequire = requirejs.config({context:'fsharp-plotly',paths:{plotly:'https://cdn.plot.ly/plotly-2.6.3.min'}}) || require;\r\n",
" fsharpPlotlyRequire(['plotly'], function(Plotly) {\r\n",
"\r\n",
" var data = [{\"type\":\"candlestick\",\"name\":\"\",\"x\":[\"2022-11-11T00:00:00\",\"2022-11-10T00:00:00\",\"2022-11-09T00:00:00\",\"2022-11-08T00:00:00\",\"2022-11-07T00:00:00\",\"2022-11-04T00:00:00\",\"2022-11-03T00:00:00\",\"2022-11-02T00:00:00\",\"2022-11-01T00:00:00\",\"2022-10-31T00:00:00\",\"2022-10-28T00:00:00\",\"2022-10-27T00:00:00\",\"2022-10-26T00:00:00\",\"2022-10-25T00:00:00\",\"2022-10-24T00:00:00\",\"2022-10-21T00:00:00\",\"2022-10-20T00:00:00\",\"2022-10-19T00:00:00\",\"2022-10-18T00:00:00\",\"2022-10-17T00:00:00\",\"2022-10-14T00:00:00\",\"2022-10-13T00:00:00\",\"2022-10-12T00:00:00\",\"2022-10-11T00:00:00\",\"2022-10-10T00:00:00\",\"2022-10-07T00:00:00\",\"2022-10-06T00:00:00\",\"2022-10-05T00:00:00\",\"2022-10-04T00:00:00\",\"2022-10-03T00:00:00\",\"2022-09-30T00:00:00\",\"2022-09-29T00:00:00\",\"2022-09-28T00:00:00\",\"2022-09-27T00:00:00\",\"2022-09-26T00:00:00\",\"2022-09-23T00:00:00\",\"2022-09-22T00:00:00\",\"2022-09-21T00:00:00\",\"2022-09-20T00:00:00\",\"2022-09-19T00:00:00\",\"2022-09-16T00:00:00\",\"2022-09-15T00:00:00\",\"2022-09-14T00:00:00\",\"2022-09-13T00:00:00\",\"2022-09-12T00:00:00\",\"2022-09-09T00:00:00\",\"2022-09-08T00:00:00\",\"2022-09-07T00:00:00\",\"2022-09-06T00:00:00\",\"2022-09-02T00:00:00\",\"2022-09-01T00:00:00\",\"2022-08-31T00:00:00\",\"2022-08-30T00:00:00\",\"2022-08-29T00:00:00\",\"2022-08-26T00:00:00\",\"2022-08-25T00:00:00\",\"2022-08-24T00:00:00\",\"2022-08-23T00:00:00\",\"2022-08-22T00:00:00\",\"2022-08-19T00:00:00\",\"2022-08-18T00:00:00\",\"2022-08-17T00:00:00\",\"2022-08-16T00:00:00\",\"2022-08-15T00:00:00\",\"2022-08-12T00:00:00\",\"2022-08-11T00:00:00\",\"2022-08-10T00:00:00\",\"2022-08-09T00:00:00\",\"2022-08-08T00:00:00\",\"2022-08-05T00:00:00\",\"2022-08-04T00:00:00\",\"2022-08-03T00:00:00\",\"2022-08-02T00:00:00\",\"2022-08-01T00:00:00\",\"2022-07-29T00:00:00\",\"2022-07-28T00:00:00\",\"2022-07-27T00:00:00\",\"2022-07-26T00:00:00\",\"2022-07-25T00:00:00\",\"2022-07-22T00:00:00\",\"2022-07-21T00:00:00\",\"2022-07-20T00:00:00\",\"2022-07-19T00:00:00\",\"2022-07-18T00:00:00\",\"2022-07-15T00:00:00\",\"2022-07-14T00:00:00\",\"2022-07-13T00:00:00\",\"2022-07-12T00:00:00\",\"2022-07-11T00:00:00\",\"2022-07-08T00:00:00\",\"2022-07-07T00:00:00\",\"2022-07-06T00:00:00\",\"2022-07-05T00:00:00\",\"2022-07-01T00:00:00\",\"2022-06-30T00:00:00\",\"2022-06-29T00:00:00\",\"2022-06-28T00:00:00\",\"2022-06-27T00:00:00\",\"2022-06-24T00:00:00\",\"2022-06-23T00:00:00\"],\"close\":[143.17,141.23,137.39,140.04,138.34,136.96,134.47,136.83,138.2,138.29,138.51,134.77,135.01,132.93,132.69,129.9,128.3,122.51,122.94,121.52,120.04,121.79,117.57,117.8,117.75,118.82,122.23,125.74,125.5,121.51,118.81,121.63,122.76,121.74,122.01,122.71,125.31,124.93,126.3,127.73,127.27,125.49,127.69,127.25,130.66,129.19,128.47,127.71,126.72,127.79,129.66,128.45,129.58,130.31,130.38,133.98,133.23,134.74,135.55,138.37,139.07,137.79,136.56,134.93,134.01,132.54,131.5,129.47,132.61,132.48,131.64,132.34,131.81,132.04,130.79,129.22,129.12,128.08,128.54,128.25,127.15,129.18,130.88,138.13,139.92,139.06,137.18,139.18,141.0,140.47,140.83,138.08,137.62,141.12,141.19,140.71,141.86,142.8,142.06,138.44],\"open\":[141.5,140.26,137.95,139.0,136.64,135.65,136.42,137.75,138.25,138.06,135.56,135.55,133.72,132.0,130.9,128.39,126.25,122.36,123.0,121.8,121.8,116.1,118.0,117.46,119.79,121.5,124.88,124.71,122.8,120.16,121.66,121.85,121.65,122.6,122.3,124.53,124.76,126.89,126.9,126.49,124.36,127.39,127.5,129.14,130.33,128.9,127.2,126.69,127.8,130.3,128.4,129.92,130.56,129.99,134.1,133.65,134.89,135.37,137.65,138.75,137.79,136.46,134.6,132.96,132.62,132.36,130.75,129.92,133.1,131.25,132.15,131.82,132.2,130.75,129.52,128.75,127.97,128.26,128.44,127.03,128.75,130.7,131.58,140.15,140.68,135.6,137.18,140.84,140.62,140.76,138.91,138.0,139.97,141.0,139.58,142.74,142.92,142.26,139.2,137.14],\"high\":[144.13,141.37,138.9,140.93,138.7,137.73,136.48,140.17,138.65,138.7699,138.8615,136.4,135.863,133.3,133.11,130.845,128.96,123.94,123.94,122.875,122.54,122.15,118.81,119.23,119.96,121.8016,125.3,126.46,125.65,122.21,122.43,122.62,123.23,123.95,124.26,125.0,126.51,127.84,126.99,128.06,127.53,127.465,129.0,129.909,130.99,129.49,128.54,127.8667,128.06,130.56,129.8173,130.0,130.77,131.42,134.18,134.425,135.11,136.1,137.85,139.34,139.12,138.415,137.37,135.19,134.09,133.225,131.78,130.79,133.35,132.67,132.2866,132.862,132.78,132.7,131.0,129.81,129.43,129.3,129.1257,128.32,128.81,130.72,132.56,140.31,140.68,139.43,138.9,141.55,141.87,141.3203,141.325,139.14,139.97,141.67,142.46,143.5213,144.155,143.83,142.37,138.62],\"low\":[140.96,138.29,136.94,138.72,136.51,134.94,133.97,136.8,136.7,136.595,135.22,134.445,132.81,131.3,129.85,127.59,125.15,121.9875,121.82,121.43,119.84,115.545,117.2,116.94,117.04,118.07,121.77,124.23,122.52,119.6,118.61,120.57,119.81,121.08,121.75,121.74,124.41,124.92,125.52,126.28,123.83,124.9,126.845,126.7709,129.89,128.06,126.59,126.28,126.3,127.24,127.74,128.4,129.29,129.57,130.34,133.07,133.11,134.72,135.47,137.66,137.75,136.3,134.4517,132.24,131.98,132.0,130.34,129.12,132.02,131.07,131.02,131.32,130.51,130.7,129.31,128.606,127.58,127.63,127.9,125.71,125.13,128.06,127.72,137.7844,138.61,135.02,136.8,138.565,140.13,139.82,138.83,137.13,135.27,139.26,139.28,139.5,141.32,141.95,139.13,136.5],\"increasing\":{\"marker\":{},\"line\":{}},\"decreasing\":{\"marker\":{},\"line\":{}}},{\"type\":\"scatter\",\"name\":\"ZLEMA_Series\",\"mode\":\"lines\",\"x\":[\"2022-11-11T00:00:00\",\"2022-11-10T00:00:00\",\"2022-11-09T00:00:00\",\"2022-11-08T00:00:00\",\"2022-11-07T00:00:00\",\"2022-11-04T00:00:00\",\"2022-11-03T00:00:00\",\"2022-11-02T00:00:00\",\"2022-11-01T00:00:00\",\"2022-10-31T00:00:00\",\"2022-10-28T00:00:00\",\"2022-10-27T00:00:00\",\"2022-10-26T00:00:00\",\"2022-10-25T00:00:00\",\"2022-10-24T00:00:00\",\"2022-10-21T00:00:00\",\"2022-10-20T00:00:00\",\"2022-10-19T00:00:00\",\"2022-10-18T00:00:00\",\"2022-10-17T00:00:00\",\"2022-10-14T00:00:00\",\"2022-10-13T00:00:00\",\"2022-10-12T00:00:00\",\"2022-10-11T00:00:00\",\"2022-10-10T00:00:00\",\"2022-10-07T00:00:00\",\"2022-10-06T00:00:00\",\"2022-10-05T00:00:00\",\"2022-10-04T00:00:00\",\"2022-10-03T00:00:00\",\"2022-09-30T00:00:00\",\"2022-09-29T00:00:00\",\"2022-09-28T00:00:00\",\"2022-09-27T00:00:00\",\"2022-09-26T00:00:00\",\"2022-09-23T00:00:00\",\"2022-09-22T00:00:00\",\"2022-09-21T00:00:00\",\"2022-09-20T00:00:00\",\"2022-09-19T00:00:00\",\"2022-09-16T00:00:00\",\"2022-09-15T00:00:00\",\"2022-09-14T00:00:00\",\"2022-09-13T00:00:00\",\"2022-09-12T00:00:00\",\"2022-09-09T00:00:00\",\"2022-09-08T00:00:00\",\"2022-09-07T00:00:00\",\"2022-09-06T00:00:00\",\"2022-09-02T00:00:00\",\"2022-09-01T00:00:00\",\"2022-08-31T00:00:00\",\"2022-08-30T00:00:00\",\"2022-08-29T00:00:00\",\"2022-08-26T00:00:00\",\"2022-08-25T00:00:00\",\"2022-08-24T00:00:00\",\"2022-08-23T00:00:00\",\"2022-08-22T00:00:00\",\"2022-08-19T00:00:00\",\"2022-08-18T00:00:00\",\"2022-08-17T00:00:00\",\"2022-08-16T00:00:00\",\"2022-08-15T00:00:00\",\"2022-08-12T00:00:00\",\"2022-08-11T00:00:00\",\"2022-08-10T00:00:00\",\"2022-08-09T00:00:00\",\"2022-08-08T00:00:00\",\"2022-08-05T00:00:00\",\"2022-08-04T00:00:00\",\"2022-08-03T00:00:00\",\"2022-08-02T00:00:00\",\"2022-08-01T00:00:00\",\"2022-07-29T00:00:00\",\"2022-07-28T00:00:00\",\"2022-07-27T00:00:00\",\"2022-07-26T00:00:00\",\"2022-07-25T00:00:00\",\"2022-07-22T00:00:00\",\"2022-07-21T00:00:00\",\"2022-07-20T00:00:00\",\"2022-07-19T00:00:00\",\"2022-07-18T00:00:00\",\"2022-07-15T00:00:00\",\"2022-07-14T00:00:00\",\"2022-07-13T00:00:00\",\"2022-07-12T00:00:00\",\"2022-07-11T00:00:00\",\"2022-07-08T00:00:00\",\"2022-07-07T00:00:00\",\"2022-07-06T00:00:00\",\"2022-07-05T00:00:00\",\"2022-07-01T00:00:00\",\"2022-06-30T00:00:00\",\"2022-06-29T00:00:00\",\"2022-06-28T00:00:00\",\"2022-06-27T00:00:00\",\"2022-06-24T00:00:00\",\"2022-06-23T00:00:00\"],\"y\":[142.44,140.2875,137.90833333333333,137.6575,136.65699999999998,135.58083333333332,134.53071428571428,134.38125,134.2788888888889,134.192745,134.1559727272727,134.04193333333333,133.6563230769231,133.19640714285714,132.78031333333334,132.1707625,131.2455705882353,129.923525,128.76551184210527,127.66596750000001,125.68051821428571,123.56254028911565,121.6430126425332,119.97010667657764,118.83854889785597,118.27590614567922,118.8582603222812,119.69509267254013,120.32686956086964,120.36097722173919,120.50362224824022,120.97375346269352,121.43982456148461,121.87888888896227,122.18681375668015,122.3066410179487,122.58315139719168,123.11547031174486,123.96018742491201,124.90707433682515,125.37568630474655,125.88847808524687,126.58243255331861,127.28457707205017,128.2517602080454,128.6632592358506,128.71961549910293,128.6363997372836,128.509123571828,128.8603975173682,129.11154061095218,129.25579864800434,129.5012011577182,129.56561057126885,130.13936194543373,131.06537509348766,132.01470365601264,133.08425568877334,134.15123133746158,135.48498787675095,136.6457033170604,137.3873030011499,137.7474027153261,137.5247929329141,137.05278884406513,136.47418990653512,135.56736229638892,134.37237541101854,133.67119680044536,132.8741780575458,132.24873729016048,131.8846265958595,131.6879954914919,131.51961496849268,131.1633421143505,130.77640477012665,130.4381757444003,129.81215900683836,129.36674862523472,128.74904399425998,128.18575409004475,128.12092036718334,128.28297557030874,130.16385408742218,132.13382036481053,133.4572660443524,134.7196692782236,136.32408887077372,138.05346135927147,139.54600313457894,140.5685266455714,141.03723839361223,140.68334902279202,140.76612530633562,141.07197051525606,141.5147018947555,141.8555636190645,142.1088432743917,141.98299391492583,141.35378020874242],\"marker\":{},\"line\":{\"color\":\"yellow\",\"width\":2.0}},{\"type\":\"scatter\",\"name\":\"HMA_Series\",\"mode\":\"lines\",\"x\":[\"2022-11-11T00:00:00\",\"2022-11-10T00:00:00\",\"2022-11-09T00:00:00\",\"2022-11-08T00:00:00\",\"2022-11-07T00:00:00\",\"2022-11-04T00:00:00\",\"2022-11-03T00:00:00\",\"2022-11-02T00:00:00\",\"2022-11-01T00:00:00\",\"2022-10-31T00:00:00\",\"2022-10-28T00:00:00\",\"2022-10-27T00:00:00\",\"2022-10-26T00:00:00\",\"2022-10-25T00:00:00\",\"2022-10-24T00:00:00\",\"2022-10-21T00:00:00\",\"2022-10-20T00:00:00\",\"2022-10-19T00:00:00\",\"2022-10-18T00:00:00\",\"2022-10-17T00:00:00\",\"2022-10-14T00:00:00\",\"2022-10-13T00:00:00\",\"2022-10-12T00:00:00\",\"2022-10-11T00:00:00\",\"2022-10-10T00:00:00\",\"2022-10-07T00:00:00\",\"2022-10-06T00:00:00\",\"2022-10-05T00:00:00\",\"2022-10-04T00:00:00\",\"2022-10-03T00:00:00\",\"2022-09-30T00:00:00\",\"2022-09-29T00:00:00\",\"2022-09-28T00:00:00\",\"2022-09-27T00:00:00\",\"2022-09-26T00:00:00\",\"2022-09-23T00:00:00\",\"2022-09-22T00:00:00\",\"2022-09-21T00:00:00\",\"2022-09-20T00:00:00\",\"2022-09-19T00:00:00\",\"2022-09-16T00:00:00\",\"2022-09-15T00:00:00\",\"2022-09-14T00:00:00\",\"2022-09-13T00:00:00\",\"2022-09-12T00:00:00\",\"2022-09-09T00:00:00\",\"2022-09-08T00:00:00\",\"2022-09-07T00:00:00\",\"2022-09-06T00:00:00\",\"2022-09-02T00:00:00\",\"2022-09-01T00:00:00\",\"2022-08-31T00:00:00\",\"2022-08-30T00:00:00\",\"2022-08-29T00:00:00\",\"2022-08-26T00:00:00\",\"2022-08-25T00:00:00\",\"2022-08-24T00:00:00\",\"2022-08-23T00:00:00\",\"2022-08-22T00:00:00\",\"2022-08-19T00:00:00\",\"2022-08-18T00:00:00\",\"2022-08-17T00:00:00\",\"2022-08-16T00:00:00\",\"2022-08-15T00:00:00\",\"2022-08-12T00:00:00\",\"2022-08-11T00:00:00\",\"2022-08-10T00:00:00\",\"2022-08-09T00:00:00\",\"2022-08-08T00:00:00\",\"2022-08-05T00:00:00\",\"2022-08-04T00:00:00\",\"2022-08-03T00:00:00\",\"2022-08-02T00:00:00\",\"2022-08-01T00:00:00\",\"2022-07-29T00:00:00\",\"2022-07-28T00:00:00\",\"2022-07-27T00:00:00\",\"2022-07-26T00:00:00\",\"2022-07-25T00:00:00\",\"2022-07-22T00:00:00\",\"2022-07-21T00:00:00\",\"2022-07-20T00:00:00\",\"2022-07-19T00:00:00\",\"2022-07-18T00:00:00\",\"2022-07-15T00:00:00\",\"2022-07-14T00:00:00\",\"2022-07-13T00:00:00\",\"2022-07-12T00:00:00\",\"2022-07-11T00:00:00\",\"2022-07-08T00:00:00\",\"2022-07-07T00:00:00\",\"2022-07-06T00:00:00\",\"2022-07-05T00:00:00\",\"2022-07-01T00:00:00\",\"2022-06-30T00:00:00\",\"2022-06-29T00:00:00\",\"2022-06-28T00:00:00\",\"2022-06-27T00:00:00\",\"2022-06-24T00:00:00\",\"2022-06-23T00:00:00\"],\"y\":[142.44,141.48333333333332,140.4416666666667,140.0686,139.37526666666668,138.75068333333334,138.13393333333335,137.75449583333335,137.60599583333337,137.60406977272729,137.50429649999998,137.1949122674825,136.70098604270729,135.93231947344321,134.99169769314017,133.75585554908935,132.17673086057525,129.98745875948921,127.5494185521527,125.05774326400334,122.81235721358317,120.76115126480977,118.89305756493506,117.3249336038961,116.19318379870128,115.67739088744588,116.04344454329002,117.2001699264069,118.64753951298698,119.7901762121212,120.52903427922078,121.08887527164502,121.55761986471859,122.00314103896105,122.37381853896102,122.69763596320347,123.12940754978356,123.72158474458874,124.45858735930736,125.32920579545453,126.03544538961039,126.59086942640695,127.13881586580086,127.68888305194803,128.44834976406923,129.09511099891773,129.43736337229439,129.4602973744589,129.25435783116882,129.13741862445886,129.11580108225104,129.17231740692637,129.33062751190477,129.5448207142857,129.99245826190477,130.76304726839825,131.73165200216448,132.859927478355,134.1030519935065,135.4888247056277,136.84829661255412,137.92527247619051,138.52140337878788,138.4985240649351,137.97094752489178,137.08205822619047,135.88203893939394,134.43250229437228,133.23430304329003,132.23049983008656,131.47491880952379,131.00927984415583,130.73663998809525,130.62498635497838,130.48253144805193,130.2093407142857,129.81122455627707,129.33700429653678,128.8660590367965,128.33422296103896,127.81711088636364,127.59018216017316,127.71207524242428,128.99538493722943,131.09036650974025,133.24954217316017,135.23460286796535,137.09726375541126,138.8693737554113,140.45477047835502,141.65780879004328,142.19627762662336,142.18887555627703,142.0397260930736,141.86081869480523,141.84671282034634,142.01608713636364,142.25423732792208,142.30108402597403,141.87937263203463],\"marker\":{},\"line\":{\"color\":\"red\",\"width\":3.0}},{\"type\":\"scatter\",\"name\":\"HEMA_Series\",\"mode\":\"lines\",\"x\":[\"2022-11-11T00:00:00\",\"2022-11-10T00:00:00\",\"2022-11-09T00:00:00\",\"2022-11-08T00:00:00\",\"2022-11-07T00:00:00\",\"2022-11-04T00:00:00\",\"2022-11-03T00:00:00\",\"2022-11-02T00:00:00\",\"2022-11-01T00:00:00\",\"2022-10-31T00:00:00\",\"2022-10-28T00:00:00\",\"2022-10-27T00:00:00\",\"2022-10-26T00:00:00\",\"2022-10-25T00:00:00\",\"2022-10-24T00:00:00\",\"2022-10-21T00:00:00\",\"2022-10-20T00:00:00\",\"2022-10-19T00:00:00\",\"2022-10-18T00:00:00\",\"2022-10-17T00:00:00\",\"2022-10-14T00:00:00\",\"2022-10-13T00:00:00\",\"2022-10-12T00:00:00\",\"2022-10-11T00:00:00\",\"2022-10-10T00:00:00\",\"2022-10-07T00:00:00\",\"2022-10-06T00:00:00\",\"2022-10-05T00:00:00\",\"2022-10-04T00:00:00\",\"2022-10-03T00:00:00\",\"2022-09-30T00:00:00\",\"2022-09-29T00:00:00\",\"2022-09-28T00:00:00\",\"2022-09-27T00:00:00\",\"2022-09-26T00:00:00\",\"2022-09-23T00:00:00\",\"2022-09-22T00:00:00\",\"2022-09-21T00:00:00\",\"2022-09-20T00:00:00\",\"2022-09-19T00:00:00\",\"2022-09-16T00:00:00\",\"2022-09-15T00:00:00\",\"2022-09-14T00:00:00\",\"2022-09-13T00:00:00\",\"2022-09-12T00:00:00\",\"2022-09-09T00:00:00\",\"2022-09-08T00:00:00\",\"2022-09-07T00:00:00\",\"2022-09-06T00:00:00\",\"2022-09-02T00:00:00\",\"2022-09-01T00:00:00\",\"2022-08-31T00:00:00\",\"2022-08-30T00:00:00\",\"2022-08-29T00:00:00\",\"2022-08-26T00:00:00\",\"2022-08-25T00:00:00\",\"2022-08-24T00:00:00\",\"2022-08-23T00:00:00\",\"2022-08-22T00:00:00\",\"2022-08-19T00:00:00\",\"2022-08-18T00:00:00\",\"2022-08-17T00:00:00\",\"2022-08-16T00:00:00\",\"2022-08-15T00:00:00\",\"2022-08-12T00:00:00\",\"2022-08-11T00:00:00\",\"2022-08-10T00:00:00\",\"2022-08-09T00:00:00\",\"2022-08-08T00:00:00\",\"2022-08-05T00:00:00\",\"2022-08-04T00:00:00\",\"2022-08-03T00:00:00\",\"2022-08-02T00:00:00\",\"2022-08-01T00:00:00\",\"2022-07-29T00:00:00\",\"2022-07-28T00:00:00\",\"2022-07-27T00:00:00\",\"2022-07-26T00:00:00\",\"2022-07-25T00:00:00\",\"2022-07-22T00:00:00\",\"2022-07-21T00:00:00\",\"2022-07-20T00:00:00\",\"2022-07-19T00:00:00\",\"2022-07-18T00:00:00\",\"2022-07-15T00:00:00\",\"2022-07-14T00:00:00\",\"2022-07-13T00:00:00\",\"2022-07-12T00:00:00\",\"2022-07-11T00:00:00\",\"2022-07-08T00:00:00\",\"2022-07-07T00:00:00\",\"2022-07-06T00:00:00\",\"2022-07-05T00:00:00\",\"2022-07-01T00:00:00\",\"2022-06-30T00:00:00\",\"2022-06-29T00:00:00\",\"2022-06-28T00:00:00\",\"2022-06-27T00:00:00\",\"2022-06-24T00:00:00\",\"2022-06-23T00:00:00\"],\"y\":[142.44,141.9802327150497,140.88834828536312,140.13737242387145,139.19117824527356,138.0724020480412,136.87297096608944,136.40042877119754,136.3151245299052,136.40732190885552,136.38119950473984,135.95872194663457,135.26961827198537,134.1875733471162,132.99155805791548,131.44385966167982,129.60895638891606,127.03972236971279,124.6936390200512,122.64069342113567,120.90215949356144,119.16037145668467,117.54535564741158,116.29438163183701,115.61421073494711,115.6261552309493,116.70618366219253,118.44235059347793,119.94049030379338,120.44363137731341,120.40513304074398,120.4618547383903,120.60478122125456,120.87549340136039,121.21511752036555,121.73233058337922,122.61582871129843,123.69186839218997,124.72723194054741,125.7268541222864,126.24448584118878,126.60322453216787,127.13918648460574,127.75020426199652,128.74528915054952,129.37520610690092,129.48604277556498,129.24092535327247,128.89926002621166,128.93464819080964,129.0796447913216,129.29193343818864,129.6665180419248,130.08818194003987,130.85834655406615,131.94928502493437,133.03370722133837,134.1650364244237,135.4061297045912,136.8671905531789,138.12424031103714,138.8118185376241,138.81608942012627,138.11558943260215,137.08936055531785,135.94288971632974,134.61097003374485,133.14250520209646,132.48519824530013,132.05213206980517,131.7594505510084,131.64040899870207,131.55797276950497,131.4504147389182,131.05998576411722,130.40611267270106,129.64430808310019,128.9312453378937,128.40465051352342,127.79852355938893,127.3049046600857,127.42242618917359,127.98851140078243,130.44438731348512,133.41731595435618,135.52612291163888,136.99999334223733,138.50845246364975,139.9436158154234,141.01920153743322,141.61591804397108,141.49402135273215,141.10863727141907,141.19944588887316,141.39985266386608,141.79515772483484,142.37789400752854,142.94424857356267,142.95626325037574,142.0870075175408],\"marker\":{},\"line\":{\"color\":\"blue\",\"width\":2.0}}];\r\n",
" var layout = {\"width\":1200,\"height\":600,\"template\":{\"layout\":{\"title\":{\"x\":0.05},\"font\":{\"color\":\"rgba(42, 63, 95, 1.0)\"},\"paper_bgcolor\":\"rgba(255, 255, 255, 1.0)\",\"plot_bgcolor\":\"rgba(229, 236, 246, 1.0)\",\"autotypenumbers\":\"strict\",\"colorscale\":{\"diverging\":[[0.0,\"#8e0152\"],[0.1,\"#c51b7d\"],[0.2,\"#de77ae\"],[0.3,\"#f1b6da\"],[0.4,\"#fde0ef\"],[0.5,\"#f7f7f7\"],[0.6,\"#e6f5d0\"],[0.7,\"#b8e186\"],[0.8,\"#7fbc41\"],[0.9,\"#4d9221\"],[1.0,\"#276419\"]],\"sequential\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"sequentialminus\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]},\"hovermode\":\"closest\",\"hoverlabel\":{\"align\":\"left\"},\"coloraxis\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}},\"geo\":{\"showland\":true,\"landcolor\":\"rgba(229, 236, 246, 1.0)\",\"showlakes\":true,\"lakecolor\":\"rgba(255, 255, 255, 1.0)\",\"subunitcolor\":\"rgba(255, 255, 255, 1.0)\",\"bgcolor\":\"rgba(255, 255, 255, 1.0)\"},\"mapbox\":{\"style\":\"light\"},\"polar\":{\"bgcolor\":\"rgba(229, 236, 246, 1.0)\",\"radialaxis\":{\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"ticks\":\"\"},\"angularaxis\":{\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"ticks\":\"\"}},\"scene\":{\"xaxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"gridwidth\":2.0,\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"backgroundcolor\":\"rgba(229, 236, 246, 1.0)\",\"showbackground\":true},\"yaxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"gridwidth\":2.0,\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"backgroundcolor\":\"rgba(229, 236, 246, 1.0)\",\"showbackground\":true},\"zaxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"gridwidth\":2.0,\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"backgroundcolor\":\"rgba(229, 236, 246, 1.0)\",\"showbackground\":true}},\"ternary\":{\"aaxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\"},\"baxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\"},\"caxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\"},\"bgcolor\":\"rgba(229, 236, 246, 1.0)\"},\"xaxis\":{\"title\":{\"standoff\":15},\"ticks\":\"\",\"automargin\":true,\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"zerolinewidth\":2.0},\"yaxis\":{\"title\":{\"standoff\":15},\"ticks\":\"\",\"automargin\":true,\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"zerolinewidth\":2.0},\"annotationdefaults\":{\"arrowcolor\":\"#2a3f5f\",\"arrowhead\":0,\"arrowwidth\":1},\"shapedefaults\":{\"line\":{\"color\":\"rgba(42, 63, 95, 1.0)\"}},\"colorway\":[\"rgba(99, 110, 250, 1.0)\",\"rgba(239, 85, 59, 1.0)\",\"rgba(0, 204, 150, 1.0)\",\"rgba(171, 99, 250, 1.0)\",\"rgba(255, 161, 90, 1.0)\",\"rgba(25, 211, 243, 1.0)\",\"rgba(255, 102, 146, 1.0)\",\"rgba(182, 232, 128, 1.0)\",\"rgba(255, 151, 255, 1.0)\",\"rgba(254, 203, 82, 1.0)\"]},\"data\":{\"bar\":[{\"marker\":{\"line\":{\"color\":\"rgba(229, 236, 246, 1.0)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"error_x\":{\"color\":\"rgba(42, 63, 95, 1.0)\"},\"error_y\":{\"color\":\"rgba(42, 63, 95, 1.0)\"}}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"rgba(229, 236, 246, 1.0)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}}}],\"carpet\":[{\"aaxis\":{\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"endlinecolor\":\"rgba(42, 63, 95, 1.0)\",\"minorgridcolor\":\"rgba(255, 255, 255, 1.0)\",\"startlinecolor\":\"rgba(42, 63, 95, 1.0)\"},\"baxis\":{\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"endlinecolor\":\"rgba(42, 63, 95, 1.0)\",\"minorgridcolor\":\"rgba(255, 255, 255, 1.0)\",\"startlinecolor\":\"rgba(42, 63, 95, 1.0)\"}}],\"choropleth\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"contour\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"contourcarpet\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}],\"heatmap\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"heatmapgl\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}}}],\"histogram2d\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"histogram2dcontour\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"mesh3d\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}],\"parcoords\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"pie\":[{\"automargin\":true}],\"scatter\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scatter3d\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}},\"line\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scattercarpet\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scattergeo\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scattergl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scattermapbox\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scatterpolar\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scatterpolargl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scatterternary\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"surface\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"table\":[{\"cells\":{\"fill\":{\"color\":\"rgba(235, 240, 248, 1.0)\"},\"line\":{\"color\":\"rgba(255, 255, 255, 1.0)\"}},\"header\":{\"fill\":{\"color\":\"rgba(200, 212, 227, 1.0)\"},\"line\":{\"color\":\"rgba(255, 255, 255, 1.0)\"}}}]}},\"margin\":{\"l\":30,\"r\":10,\"t\":40,\"b\":30,\"pad\":1,\"autoexpand\":false},\"xaxis\":{\"rangeslider\":{\"visible\":false,\"yaxis\":{}},\"gridcolor\":\"#252525\"},\"yaxis\":{\"gridcolor\":\"#252525\"},\"title\":{\"text\":\"IBM\"},\"font\":{\"size\":10.0,\"color\":\"#ffffff\"},\"paper_bgcolor\":\"#1e1e1e\",\"plot_bgcolor\":\"#1e1e1e\"};\r\n",
" var config = {\"responsive\":true};\r\n",
" Plotly.newPlot('9d18e089-f1c1-4acd-8009-21b4458a77d6', data, layout, config);\r\n",
"});\r\n",
" };\r\n",
" if ((typeof(requirejs) !== typeof(Function)) || (typeof(requirejs.config) !== typeof(Function))) {\r\n",
" var script = document.createElement(\"script\");\r\n",
" script.setAttribute(\"src\", \"https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js\");\r\n",
" script.onload = function(){\r\n",
" renderPlotly_9d18e089f1c14acd800921b4458a77d6();\r\n",
" };\r\n",
" document.getElementsByTagName(\"head\")[0].appendChild(script);\r\n",
" }\r\n",
" else {\r\n",
" renderPlotly_9d18e089f1c14acd800921b4458a77d6();\r\n",
" }\r\n",
"</script>\r\n",
"\n",
" \n",
"</div> \n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"var layout = Layout.init<IConvertible>( \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<IConvertible, IConvertible, IConvertible, IConvertible, IConvertible, IConvertible>(\n",
" GridColor:Color.fromString(\"#252525\")); \n",
"\n",
"var candles = Chart2D.Chart.Candlestick<double, double, double, double, DateTime, string>(data.Open.v, data.High.v, data.Low.v, data.Close.v, data.Open.t, \"\");\n",
"var line1 = Chart2D.Chart.Line<DateTime,double,bool>(calc1.t, calc1.v, false, calc1.GetType().Name).WithLineStyle(Width: 2, Color: Color.fromString(\"yellow\"));\n",
"var line2 = Chart2D.Chart.Line<DateTime,double,bool>(calc2.t, calc2.v, false, calc2.GetType().Name).WithLineStyle(Width: 3, Color: Color.fromString(\"red\"));\n",
"var line3 = Chart2D.Chart.Line<DateTime,double,bool>(calc3.t, calc3.v, false, calc3.GetType().Name).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<int, int, int, int, int, bool>(30,10,40,30,1,false))\n",
" .WithXAxisRangeSlider(RangeSlider.init(Visible:false))\n",
" .WithYAxis(yAxis)\n",
" .WithXAxis(yAxis)\n",
" .WithTitle(Sym)\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
}