XPlot


Plotly Candlestick Chart

Binder

open XPlot.Plotly
open System

let data =
    [
         // x,  o,  h,  l,  c
        "Mon", 28, 45, 20, 38
        "Tue", 38, 66, 31, 55
        "Wed", 55, 80, 50, 77
        "Thu", 77, 77, 50, 66
        "Fri", 66, 68, 15, 22
    ]

let chart1 = Chart.Candlestick data
let ``XAU USD D1`` =
    [
                 // x,       o,       h,       l,       c
        DateTime(2017, 12, 27), 1282.19, 1289.01, 1281.43, 1287.67
        DateTime(2017, 12, 26), 1278.35, 1283.80, 1277.22, 1282.18
        DateTime(2017, 12, 22), 1267.07, 1276.08, 1265.07, 1274.97
        DateTime(2017, 12, 21), 1266.53, 1268.99, 1263.20, 1267.05
        DateTime(2017, 12, 20), 1261.80, 1267.92, 1261.53, 1266.55
        DateTime(2017, 12, 19), 1261.54, 1265.32, 1259.34, 1261.78
        DateTime(2017, 12, 18), 1253.91, 1263.99, 1252.85, 1261.51
        DateTime(2017, 12, 15), 1253.62, 1261.88, 1253.18, 1255.20
        DateTime(2017, 12, 14), 1254.05, 1259.14, 1250.58, 1253.62
        DateTime(2017, 12, 13), 1243.58, 1256.93, 1240.36, 1254.09
        DateTime(2017, 12, 12), 1242.90, 1246.29, 1236.59, 1243.48
        DateTime(2017, 12, 11), 1248.63, 1251.59, 1240.89, 1242.91
        DateTime(2017, 12, 08), 1247.15, 1252.41, 1244.18, 1248.56
        DateTime(2017, 12, 07), 1264.03, 1264.17, 1244.06, 1247.16
        DateTime(2017, 12, 06), 1266.32, 1269.25, 1262.63, 1264.14
        DateTime(2017, 12, 05), 1276.61, 1277.06, 1261.11, 1266.24
        DateTime(2017, 12, 04), 1273.93, 1277.17, 1271.41, 1276.61
        DateTime(2017, 12, 01), 1275.00, 1289.24, 1271.72, 1280.40
        DateTime(2017, 11, 30), 1284.15, 1285.36, 1270.43, 1275.03
        DateTime(2017, 11, 29), 1294.07, 1296.75, 1282.18, 1284.16
        DateTime(2017, 11, 28), 1294.59, 1297.48, 1290.95, 1294.06
        DateTime(2017, 11, 27), 1287.47, 1299.29, 1286.80, 1294.56
    ]

let chart2 =
    ``XAU USD D1``
    |> Seq.sortBy (fun (x,_,_,_,_) -> x)
    |> Chart.Candlestick
namespace XPlot
namespace XPlot.Plotly
namespace System
val data : (string * int * int * int * int) list
val chart1 : PlotlyChart
type Chart =
  static member Area : data:seq<#value> -> PlotlyChart + 2 overloads
  static member Bar : data:seq<#value> -> PlotlyChart + 2 overloads
  static member Bubble : data:seq<#key * #value * #value> -> PlotlyChart
  static member Candlestick : data:seq<#key * #value * #value * #value * #value> -> PlotlyChart
  static member Column : data:seq<#value> -> PlotlyChart + 2 overloads
  static member Line : data:seq<#value> -> PlotlyChart + 2 overloads
  static member Pie : data:seq<#key * #value> -> PlotlyChart
  static member Plot : data:Trace -> PlotlyChart + 3 overloads
  static member Scatter : data:seq<#value> -> PlotlyChart + 2 overloads
  static member Show : chart:PlotlyChart -> unit
  ...
static member Chart.Candlestick : data:seq<#key * #value * #value * #value * #value> -> PlotlyChart
member PlotlyChart.GetHtml : unit -> string
val ( XAU USD D1 ) : (DateTime * float * float * float * float) list
Multiple items
[<Struct>]
type DateTime =
  new : year: int * month: int * day: int -> unit + 10 overloads
  member Add : value: TimeSpan -> DateTime
  member AddDays : value: float -> DateTime
  member AddHours : value: float -> DateTime
  member AddMilliseconds : value: float -> DateTime
  member AddMinutes : value: float -> DateTime
  member AddMonths : months: int -> DateTime
  member AddSeconds : value: float -> DateTime
  member AddTicks : value: int64 -> DateTime
  member AddYears : value: int -> DateTime
  ...

--------------------
DateTime ()
   (+0 other overloads)
DateTime(ticks: int64) : DateTime
   (+0 other overloads)
DateTime(ticks: int64, kind: DateTimeKind) : DateTime
   (+0 other overloads)
DateTime(year: int, month: int, day: int) : DateTime
   (+0 other overloads)
DateTime(year: int, month: int, day: int, calendar: Globalization.Calendar) : DateTime
   (+0 other overloads)
DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int) : DateTime
   (+0 other overloads)
DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, kind: DateTimeKind) : DateTime
   (+0 other overloads)
DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, calendar: Globalization.Calendar) : DateTime
   (+0 other overloads)
DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, millisecond: int) : DateTime
   (+0 other overloads)
DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, millisecond: int, kind: DateTimeKind) : DateTime
   (+0 other overloads)
val chart2 : PlotlyChart
module Seq

from Microsoft.FSharp.Collections
val sortBy : projection:('T -> 'Key) -> source:seq<'T> -> seq<'T> (requires comparison)
val x : DateTime