Skip to content

Marfusios/tradingview-udf-provider

Repository files navigation

Logo

TradingView UDF provider

build NuGet version NuGet downloads

This is a C# implementation of the TradingView UDF data provider (via HTTP API). It's a backend server application that provides data for standalone charting library.

Info: https://www.tradingview.com/HTML5-stock-forex-bitcoin-charting-library/?feature=technical-analysis-charts

Docs: https://github.com/tradingview/charting_library/wiki/UDF

Releases and breaking changes

License:

MIT

Features

  • installation via NuGet (TradingView.Udf.Provider)
  • automatically integrates into ASP.NET Core
  • targeting .NET Standard 2.0 (.NET Core, Linux/MacOS compatible)

Usage

  1. Create a new ASP.NET Core solution
  2. Reference nuget TradingView.Udf.Provider
  3. In Startup.cs call:
public void ConfigureServices(IServiceCollection services)
{
    // setup default JSON serializer to ignore null values
    // important!
    services.AddControllers()
            .AddJsonOptions(opts =>
            {
                opts.JsonSerializerOptions.IgnoreNullValues = true;
            });

    ...

    // register TradingView provider with your custom data class
    services.AddTradingViewProvider<MyTvProvider>();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    ...
    // optional TradingView provider settings
    app.UseTradingViewProvider(new TradingViewSettings());
}
  1. Create a new class MyTvProvider that implements interface ITradingViewProvider link
  2. Everything ready, you can now connect TradingView chart library with this backend server, example: index.html

Full usage example link

API coverage

UDF Implemented
GET /config
GET /symbol_info?group
GET /symbols?symbol
GET /search
GET /history
GET /marks
GET /timescale_marks
GET /time
GET /quotes

Screens

TradingView

Swagger

Pull Requests are welcome!

Available for help

I do consulting, please don't hesitate to contact me if you have a custom solution you would like me to implement (web, [email protected])

Donations gratefully accepted.

  • Donate with Bitcoin
  • Donate with Litecoin
  • Donate with Ethereum