louisnw01 / lightweight-charts-python

Python framework for TradingView's Lightweight Charts JavaScript library.
MIT License
1.1k stars 203 forks source link

Creation of a code sample of a Simple 20 Moving average that updates with live price data connecting to TWS at Interactive Brokers #294

Closed quantismo closed 7 months ago

quantismo commented 7 months ago

Description

I seen a code sample where I believe CSV files were used with static data to render a moving average but not live data. I been trying trying to create a new JavaScript Subclass wrapped with python that can be called to render a simple 20 MA but I am newbie to JS code and not the best at python and c#. So far I only have code that shows a nice candlestick chart with live data connected to TWS but thats all I can get it to do so far lol. I have a library of very complicated strategies written in c# full of custom indicator and money managment code I eventually want to run on TV but at this point it looks like an impossible lift. I may have to just stick with Matlib. But if someone want to make a code sample descibed in the title it my inspire me to dig in here more and develop stuff.

Code example

No response

Method of implementation

No response

louisnw01 commented 7 months ago

Hey @quantismo,

Part time Larry made a great video about using the library with IB; it's slightly outdated, but you should be able to do this by adapting his code.

Lines are just the same as candlesticks, except you use line.update rather than chart.update_from_tick.

Also, you should not need any JS to achieve this; that's what this library is for!

Louis

quantismo commented 7 months ago

Thanks for your work on the chart project! I love its functionality and visual quality. I did however manage to get a live updating SMA installed into lightweight charts the next day after I requested someone make one. I have decidedthough, lightweight charts is going to slow me down to much because I am developing very complicated machine learning and money management strategies in python and hassling with the Javascript part of lightweight charts would slow me down. I did look at converting the Javascript part to python untill i saw how massive the main JS file was that configured the chart.  For now i will just be using one of the less qualitative charts written only in python. Good luck I with your project! Wayne aka quantismo

On Tuesday, February 20, 2024 at 12:15:43 PM EST, louisnw01 ***@***.***> wrote:  

Hey @quantismo,

Part time Larry made a great video about using the library with IB; it's slightly outdated, but you should be able to do this by adapting his code.

Lines are just the same as candlesticks, except you use line.update rather than chart.update_from_tick.

Also, you should not need any JS to achieve this; that's what this library is for!

Louis

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>