Julia Program To Read Stock / Share Market Data




 Julia is a  Open Source.Julia is free for everyone to use..Julia is a high-level general-purpose dynamic programming language that is designed to address the needs of high-performance numerical analysis and computational science, without the need of separate compilation to be fast.


Julia is used in


  • Machine Learning
  • Data Science
  • Visualisation
  • General Purpose
  • Parallel Computing
  • Scientific Domains

Hi Today i am  excited and thought to check if i can read the share market data , so i am going to

demonstrate how to read stock data from Julia program. To do this  there are few things we need to

do , so i will navigate to share market website  https://www.nseindia.com and try to select one of the

sample stock, that is i am going to select "State Bank Of India" its code is SBIN , and after the data

opens up i will go to historical data of the share or stock market. Here there is  a download option . I

will try to download the data of 3 months old ,  i will try to save the file as

"sbi-share-market-stock-price.csv".


The above file i need to save in a directory from where i can read. So i will try to check my  present

working directory, to do this we had seen in our previous tutorial , if you are not aware of it , try to

go  to main menu and check out this step. I am storing the "sbi-share-market-stock-price.csv" file

in the present working directory.

After doing this  or after saving the data  i will try to see if i can read this from Julia Lang Program

julia Program to read  stock share market data



using DataFrames

Here we are using a library DataFrames.  DataFrames package is available through the Julia package system.

readStockMarketData = readtable("sbi-share-market-stock-price.csv",separator=',')

The next line we are declaring a variable readStockMarketData and try to read the csv file with a

separator , we are using , as the separator here.

When we execute this program i can read the stock market data from the csv file and display on my

screen

Output:



> using DataFrames
       readStockMarketData = readtable("sbi-share-market-stock-price.csv",separator=',')
64×10 DataFrame. Omitted printing of 2 columns


Output :
│ Row │ Date        │ Symbol  │ Series  │ Open_Price │ High_Price │ Low_Price │ Last_Traded_Price │ Close_Price │
│     │ String⍰     │ String⍰ │ String⍰ │ Float64⍰   │ Float64⍰   │ Float64⍰  │ Float64⍰          │ Float64⍰    │
├─────┼─────────────┼─────────┼─────────┼────────────┼────────────┼───────────┼───────────────────┼─────────────┤
│ 1   │ 19-Feb-2019 │ SBIN    │ EQ      │ 260.9      │ 267.5      │ 260.3     │ 262.75            │ 262.9       │
│ 2   │ 18-Feb-2019 │ SBIN    │ EQ      │ 264.4      │ 265.5      │ 258.8     │ 259.5             │ 259.95      │
│ 3   │ 15-Feb-2019 │ SBIN    │ EQ      │ 268.85     │ 268.85     │ 261.3     │ 262.8             │ 262.95      │
│ 4   │ 14-Feb-2019 │ SBIN    │ EQ      │ 268.0      │ 268.35     │ 263.65    │ 267.5             │ 267.1       │
│ 5   │ 13-Feb-2019 │ SBIN    │ EQ      │ 276.5      │ 276.7      │ 266.7     │ 267.0             │ 268.2       │
│ 6   │ 12-Feb-2019 │ SBIN    │ EQ      │ 280.65     │ 282.2      │ 274.65    │ 275.1             │ 275.4       │
│ 7   │ 11-Feb-2019 │ SBIN    │ EQ      │ 285.95     │ 285.95     │ 280.0     │ 280.45            │ 280.5       │
│ 8   │ 08-Feb-2019 │ SBIN    │ EQ      │ 285.6      │ 288.0      │ 282.2     │ 286.55            │ 286.0       │
│ 9   │ 07-Feb-2019 │ SBIN    │ EQ      │ 289.4      │ 294.0      │ 286.6     │ 287.0             │ 287.4       │
│ 10  │ 06-Feb-2019 │ SBIN    │ EQ      │ 285.85     │ 289.75     │ 283.5     │ 289.45            │ 289.05      │

│ 54  │ 05-Dec-2018 │ SBIN    │ EQ      │ 282.45     │ 283.2      │ 277.05    │ 280.2             │ 280.15      │
│ 55  │ 04-Dec-2018 │ SBIN    │ EQ      │ 287.95     │ 287.95     │ 281.9     │ 282.6             │ 282.55      │
│ 56  │ 03-Dec-2018 │ SBIN    │ EQ      │ 286.7      │ 287.9      │ 283.25    │ 287.1             │ 286.8       │
│ 57  │ 30-Nov-2018 │ SBIN    │ EQ      │ 288.8      │ 290.9      │ 283.2     │ 284.05            │ 284.65      │
│ 58  │ 29-Nov-2018 │ SBIN    │ EQ      │ 289.3      │ 289.65     │ 284.25    │ 288.0             │ 286.4       │
│ 59  │ 28-Nov-2018 │ SBIN    │ EQ      │ 289.4      │ 292.45     │ 283.0     │ 284.0             │ 284.55      │
│ 60  │ 27-Nov-2018 │ SBIN    │ EQ      │ 284.6      │ 290.5      │ 284.05    │ 289.0             │ 289.4       │
│ 61  │ 26-Nov-2018 │ SBIN    │ EQ      │ 284.1      │ 287.25     │ 279.6     │ 286.5             │ 286.4       │
│ 62  │ 22-Nov-2018 │ SBIN    │ EQ      │ 285.95     │ 287.05     │ 281.6     │ 282.65            │ 282.7       │
│ 63  │ 21-Nov-2018 │ SBIN    │ EQ      │ 283.45     │ 289.55     │ 283.05    │ 286.5             │ 287.05      │
│ 64  │ 20-Nov-2018 │ SBIN    │ EQ      │ 285.9      │ 288.55     │ 282.5     │ 282.6             │ 283.45      │

Next :  Main Menu




Comments