Code Monkey home page Code Monkey logo

tradingview-udf's Introduction

TradingView-UDF

What

This is a TradingView charting library UDF implemented in PHP.

Why

I couldn't find one and so I made one. So, here you go.

License

You may use freely but I chose the GPL3 license which means if you modify this code, you need to share those modifications via a fork. Please do that. Use it in commercial applications if you want, just please maintain a fork repo of your UDF.

How-To

This UDF assumes that you're installing it under an /api/ subdirectory on an Apache, Litespeed, or OpenLitespeed server. It will work on NGINX as well but you'll have to create your own rewrites in that case. A proper .htaccess file is in the root of the repo.

This UDF currently aims to act as a proxy between crypto exchanges and the TradingView charting library. This is accomplished using the CCXT library.

Issues & pull requests are welcomed.

tradingview-udf's People

Contributors

guifabrin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tradingview-udf's Issues

Symbol resolve failed all the time...

I started with "https://github.com/shaqarava/TradingView-UDF" as my base because I need the UDF to be in PHP. I always get "Symbol resolve failed:

"COINBASEPRO:BTC/USD, reason: invalid symbol" message and no chart. I have no idea what I am doing wrong at this point.

My web page can be reached at "http://94.237.73.33/chart-example.html" and the code is as follows:

<title>PHP TradingView UDF Example</title> <script type="text/javascript" src="chart/charting_library/charting_library.min.js"></script> <script type="text/javascript" src="chart/datafeeds/udf/dist/polyfills.js"></script> <script type="text/javascript" src="chart/datafeeds/udf/dist/bundle.js"></script> <script type="text/javascript">

function getParameterByName(name) {
name = name.replace(/[[]/, "\[").replace(/[]]/, "\]");
var regex = new RegExp("[\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/+/g, " "));
}

function initOnReady() {
var widget = window.tvWidget = new TradingView.widget({
fullscreen: true,
symbol: 'BTC/USD',
interval: 'D',
container_id: "tv_chart_container",
debug: true,
datafeed: new Datafeeds.UDFCompatibleDatafeed("http://94.237.73.33/api"),
library_path: "chart/charting_library/",
locale: getParameterByName('lang') || "en",
disabled_features: ["header_saveload","use_localstorage_for_settings"],
enabled_features: [],
charts_storage_url:"",
charts_storage_api_version: "1.1",
client_id: '',
user_id: '',
theme: getParameterByName('theme'),
});
};

window.addEventListener('DOMContentLoaded', initOnReady, false);
</script>

*** Console logs
Symbol resolve requested: BTC/USD library.4876b44fcf466b634068.js:186:2100
Event "panes_order_changed", arguments: [] library.4876b44fcf466b634068.js:568:283
Symbol resolve failed: BTC/USD, reason: invalid symbol library.4876b44fcf466b634068.js:186:2100
Event "series_properties_changed", arguments: ["lQwFlf"] library.4876b44fcf466b634068.js:568:283```

Symbol

BTC/USD on COINBASEPRO exchange

Any help is greatly appreciated.

add sample

Hello,

Request URL Can you add more examples and documents?

I send you mail.

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.