Skip to content

Instantly share code, notes, and snippets.

View DexterHaslem's full-sized avatar
💭
why are you taking advice from a site that goes down weekly?

Dexter M Haslem DexterHaslem

💭
why are you taking advice from a site that goes down weekly?
View GitHub Profile
#lang racket
(struct fix-tag (tag contents))
(define fix-soh (string (integer->char 01)))
(define (compute-checksum tags)
1)
;; creates tag string with SOH attached
(define (create-tag id contents)
testStr = "8=FIX4.2.\x019=65\x0135=A\x0149=S\x0156=C\x0134=177\x0152=20160125-18:30:55\x0198=0\x01108=30\x0110=065\x01"
soh = Char(0x01)
function fix_parse_split(str)
ret = []
for chunk in split(testStr, soh)
if length(chunk) > 0
push!(ret, chunk)
end
soh = Char(0x01)
function fix_parse_idx(str)
ret = []
prev_idx = 1
for idx in 1 : length(str)
# beware julia indexing starts at 1!!
if str[idx] == soh && idx > 1
# we want to match parse_split so dont include SOH
chunk = str[prev_idx:idx - 1]
soh = Char(0x01)
function fix_parse_split(str)
ret = []
for chunk in split(testStr, soh)
if length(chunk) > 0
push!(ret, chunk)
end
end
return ret
@DexterHaslem
DexterHaslem / bofh.asm
Last active January 26, 2016 03:08
bastard operator from hell
;; bofh.asm fasm 1.71
;; dexter.haslem@gmail.com
;; example socket program that connects to BOFH quote generator and prints it
format PE console 4.0
entry start
include 'win32ax.inc'
section '.rdata' data readable
ChartDot myDot;
protected override void OnBarUpdate()
{
if (CurrentBar == 0)
{
//myDot = Draw.Dot(this, "myDot", true, Time[0], Close[0], Brushes.Orange);
myDot = Draw.Dot(this, "myDot", true, 0, Close[0], Brushes.Orange);
}
else if (myDot != null && CurrentBar > 2)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace asdf
{
class CheckCase
var guiAssembly = Assembly.LoadFile(@"C:\Users\DHaslem\Documents\nt8-git\NinjaTrader.Custom\bin\Debug\NinjaTrader.Custom.dll");
var drawType = guiAssembly.GetExportedTypes().FirstOrDefault(t => t.FullName == "NinjaTrader.NinjaScript.DrawingTools.Draw");
var methods = drawType.GetMethods();
foreach (var method in methods)
Console.WriteLine(method.Name + "(" + string.Join(",", method.GetParameters().Select(p => p.Name)) + ")");
Console.Write((methods.Length - 4) * 3);
/////////////////////////////
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.ComponentModel;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Gui.Chart;
namespace NinjaTrader.Indicator
{
module yahoo_iv
open System
open System.Net
let stddev(values:seq<float>) =
values
|> Seq.fold (fun acc x -> acc + (1.0 / float (Seq.length values)) * (x - (Seq.average values)) ** 2.0) 0.0
|> sqrt