Skip to content

Instantly share code, notes, and snippets.

@oldmonkABA
oldmonkABA / psar-tradingview.py
Created April 24, 2020 16:38
The code in https://github.com/virtualizedfrog/blog_code/blob/master/PSAR/psar.py was modified to match value of PSAR given in tradingview
#######################################################################
# Author : Arun B
#
# Purpose : Calculate Parabolic SAR
############################################################################
def psar(barsdata, iaf = 0.02, inc=0.02,maxaf = 0.2):
length = len(barsdata)
@oldmonkABA
oldmonkABA / automatic-login-kiteconnect-requests.py
Created April 6, 2020 19:18
Automatic login to kiteconnect using only requests library. Due credits to https://gist.github.com/GannyS/619e29dc999ffd014e80ec69ae190b93
# -*- coding: utf-8 -*-
import json
import os
import logmatic
import logging
from logging.config import dictConfig
import requests
from http import HTTPStatus
import re
from kiteconnect import KiteConnect
@oldmonkABA
oldmonkABA / create-kiteconnect-candlestick-q.py
Last active August 1, 2024 05:32
Implementation of ticks to 1min and 15 mins candles in zerodha kiteconnect using python queues. This code is modified version of the code given in http://ezeetrading.in/Articles/Candles_formation_from_tick_data_zerodha.html. The difference is that in on_ticks functions the only action performed is that the ticks are place in a event queue. This …
################## Ticks to candles in kiteconnect python ####################
# Author : Arun B
# Reference : http://ezeetrading.in/Articles/Candles_formation_from_tick_data_zerodha.html
# Purpose : Convert ticks to candles by putting ticks in a queue. This redues time wasted in on_ticks function
################################################################################
from kiteconnect import KiteTicker
import datetime
from copy import copy
import queue
@oldmonkABA
oldmonkABA / automatic-login-kiteconnect-selenium.py
Last active March 3, 2022 16:52
This code demonstrates the automatic process of generating access token for kiteconnect using headless firefox browser
#######################################################################
# Author : Arun B
#
# Purpose : Automate the process of generating access token for kiteconnect in python
############################################################################
# For this code to run you have to download geckodriver and put it in /usr/local/bin
from kiteconnect import KiteConnect,KiteTicker
import requests
from selenium import webdriver
from selenium.webdriver.common.by import By