Saturday, 23 January 2021

Algorithms trading live stock data

This is what I found on the internet:


There is no free lunch here in the data segment.


1)You have to get into the datafeed agreement with NSE. And Realtime datafeed is quite costlier as per year charges come around Rs: 20 lakh per exchange + Service Taxes.


2)Per user fee will be applicable depending upon how you are planning to monetize the datafeed. Normally per use fee for NSE cash/futures segment is Rs: 360/user and first 300 users will be waived off.


3)You have to define yourself as data vendor or data redistributor or you are planning to show the exchange data at free of cost.


4)You can lower you cost by getting the data from data redistributor(e.g globaldatafeeds) as normally your fee would be reduced by 20%. However still you have to get data vending agreement with NSE exchange. Without NSE’s permission you are not allowed to vend the data or redistribute the data even if you are doing it at free of cost. Otherwise you will be tagged as a illegal data vendor as per DOTEX.


5)Only Data Redistributor (aka Authorized data vendors like globaldatafeeds, esignal, bloomberg...etc) develop their own API not the exchange itself.


6)However if you are looking for low cost options then you can prefer snapshot data or 15min delayed datafeeds. And the same above rules are applicable for most of the exchanges.

Friday, 22 January 2021

Ansible agent like Chef

 

By default ansible does not have agent .


We can use SDP solutions like zerotier as alternative.

Tuesday, 19 January 2021

My First Flight (The real bird’s-eye view)

Ha ha !!!!!!!!


Memories are still fresh !!!!!


it's been so long as a fresher I joined an IT company as a software engineer at Bengaluru. I used to trip between cities via bus or train.


I was waiting for a chance to travel by flight which never happened.


One fine day I got a call from my manager that I would be travelling to Chandigarh for some project work and I need to report in a week time.


Next day was thinking about how to travel it’s almost 2500 km travel and I received a call from my manager asking travel details and I informed him of the concerns.


Manager giggled and said that I would be travelling by flight and expenses will be taken care of. I was so happy and bit nervous to travel by flight as I need to travel alone and that was my first time to travel that distance that too by flight.


Somehow I managed to book a flight and I reached the airport And the entire environment was new to me the boarding protocols and the security checks.


I got my boarding pass and went to that lobby and I was told that my flight will departure in next half an hour and I was waiting for that flight.

Cleared the checks and the moment I entered into the flight all those nervousness increased and my heart started pumping. got a window seat took few pictures through flight windows asked someone to take a pic of mine.  

Somehow I got adjusted To the environment everyone on got settled on their seats and Air hostess started instructing the safety instructions. Caption introduced himself and announced details about the journey.


Flight moved slowly on the runway and gradually increased speed OMG it was an awesome feeling the flight airborne. It was a smooth take-off and I saw the city from the sky the real BIRD’s-EYE view. 




I took snaps of city, clouds, Blue-sky just enjoyed every minute of flying journey continued for an hour and the flight landed with the thrill of its own and I got down from the flight. Yeah, that is one of best first-time experience of my life. 



Monday, 18 January 2021

Algorithmic Trading overview


Algorithmic trading means using computer to make investment decisions


Main players of algorithmic trading


Renaissance technologies

AQR capital management

Citadel Technologies


Python is the most popular programming language used for algorithmic trading 


Libraries

NumPy

Pandas

Requests

Xlsxwriter

Math


Algorithmic trading process 


1.collect data

2.develop a hypothesis for a strategy

3.Back test that Strategy

4.implement the strategy on production

Thursday, 7 January 2021

Python script to convert json to csv

 import json

import csv

import time

import logging

import datetime as dt


json_file_path = "D:\.json"

csv_file_path = "D:\.csv"

global_key = []

global_val = []

final_values = [{}]


print ('Device Details script  started at:%s'%(dt.datetime.utcnow()))


def to_string(s):

    try:

        return str(s)

    except:

        return s.encode('utf-8')

def set_final_values(final_key, final_val, path_key_str):

    flag = 0

    b = 0

    for a in final_key:

        try:

            b = int(a)

            flag = 1

            try:

                len((final_values)< b+1)

            except:

                final_values.append({})

        except:

            continue

    logging.debug("Keys and Values updated and assigning to final_values list")

    final_values[b][path_key_str] = final_val


def fetch_key_value(input_json, path_key = None, path_val = None, last_key = None):

    if path_key is None:

        path_key = []            

        path_val = []


    if last_key is not None:

        path_key = path_key + [last_key]

       

    if type(input_json) is dict and input_json:

        for key, val in input_json.iteritems():

            if(type(val) is not dict and type(val) is not list):

                path_val = path_val + [to_string(val)]

            if type(input_json[key]) is dict or type(input_json[key] is list):

                path_key, path_val = fetch_key_value(input_json[key], path_key, path_val, key)

        if len(path_key)>0:

            path_key.pop()

    elif type(input_json) is list and input_json:

        for entity in input_json:

                path_key, path_val = fetch_key_value(entity, path_key, path_val, input_json.index(entity))

        if len(path_key)>0:        

            path_key.pop()

    else:

        if path_key:

            global global_key

            global global_val

            val = []

            val = path_val

            tmp_val = ""

            path_key_str = ""

            for i in path_key: 

                if(path_key_str == ""):

                    path_key_str = to_string(i)

                else:

                    if not isinstance(i,int):         

                        path_key_str = path_key_str + "_" + to_string(i) 

            global_key = global_key + [path_key_str]

            if val:

                tmp_val = str(val.pop())

                set_final_values(path_key, tmp_val, path_key_str)

            path_key.pop()

            global_val = global_val + [tmp_val]

    return path_key, path_val 

def enter_header(header):

    final_list = []

    for x in header:

        if x not in final_list:

            final_list.append(to_string(x))

    print("Header added.")

    logging.debug("Header added.")

    return final_list 


def enter_csv_row(rows, csvwriter):

    for x in rows:

        if x != {}:

            csvwriter.writerow(x)

    print("Rows added.")

    logging.debug("Rows added.")


def format_data(local_key, local_values):

    with open(csv_file_path,'wb') as csv_file:

        header = enter_header(local_key)    

        csvwriter = csv.DictWriter(csv_file, fieldnames = header)

        csvwriter.writeheader()

        enter_csv_row(local_values, csvwriter)

try:

    with open(json_file_path, 'r') as json_file:

        json_data = json.load(json_file)

        json_keys, jason_vals = fetch_key_value(json_data)

        format_data(global_key, final_values)

        print("CSV created successfully.")

        logging.debug("CSV created successfully.")

except Exception as e:

    print ("Exception =>" + str(e))

    logging.debug("Exception =>" + str(e))

Monday, 4 January 2021

Home loan process

 

Fill The Loan Application Form & Attach The Documents

Pay The Processing Fee

Discussion With The Bank

Valuation Of The Documents

The Sanction/Approval Process

Processing The Offer Letter

Processing The Property Papers Followed By A Legal Check

Processing A Technical Check & The Site Estimation

The Final Loan Deal

Signing The Agreement

The Loan Disbursal

Git

1 git add ↳ It lets you add changes from the working directory into the staging area 2 git commit ↳ It lets you save a snapshot of currently...