This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script src="ticker.js"></script> | |
| <script> | |
| var ticker = new KiteTicker({api_key: "api_key", access_token: "access_token"}); | |
| ticker.connect(); | |
| ticker.on("ticks", onTicks); | |
| ticker.on("connect", subscribe); | |
| function onTicks(ticks) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- encoding: utf-8 -*- | |
| # requires a recent enough python with idna support in socket | |
| # pyopenssl, cryptography and idna | |
| from OpenSSL import SSL | |
| from cryptography import x509 | |
| from cryptography.x509.oid import NameOID | |
| import idna | |
| from socket import socket |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from upstox_api.api import * | |
| from datetime import datetime | |
| from pprint import pprint | |
| import os, sys | |
| from tempfile import gettempdir | |
| try: input = raw_input | |
| except NameError: pass | |
| u = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| create database price_history_db | |
| CREATE CONTINUOUS QUERY "cq_1m" ON "price_history_db" BEGIN SELECT MIN(price) as low, MAX(price) as high, FIRST(price) as open, LAST(price) as close, SUM(size) as volume INTO "price_1m" FROM "trade" GROUP BY time(1m), symbol END | |
| CREATE CONTINUOUS QUERY "cq_5m" ON "price_history_db" BEGIN SELECT MIN(low) as low, MAX(high) as high, FIRST(open) as open, LAST(close) as close, SUM(volume) as volume INTO "price_5m" FROM "price_1m" GROUP BY time(5m), symbol END | |
| CREATE CONTINUOUS QUERY "cq_15m" ON "price_history_db" BEGIN SELECT MIN(low) as low, MAX(high) as high, FIRST(open) as open, LAST(close) as close, SUM(volume) as volume INTO "price_15m" FROM "price_5m" GROUP BY time(15m), symbol END | |
| CREATE CONTINUOUS QUERY "cq_1h" ON "price_history_db" BEGIN SELECT MIN(low) as low, MAX(high) as high, FIRST(open) as open, LAST(close) as close, SUM(volume) as volume INTO "price_1h" FROM "price_15m" GROUP BY time(1h), symbol END | |
| CREATE CONTINUOUS QUERY "cq_6h" ON "price_history_db" BEGIN SELECT |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Simple Moving Average implemented using KiteConnect Python library. -- [https://kite.trade](kite.trade) | |
| Rainmatter (c) 2016 | |
| License | |
| ------- | |
| This GIST is licensed under the MIT License | |
| """ | |
| from kiteconnect import KiteConnect |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| This file defines a User model and a Flask application, and implements authentication using encryption. | |
| For more information, visit http://tecladocode.com/blog/learn-python-password-encryption-with-flask | |
| """ | |
| from flask import Flask, request, jsonify | |
| from werkzeug.security import generate_password_hash, check_password_hash | |
| import sqlite3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $name = split-path (whoami) -leaf | |
| "Hello, $name!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # install 7-zip, curl and vim | |
| # (Windows 2012 comes with .NET 4.5 out-of-the-box) | |
| # Then use the EC2 tools to create a new AMI from the result, and you have a system | |
| # that will execute user-data as a PowerShell script after the instance fires up! | |
| # This has been tested on Windows 2012 64bits AMIs provided by Amazon (eu-west-1 ami-a1867dd6) | |
| # | |
| # Inject this as user-data of a Windows 2012 AMI, like this (edit the adminPassword to your needs): | |
| # | |
| # <powershell> | |
| # Set-ExecutionPolicy Unrestricted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Created by andy hulstkamp | |
| */ | |
| var webpage = require("webpage"), | |
| fs = require("fs"); | |
| var debug = false, | |
| pageIndex = 0, | |
| allLinks = [], |