This file contains hidden or 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
| // doesn't crash with const int param | |
| //IntProxy inc(const int) | |
| IntProxy inc(int) | |
| { | |
| 000007F6A5DC3370 mov dword ptr [rsp+18h],r8d | |
| 000007F6A5DC3375 mov qword ptr [rsp+10h],rdx | |
| 000007F6A5DC337A mov qword ptr [rsp+8],rcx | |
| 000007F6A5DC337F push rdi | |
| 000007F6A5DC3380 sub rsp,40h | |
| 000007F6A5DC3384 mov rdi,rsp |
This file contains hidden or 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 class NativeMethods | |
| { | |
| [DllImport("user32.dll")] | |
| internal static extern void mouse_event([In]uint dwFlags, [In]int dx, [In]int dy, [In]uint dwData, [In]uint dwExtraInfo); | |
| [Flags] | |
| internal enum MOUSEEVENTF : uint | |
| { | |
| MOVE = 0x00001, | |
| LEFTDOWN = 0x00002, |
This file contains hidden or 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
| // add references WindowsBase, UIAutomationClient, UIAutomationTypes | |
| // using System.Windows.Automation; | |
| // using System.Windows; | |
| [DllImport("user32.dll", CharSet = CharSet.Auto)] static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam); | |
| public void RightClick(AutomationElement element) | |
| { | |
| const int WM_LBUTTONDOWN = 0x0201; | |
| const int WM_LBUTTONUP = 0x0202; | |
| Point point = element.GetClickablePoint(); |
This file contains hidden or 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 |
This file contains hidden or 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.ComponentModel; | |
| namespace NinjaTrader.Indicator | |
| { | |
| [Description("f")] | |
| public class derp : Indicator | |
| { | |
| IndicatorBase myEMA; | |
| protected override void Initialize() |
This file contains hidden or 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 hidden or 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() | |
| { | |
| if (Historical) return;Enumerable.Range(0,14).ToList().ForEach(i =>DrawText((CurrentBar+i).ToString(),"\u0CA0_\u0CA0",0, i % 2 == 0 ? (Close[0]+TickSize) + (TickSize*i) : (Close[0]-TickSize)-(TickSize*i),i % 2 == 0 ? Color.FromArgb(255 - (i*15),0, 0,255):Color.FromArgb(255 - (i*15),255, 0,0))); | |
| } |
This file contains hidden or 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 hidden or 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 hidden or 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) = |