Skip to content

Instantly share code, notes, and snippets.

View spencerdavis2000's full-sized avatar

Spencer Davis spencerdavis2000

  • Chicago, IL
View GitHub Profile
#!/bin/bash
# Created by: Abdullah Al Imran
# Email: [email protected]
#Adding PPA
add-apt-repository -y ppa:atareao/atareao
add-apt-repository -y ppa:caffeine-developers/ppa
add-apt-repository -y ppa:diesch/testing
add-apt-repository -y ppa:eugenesan/ppa
@spencerdavis2000
spencerdavis2000 / enigma.py
Created May 26, 2018 01:06
Enigma machine emulator, written in Python
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
class Rotor():
perms = []
turnover_position = ''
position = 'A'
def __init__(self, perms, turnover_position, ring_setting):
i = alphabet.index(ring_setting)
perms = perms[i:] + perms[:i]
self.perms = [c for c in perms]
@spencerdavis2000
spencerdavis2000 / class_trading_example.cs
Last active November 19, 2016 22:40
Using a Class with a "dynamic array container" such as a List or ArrayList to create a datastructure format used bar by bar for trading purposes.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MoneyManagement
{
class Program
{
@spencerdavis2000
spencerdavis2000 / @RangeAltBarsTypeV7.cs
Created August 5, 2016 04:18 — forked from vijay-v/@RangeAltBarsTypeV7.cs
NinjaTrader7 new bar type : Range Bars, but fixed to not draw phantom / dummy bars in case there is a sudden move; jumps happen
// VJ : 20120321 : Fixed to not draw phantom / dummy bars in case there is a sudden move; i.e., all prices seen are real
// Problem : The built-in NT7 range bars do phantom / dummy bars to produce picture-perfect Range Bars.
// Amibroker does the same. But that is NOT what Iwant. I want real prices.
// Thus, only if price action is smooth (tick by tick, say) do we see perfect 250R range bars.
// Otherwise, the Close price might be > 250R.
//
// The difference between Range Bars, and my RangeAltBars:
// Default Range Bars : pretty 250R phantom bars with fake (computed) Close
// Range Alt Bars : no phantom bars; no fake Close
//