This file contains 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
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 | |
{ |
This file contains 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
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); | |
///////////////////////////// |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace asdf | |
{ | |
class CheckCase |
This file contains 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
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) |
This file contains 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
let printStreamingWebReq (url : string, postContent : string) = | |
let req = WebRequest.Create url :?> HttpWebRequest | |
req.Method <- "POST" | |
req.Proxy <- null | |
let postDataEncoded = ASCIIEncoding.ASCII.GetBytes(postContent) | |
let len : int64 = int64 postDataEncoded.Length | |
req.ContentLength <- len | |
let reqStream = req.GetRequestStream() | |
reqStream.Write(postDataEncoded, 0, postDataEncoded.Length) | |
use response = req.GetResponse() |
This file contains 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
open System | |
type bar = | |
{ Symbol : string; Timestamp : DateTime; | |
Open : string; High : string; Low : string; Close : string; | |
Volume: int; | |
} | |
// F.US.DGH12 20111201 0107 110020 110020 110020 110020 1 | |
let parse_bar (line : string, delim : char) = |
This file contains 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
public static IEnumerable<T> DepthFirstSearch<T>(IEnumerable<T> start, Func<T, IEnumerable<T>> selector, Func<T, bool> predicate) | |
{ | |
var results = new List<T>(); | |
foreach (T item in start) | |
{ | |
if (predicate != null && predicate(item)) | |
results.Add(item); | |
else if (predicate == null) | |
results.Add(item); | |
var subItems = selector(item); |
This file contains 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
public static IEnumerable<T> FlattenTree<T>(IEnumerable<T> list, Func<T, IEnumerable<T>> subitems) | |
{ | |
foreach (T child in list) | |
{ | |
yield return child; | |
foreach (T other in FlattenTree(subitems(child), subitems)) | |
yield return other; | |
} | |
} |
This file contains 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
protected override void OnBarUpdate() | |
{ | |
string indicator = "EMA"; | |
Type indicatorType = Type.GetType("NinjaTrader.Indicator." + indicator); | |
IndicatorBase indicatorBase = (IndicatorBase) Activator.CreateInstance(indicatorType); | |
Print(indicatorBase.GetHashCode() + ":" + indicatorBase.GetType().FullName); | |
indicatorBase.BarsRequired = BarsRequired; | |
indicatorBase.CalculateOnBarClose = CalculateOnBarClose; | |
indicatorBase.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256; | |
indicatorBase.MaximumBarsLookBack = MaximumBarsLookBack; |
This file contains 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
:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.QualityTools.CodedUITestFramework". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. | |
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.TestTools.UITest.Common". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. | |
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.TestTools.UITest.Extension". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. | |
c:\W |