Skip to content

Instantly share code, notes, and snippets.

Avatar

Dexter M Haslem DexterHaslem

View GitHub Profile
View fix_parse_split.jl
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 Jan 26, 2016
bastard operator from hell
View bofh.asm
;; 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
View gist:a9691abdb50d59623c21
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)
View checkcase.cs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace asdf
{
class CheckCase
View gist:320b1620e507c03ed249
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);
/////////////////////////////
View fart.cs
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
{
View annualized_volatility.fs
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
View cyg_crash.c
#include <stdio.h>
#include <string.h>
int main()
{
char *token;
char *line = "trivial example";
char *search = " ";
token = strtok(line, search);
View barf.erl
-module(fix).
-export([start_link/0, loop0/1, worker/2]).
-define(PORTNO, 2015).
start_link() ->
start_link(?PORTNO).
start_link(P) ->
spawn_link(?MODULE, loop0, [P]).
View drawm.cs
Draw.AndrewsPitchfork(NinjaScriptBase owner, String tag, Boolean isAutoScale, Int32 anchor1BarsAgo, Double anchor1Y, Int32 anchor2BarsAgo, Double anchor2Y, Int32 anchor3BarsAgo, Double anchor3Y, Brush brush, DashStyle dashStyle, Int32 width)
Draw.AndrewsPitchfork(NinjaScriptBase owner, String tag, Boolean isAutoScale, DateTime anchor1Time, Double anchor1Y, DateTime anchor2Time, Double anchor2Y, DateTime anchor3Time, Double anchor3Y, Brush brush, DashStyle dashStyle, Int32 width)
Draw.AndrewsPitchfork(NinjaScriptBase owner, String tag, Boolean isAutoScale, Int32 anchor1BarsAgo, Double anchor1Y, Int32 anchor2BarsAgo, Double anchor2Y, Int32 anchor3BarsAgo, Double anchor3Y, Boolean isGlobal, String templateName)
Draw.AndrewsPitchfork(NinjaScriptBase owner, String tag, Boolean isAutoScale, DateTime anchor1Time, Double anchor1Y, DateTime anchor2Time, Double anchor2Y, DateTime anchor3Time, Double anchor3Y, Boolean isGlobal, String templateName)
Draw.Arc(NinjaScriptBase owner, String tag, Int32 startBarsAgo, Double s
You can’t perform that action at this time.