Script to cycle through charts

Discussion in 'App Development' started by qlai, Jan 15, 2019.

  1. qlai

    qlai

    Hello, I would like to write(use) a script which reads(gets) a list of symbols and uses some free charting api to display intra-day chart for a couple of seconds each ... cycling through them in a loop. If it's some JavaScrip running within browser, it's even better. Anyone seen anything similar?

    I apologize in advance for being lazy and not yet searching for solution myself ... I promise if I get this done, I will share such script (assuming it doesn't get crazy complicated).

    Thanks
     
  2. Peter8519

    Peter8519

    It would a lot easier to get paid intraday data and use any charting software to display the intraday charts.
     
  3. ZBZB

    ZBZB

    Use a macro recorder to run on an existing application?
     
    tommcginnis likes this.
  4. qlai

    qlai

    @MotiveWave, don't you think it would be cool feature to be able to create a chart slideshow out of watch list? So instead of my old vacation photos, I look at charts! :) I am not aware of such functionality anywhere.
     
  5. qlai

    qlai

    Well, I have something primitive here. Unfortunately, it's based on delayed data, but if you don't mind (or care about EOD data) it's a start. Save the below as file with .html extension and open with browser (I used chrome). My first JavaScript program, so be gentle. Enjoy the show!


    <!-- =================================
    Simple Chart Slide Show v1.0 by qlai
    ================================= //-->
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8" />
    <title>Chart Cycler</title>
    <link rel="stylesheet" type="text/css" media="screen" href="main.css" />
    </head>

    <script type="text/javascript">

    function showChart( Symbol ) {

    new TradingView.widget(
    {
    "width": 980,
    "height": 610,
    "symbol": Symbol,
    "interval": "5",
    "timezone": "America/New_York",
    "theme": "Light",
    "style": "1",
    "locale": "en",
    "toolbar_bg": "#f1f3f6",
    "enable_publishing": false,
    "allow_symbol_change": false,
    "container_id": "tradingview"
    }
    );
    }
    </script>


    <script>

    function DisplayPage()
    {

    showChart(SymbolList[Idx]);

    Idx++;

    if(Idx > NumSymbols)
    {
    Idx = 0;
    }
    }
    </script>

    <body>


    <script>


    var SymbolList= [
    "NASDAQ:AAPL",
    "NASDAQ:AABA",
    "NASDAQ:MSFT",
    "NASDAQ:pYPL",
    "NASDAQ:FB",
    "NYSE:SQ",
    "NASDAQ:GOOGL",
    "NASDAQ:AMZN",
    "NASDAQ:TWTR",
    "AMEX:SPY",
    "NYSE:IBM",
    "NYSE:JPM"

    ];



    var Idx = 0;
    var NumSymbols = SymbolList.length-1;
    var DisplayTime = 3 * 1000;

    setInterval(DisplayPage, DisplayTime);


    </script>


    <!-- TradingView Widget BEGIN -->
    <div class="tradingview-widget-container">
    <div id="tradingview"></div>
    <div class="tradingview-widget-copyright"><a href="https://www.tradingview.com/symbols/NYSE-IBM/" rel="noopener" target="_blank"><span class="blue-text">Chart</span></a> by TradingView</div>
    <script type="text/javascript" src="https://s3.tradingview.com/tv.js"></script>

    <script type="text/javascript">

    </script>
    </div>
    <!-- TradingView Widget END -->

    </body>

    </html>
     
  6. Peter8519

    Peter8519

    Alternatively, your stock broker e.g. InteractiveBroker may provide API or plug-in for your charting software. But most brokers will impose limit on the number of tickers that can be downloaded. I download EOD data from Yahoo Finance and view the chart on Amibroker. It takes no more that 30 minutes include manually recording tickers of interest for about 5000 tickers in my database. I will look at those tickers that I have jotted on IB TWS. Of course, I can use Amibroker script to do the screening instead of manually viewing the charts. But that would deprive me of having a "feel" of the market direction.
     
  7. tsznecki

    tsznecki

    @qlai If you ask on stackoverflow nicely someone could write up what you need.
     
  8. qlai

    qlai

    I'm not looking for someone to code it, but for someone to suggest a charting API with real-time charts (or a couple of minutes delayed shapshots). It's cute to have this, but not worth paying just for that.

    When I used to look for swing trading candidates, I would use FinViz to do scans and then I would need to hover over each symbol with the mouse for it to display the chart(sometimes it would take a second or two to load). On some evenings, I would look through hundreds of charts. With ToS, it's even worse - I would need to click on it to display.
    It would be great if I could just get on stationary bike, turn on the slide show and just watch charts scroll by.
     
  9. ZBZB

    ZBZB