Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save/Load Layout Charts in PostgresQL #3

Open
apligraf opened this issue Dec 16, 2016 · 9 comments
Open

Save/Load Layout Charts in PostgresQL #3

apligraf opened this issue Dec 16, 2016 · 9 comments

Comments

@apligraf
Copy link

I would like to know how to save / read the layouts on my server
I have postgres installed I would like to know how to use
["Use_localstorage_for_settings"],
Charts_storage_url
Client_id
User_id

I followed the tutorial that imports the tables into my empty database

03 tables have been created, django_migrations
Model_chart
Model_studytemplate

I could not evolve

Somebody help me, please

@ezhukovskiy
Copy link
Member

Hi,
Use_localstorage_for_settings - it is not about charts, but about saving properties to LocalStorage
charts_storage_url - url to your save/load server
client_id - choose unique id for your company
user_id - every user should have different id, you can use username here

@apligraf
Copy link
Author

Is there no official documentation on this implementation?

Charts_storage_url - url to your save / load server
I already configured it

Client_id - choose unique id for your company
Which table to put this in?

User_id - every user should have different id, you can use username here
Which table to put this in?

Do I have to clone your repository?

What kind of structure to use? How to connect to the Bank?

These questions that I am not understanding

My Platform
Ubuntu 14 + Apache Webserver + Postgres

Your requirements are Django + Python that left me a bit confused

And what files are available for download? Where do I put it? Inside my webserver?

Thank you

@ezhukovskiy
Copy link
Member

if you do these steps you'll get your save/load server configured and ran:

https://github.com/tradingview/saveload_backend/blob/master/README.md

Regarding your questions.
If you follow the steps from above you won't need to think about the structure of the tables. They will be created automatically.
If you want to build your own server it is up to you what tables you will use.

@apligraf
Copy link
Author

Understood.
I was able to import the tables into a postgres database. But I still can not understand what I need to modify

I have the tables

image

Now I need to know what to change so I can save the profile using the buttons

image

My code

TradingView.onready(function()
{
var widget = new TradingView.widget({
fullscreen: true,
symbol: '',
interval: "",
container_id: "tv_chart_container",
// BEWARE: no trailing slash is expected in feed URL
//datafeed: new Datafeeds.UDFCompatibleDatafeed("http://demo_feed.tradingview.com"),
datafeed: new Datafeeds.UDFCompatibleDatafeed("http://200.98.162.184"),
library_path: "/mobile_tv4/charting_library/",
locale: getParameterByName('lang') || "pt",
// Regression Trend-related functionality is not implemented yet, so it's hidden for a while
drawings_access: { type: 'black', tools: [ { name: "Regression Trend" } ] },
disable_features: ["use_localstorage_for_settings"],
enabled_features: ["study_templates"],
charts_storage_url: 'http://saveload.tradingview.com',
charts_storage_api_version: "1.1",
client_id: '',
user_id: ''
});
});

Preciso mudar
charts_storage_url: 'http://saveload.tradingview.com',
charts_storage_api_version: "1.1",
client_id: '',
user_id: ''

to ?????

@ezhukovskiy
Copy link
Member

charts_storage_url: YOUR BACKEND URL
charts_storage_api_version: "1.1",
client_id: YOUR COMPANY NAME
user_id: USER_NAME (it should be set to separate charts between users. otherwise all of them will have the same list of charts)

@gunaycakmak
Copy link

There is no document describing step by step.
I have not figured out how to get my data.

@wattzor
Copy link

wattzor commented Oct 10, 2018

I have the same problem.
i set up the database as Readme.

But i get a server error like this when i try to save:

http://192.168.1.7:8001/1.1/charts?client=tradingview.com&user=public_user_id
Error response

Error code: 404

Message: File not found.

Error code explanation: HTTPStatus.NOT_FOUND - Nothing matches the given URI.

am i missing something?
Im not very familiar with Django, does anyone have an example in Flask?

@Santa2clause
Copy link

Santa2clause commented Mar 23, 2020

I have a problem with loading the saved template. Please can someone point me in the right direction:

The code

  1. Lists my saved charts
  2. Saves the template values to my local database.

But when I click on load template it shows me the saved templates but when I click on them it does nothing.

Not working:

  1. Load Chart
  2. Delete Chart

enabled_features: ["study_templates"],
charts_storage_url: 'Local Storage Url',
charts_storage_api_version: "1.1",
client_id: 'My Company Name',
user_id: 'USER ID',

@Ezriral

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants