Skip to content

Instantly share code, notes, and snippets.

View snowkidind's full-sized avatar
💭
Was informed that there is a special place in hell for pureJS maximalists....

Kentoshi Rakomoto snowkidind

💭
Was informed that there is a special place in hell for pureJS maximalists....
View GitHub Profile
// returns a string that is formatted for search indexes
toFormat: function(raw){
// reality here is that the query should find both ways
raw = String(raw);
raw = raw.replace(/ /g, '');
raw = raw.replace(/_/g, ''); // liqui
raw = raw.replace(/\//g, '');
// assert string
// again, thirty second code here, bugs and needs factoring ensue
toBtx: function(string){
// bittrex likes all caps
// btx also likes btc, usdt, or eth at the beginning
let raw = String(string).toUpperCase();
let raw2 = "";
if (raw.includes("BTC")){
module.exports = {
EMA: function(originalArray, emaLength) {
let array = originalArray.slice().reverse(); // easier on my limited brain to think of the array in the "proper" order
// trim initial NaN values
let iPos = 0;
for (iPos = 0; iPos < array.length && isNaN(array[iPos]); iPos++) {
}
array = array.slice(iPos);// trim initial NaN values from array
let ema = [];
@snowkidind
snowkidind / token.js
Created June 17, 2018 03:00
Binance structural idea for trading bot asset management, in progress
let db = require('./dbaccess');
let utilities = require('./utilities');
let binance = require('./binance');
let chalk = require('chalk');
// manage tokens
// manage balances
// delegate profits, fees and taxes
// the token cycle is the process of buying, selling and delegating the costs associated
ticker:function(pair, cb){
const time = new Date().getTime();
if (time - lastTickerTime > 2000 ) {
// console.log("Get Ticker" + pair);
if (logAllApiCalls){
console.log(apiCallsCount + " ticker.binance.prices: " + pair + " - " + Date.now());
apiCallsCount += 1;
}
@snowkidind
snowkidind / README.md
Last active November 11, 2021 16:53
TDAmeritrade API Notes for Node.js

Access to Ameritrade API

notes that may be helpful for node.js devs

What I've gathered is authorization tokens must be earned first. Authorization tokens are good for three months, once you are setup, you will get two tokens which come as long strings, An access_token and a refresh_token. Access tokens are only valid for 30 minutes so you will need to code to refresh the session using the refresh token frequently. When you refresh, you are given a new access token and that is what you use to "login" or pull from the api for the next period. But in order to get the tokens, you will be required to go through some processes to get a valid token that applies to your app. The following text kind of steers you in that direction...

Making an app

On the api site you will need to make an app, where you pick some random name by using some random numbers. It should be automatically generated but it isnt. For this field item, I simply went to https://www.uuidgenerator.net/ and just grabbed the firs

omg-pos-merchant
Notes for pos merchant
Xcode 10.1 / High Sierra 10.13.6
First Build:
/.../pos-merchant-ios-master/Pods/Target Support Files/Pods-POSMerchant/Pods-POSMerchant.debug.xcconfig: unable to open file (in target "POSMerchant" in project "POSMerchant") (in target 'POSMerchant')
@snowkidind
snowkidind / questions.md
Last active March 22, 2019 03:40
GO.Exchange Questions
User Question Answer
Luis Is there a token of go and how can i buy?
Kally Will there be a ICO for GO.exchange, or will it have a native token?
Do all your jobs require relocating?
ethman Hi @GOExchange , Ive been a big fan of OMG from the beggining but just wanting some clarity from the recent blog post from Jun, will transaction volume from go.exchange eventally provide fees for OMG token holders?
Dan F Is go.exchange in cahoots with the Thailand government regarding the recent "legalization" of BTC, BCH, XLM, and ripple?
When Go.Exchange launchpad for ICO's and STO's
RD3596 When can we start trading? Will OMG be the gas for GO exchange?
Bharath Rao what is the relationship between GO and OMG?
Group A: tokens with 3 or greater buy indicators
11:BCHABCBTC Rank: 3 Last Price: 0.04130400 triggerPrice: 0.04151000 difference: -0.00020600 duration: 5 gain: -0.50 prevStatus: 2 prevDuration: 1
42:ZRXBTC Rank: 43 Last Price: 0.00007254 triggerPrice: 0.00007254 difference: 0.00000000 duration: 1 gain: 0.00 prevStatus: 1 prevDuration: 1
111:POEBTC Rank: 58 Last Price: 0.00000137 triggerPrice: 0.00000137 difference: 0.00000000 duration: 1 gain: 0.00 prevStatus: 0 prevDuration: 58
141:DGDBTC Rank: 68 Last Price: 0.00459100 triggerPrice: 0.00453400 difference: 0.00005700 duration: 3 gain: 1.26 prevStatus: 1 prevDuration: 1
Group B tokens with 2 buy indicators
7:TNTBTC Rank: 4 Thresh B: Last Price: 0.00000530 triggerPrice: 0.00000466 difference: 0.00000064 duration: 3 gain: 13.73 prevStatus: 0 prevDuration: 5
16:ELFBTC Rank: 38 Thresh B: Last Price: 0.00004409 triggerPrice: 0.00004505 difference: -0.00000096 duration: 4 gain: -2.13 prevStatus: 0 prevDuration: 1
17:BNBBTC Rank: 1 Thresh B: Last Price: 0.004141
@snowkidind
snowkidind / median.js
Last active May 23, 2019 01:13
median
median: function (high_array, low_array) {
let error = false;
const highs = trimArrayTailToSize(high_array, 100);
const lowArr = trimArrayTailToSize(low_array, 100);
const lows = detectBadLowData(lowArr);
const precision = findPrecision(highs);