随笔 - 850  文章 - 37  评论 - 173  阅读 - 287万
03 2014 档案
日内交易策略
摘要:1.区间突破波动区间突破交易,根据昨天波动幅度的一定百分比,来触发当日的突破性交易。如果昨天的波动幅度是异常的,应该对该波动幅度进行必要的调整,以保证其合理性。主要特点:日内交易策略;区间突破基于昨日振幅与今日开盘价的关系;昨日振幅=昨日最高价-昨日最低价;上轨=今日收盘价+N*昨日振幅;下轨=今日收盘价-N*昨日振幅;当价格突破上轨,买入开仓;当价格跌穿下轨,卖出开仓。2.菲阿里四价昨天高点、昨天低点、昨日收盘价、今天开盘价,可并称为菲阿里四价。它由日本期货冠军菲阿里实盘采用的主要突破交易参照系。此外,因菲阿里主观心智交易的模式,决定了其在实际交易中还大量结合并运用了“阻溢线”的方式,即阻力 阅读全文
posted @ 2014-03-31 17:45 武胜-阿伟 阅读(1313) 评论(0) 推荐(0) 编辑
生活哲学
摘要:吵架时需要两个人,停止吵架只需一个人;送牛奶的人比喝牛奶的人身体棒;腾不出时间来休假,迟早会腾出时间来生病;“命”是失败者的借口,“运”是成功者的谦词;把别人拉下来时,你一定也在下面;通常人们让你提出批评指正时,其实等待的是表扬;有油水的地方常是最滑的地方;得意时,朋友认识了你;落难时,你认识了朋友。http://www.360doc.com/userhome/441042 阅读全文
posted @ 2014-03-31 17:43 武胜-阿伟 阅读(223) 评论(0) 推荐(0) 编辑
C# using Sendkey function to send a key to another application
摘要:If notepad is already started, you should write:// import the function in your class[DllImport ("User32.dll")]static extern int SetForegroundWindow(IntPtr point);//...Process p = Process.GetProcessesByName("notepad").FirstOrDefault();if( p != null){ IntPtr h = p.MainWindowHandle; 阅读全文
posted @ 2014-03-30 21:03 武胜-阿伟 阅读(541) 评论(0) 推荐(0) 编辑
使用C#调用Python脚本,带参数列表 z
摘要:static void Main(string[] args) { string[] strArr;//参数列表 string sArguments = @"Pythons.py";//这里是python的文件名字 RunPythonScript(sArguments, "-u", strArr); }public static void RunPythonScript(string sArgName, string args = "",params string[] teps) {... 阅读全文
posted @ 2014-03-29 12:22 武胜-阿伟 阅读(8384) 评论(0) 推荐(1) 编辑
C#调用Python
摘要:Cursor.Current = Cursors.WaitCursor;Process process = new Process();//不显示 console 窗口 process.StartInfo.RedirectStandardOutput = true; process.StartInfo.UseShellExecute = false; process.StartInfo.CreateNoWindow = true; process.StartInfo.FileName = @"C:\Python27\Python.exe"; process.Star... 阅读全文
posted @ 2014-03-29 12:17 武胜-阿伟 阅读(1129) 评论(0) 推荐(0) 编辑
remove all event handlers from a control
摘要:The sample code below will remove all Click events from button1public partial class Form1 : Form{ public Form1() { InitializeComponent(); button1.Click += button1_Click; button1.Click += button1_Click2; button2.Click += button2_Click; ... 阅读全文
posted @ 2014-03-29 10:50 武胜-阿伟 阅读(482) 评论(0) 推荐(0) 编辑
clone Control event handlers at run time
摘要:var btn2 =newButton(); btn2.Text= btn1.Text;btn2.size = btn1.size;To clone all events of any WinForms control:var eventsField =typeof(Component).GetField("events",BindingFlags.NonPublic|BindingFlags.Instance);var eventHandlerList = eventsField.GetValue(button1);eventsField.SetValue(button2 阅读全文
posted @ 2014-03-29 10:45 武胜-阿伟 阅读(165) 评论(0) 推荐(0) 编辑
EventHandlerList z
摘要:写一个类时,有时候会在同一个类上添加很多事件,事件很多的话,是不容易管理的,.NET提供的EventHandlerList可以辅助多个事件的管 理,但不方便的地方是,它不是类型安全的,缺少类型安全,多少用起来担心会出错。经过改造,可以将系统提供的EventHandlerList通 过泛型提供类型安全的管理。泛型类EventHandlerList.cs的实现如下:public sealed class EventHandlerList : IDisposable { ListEntry head; public EventHandlerList() ... 阅读全文
posted @ 2014-03-29 10:24 武胜-阿伟 阅读(329) 评论(0) 推荐(0) 编辑
code
摘要:---恢复内容开始---IntroductionThere are several ways of doing asynchronous programming in .Net. Visual Studio 2012 introduces a new approach using the ‘await’ and ‘async’ keywords. These tell the compiler to construct task continuations in quite an unusual way.I found them quite difficult to understand us 阅读全文
posted @ 2014-03-27 09:46 武胜-阿伟 阅读(230) 评论(0) 推荐(0) 编辑
From delegates to lambdas z
摘要:I thought of naming this post “Evolution of lambdas in C#”, then I decided that wouldn’t be closest appropriate name for the example that I wanted to discuss. The key to understand a lambda in C# is to understand a delegate. Besides the overly blatant blather – “delegates are nothing but function po 阅读全文
posted @ 2014-03-27 08:42 武胜-阿伟 阅读(241) 评论(0) 推荐(0) 编辑
tpl Dataflow for net 4.0
摘要:http://download.microsoft.com/download/F/9/6/F967673D-58D6-4E3F-8CA9-11769A0A63B1/TPLDataflow.msi 阅读全文
posted @ 2014-03-26 09:23 武胜-阿伟 阅读(200) 评论(0) 推荐(0) 编辑
FlowLayoutPanel autowrapping doesn't work with autosize
摘要:There is no such thing like impossible in software development. Impossible just takes longer.I've investigated the problem. If there is really need for Flow Layout, it can be done with a bit of work. Since FlowLayoutPanel lays out the controls without particularly thinking about the number of ro 阅读全文
posted @ 2014-03-24 22:10 武胜-阿伟 阅读(294) 评论(0) 推荐(0) 编辑
How to get FlowLayoutPanel.AutoSize to work with FlowBreak
摘要:have a problem with a FlowLayoutPanel and I don't know how to solve it.I'm placing two FlowLayoutPanels inside another; the second inner flp has 3 buttons inside.The properties from FlowLayoutPanel child are:FlowDirection=LeftToRight;AutoSize=true;AutoSizeMode=GrowAndShrink;WrapContents=true 阅读全文
posted @ 2014-03-24 22:09 武胜-阿伟 阅读(1109) 评论(0) 推荐(0) 编辑
How to change the property of a control from a flowlayoutpanel?
摘要:Well, the easiest way would be to retain an explicit reference to the buttons you're adding. Otherwise you could add a tag to distinguish them (to be robust against i18n issues). E.g. you can set the tag of "button2" to "button2" and then you can use:foreach(Control ctl in fl 阅读全文
posted @ 2014-03-24 22:06 武胜-阿伟 阅读(167) 评论(0) 推荐(0) 编辑
Add controls dynamically in flowlayoutpanel
摘要:For a FlowLayoutPanel, you don't need to specify a location since the controls are arranged for you. Just change "this" to the name of your FlowLayoutPanel:for (int i = 0; i < 5; i++){ Button button = new Button(); button.Tag = i; flowLayoutPanel1.Controls.Add(button);}////Populatin 阅读全文
posted @ 2014-03-24 22:03 武胜-阿伟 阅读(271) 评论(0) 推荐(0) 编辑
CLR via C# 读书笔记 6-2 不同AppDomain之间的通信 z
摘要:跨AppDomain通信有两种方式 1.Marshal By reference : 传递引用 2.Marshal By Value : 把需要传递的对象 通过序列化反序列化的方式传递过去(值拷贝) 只有标记为 可序列化 Serializable 的类才能通过 Marshal By Value的方式通信以下代码描述了几种跨域通信的情况1.AppDomain是CLR的内部行为,windows完全不清楚有AppDomain的存在2.在新的域中加载Assembly和Type最好用完整限定名(如果直接加载Type, CLR会自动加载Type所在的和所用到的Assembly)3.默认情况下新建... 阅读全文
posted @ 2014-03-24 21:54 武胜-阿伟 阅读(399) 评论(0) 推荐(0) 编辑
应用程序域 z
摘要:应用程序域(AppDomain)已经不是一个新名词了,只要熟悉.net的都知道它的存在,不过我们还是先一起来重新认识下应用程序域吧,究竟它是何方神圣。应用程序域 众所周知,进程是代码执行和资源分配的最小单元,每个进程都拥有独立的内存单元,而进程之间又是相互隔离的,自然而然,进程成为了代码执行的安全边界。 一个进程对应一个应用程序是一个普遍的认知,而.net却打破了这一惯例,因为它带来了应用程序域这一全新的概念,CLR可使用应用程序域来提供应用程序 之间的隔离,而一个进程中可以运行多个应用程序域,也就是说只要使用应用程序域,我们可以在一个进程中运行多个应用程序,而不会造成进程间调用或进程间切 换 阅读全文
posted @ 2014-03-24 21:38 武胜-阿伟 阅读(335) 评论(0) 推荐(0) 编辑
C# 在SQLite数据库中存储图像 z
摘要:C# 在SQLite数据库中存储图像更多 0 C# SQLite 建表语句CREATE TABLE [ImageStore]([ImageStore_Id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,[ImageFile] NVARCHAR(20) NULL,[ImageBlob] BLOB NULL);加载图像privateImageLoadImage(){//Create an instance of the Image Class/Object//so that we can store the information about th... 阅读全文
posted @ 2014-03-23 09:00 武胜-阿伟 阅读(4313) 评论(0) 推荐(0) 编辑
Using .NET 4's Lazy<T> 实现单实例
摘要:Using .NET 4's Lazy typeExplanation of the following code:If you're using .NET 4 (or higher) then you can use the System.Lazy type to make the laziness really simple.All you need to do is pass a delegate to the constructor that calls the Singleton constructor, which is done most easily with 阅读全文
posted @ 2014-03-23 08:44 武胜-阿伟 阅读(309) 评论(0) 推荐(0) 编辑
tpl demo
摘要:using System;using System.Collections.Concurrent;using System.Threading;using System.Threading.Tasks;using System.Threading.Tasks.Dataflow;namespace TDFDemo{class Program{static void Main(string[] args){new Program().Run();}private async void Run(){var bus = new Bus();// Inline handlervar s1 = bus.S 阅读全文
posted @ 2014-03-21 09:15 武胜-阿伟 阅读(359) 评论(0) 推荐(0) 编辑
SQLite批量插入,修改数据库 zt
摘要:SQLiteConnection sqConnection = dataProvider.GetDbConnection(); sqConnection.Open(); SQLiteCommand sqCommand = new SQLiteCommand(); SQLiteTransaction myTrans; // Start a local transaction myTrans = sqConnection.BeginTransaction(System.Data.IsolationLevel.Serializab... 阅读全文
posted @ 2014-03-20 20:46 武胜-阿伟 阅读(2950) 评论(0) 推荐(0) 编辑
Dev表格导出工具类 z
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace xSoft.Utility.UI{ public class ExportUtility { public static void ExportGridToFile(DevExpress.XtraGrid.Views.Base.BaseView gridView, string reportName, string fullFileName = null) { ... 阅读全文
posted @ 2014-03-20 20:15 武胜-阿伟 阅读(760) 评论(0) 推荐(1) 编辑
SQLite Helper (C#) z
摘要:http://www.codeproject.com/Articles/746191/SQLite-Helper-CsharpIntroductionI have written a small class, SQLiteHelper which aims to simplify the usage of SQLite in C#.PrerequisiteThis small class is built on top of System.Data.SQLite.DLL. A reference of this DLL must be added into your projects.Down 阅读全文
posted @ 2014-03-19 20:04 武胜-阿伟 阅读(3758) 评论(0) 推荐(0) 编辑
Computer Talker with C# z
摘要:Using the CodeAdd a textbox named 'txtWords' to a form.Add a button named 'btnSpeak' to a form.Add a reference to System.Speech.In the form's code-behind, add: Collapse | Copy Codeusing System.Windows.Forms;using System.Speech.Synthesis;namespace Sample{ public partial Class Form 阅读全文
posted @ 2014-03-19 11:35 武胜-阿伟 阅读(369) 评论(0) 推荐(1) 编辑
强大DevExpress,Winform LookUpEdit 实现多列查询 gridview弹出下拉选择 z
摘要:关键代码请参考http://www.devexpress.com/Support/Center/p/K18333.aspx最新DEMO 下载The current GridLookUpEdit's implementation doesn't provide interfaces to force the described feature to work automatically. However, in this article, we'll try to create a GridLookUpEdit's descendant and introduce 阅读全文
posted @ 2014-03-17 22:10 武胜-阿伟 阅读(10025) 评论(4) 推荐(0) 编辑
c#中struct和class的区别 z
摘要:1.struct是值类型,class是对象类型2.struct不能被继承,class可以被继承3.struct默认的访问权限是public,而class默认的访问权限是private.4..struct的new和class的new是不同的。struct的new就是执行一下构造函数创建一个新实例再对所 有的字段进行Copy。而class则是在堆上分配一块内存然后再执行构造函数,struct的内存并不是在new的时候分配的,而是在定义的时候分配, 换句话话说struct是在线程栈中创建,其定义时就已经被初始化,而class必须用new在托管堆中开辟空间。因此struct与class在作为 参数传值 阅读全文
posted @ 2014-03-17 22:07 武胜-阿伟 阅读(382) 评论(0) 推荐(0) 编辑
DevExpress控件学习总结 z
摘要:1、Navigation&Layout1.1BarManager如果想在窗体或用户控件(usercontrol)上添加工具条(bars)或弹出菜单(popupmenus),我们 需要把一个不可见的控件(component)BarManager(Navigation&Layout)拖放到这个窗体或用户控件上。这个控 件维护工具条在窗体上的布局,处理用户的行为(processesanend-user'sactions),提供一些定制功能等等。这个控件维护 工具条、工具条项、工具条项目录这三者的集合 (Itmaintainsthecollectionsofbars,barit 阅读全文
posted @ 2014-03-17 22:06 武胜-阿伟 阅读(32101) 评论(5) 推荐(2) 编辑
Devexpress GridView部分常用操作总结 z
摘要:一:Clone返回新的 DataTableClone返回新的 DataTable,与当前的 DataTable 具有相同的架构;Copy:返回新的 DataTable,它具有与该 DataTable 相同的结构(表架构和约束)和数据DataRow[] _dr = DT.Select("CLSSBH='"+ Filter_Str +"'"); DataTable dt = DT.Clone() ; DataRow dr ; for( int j = 0 ;j = 0) { DataRow row = gridView1.GetDataRow 阅读全文
posted @ 2014-03-17 22:03 武胜-阿伟 阅读(8609) 评论(0) 推荐(1) 编辑
dev中gridview控件 z
摘要:目录:一、客户端常用1.常用API2.聚焦行变更事件3.客户端选择多行4.客户端选择行5. 获取选择的行数目6.单击行时,选中行7.通过checkbox 选择行8.选择所有行9.启动编辑框,Container.VisibleIndex 获取行索引10.启动服务器端函数:二、客户端常用事件三、服务器端常用属性四、服务器端常用方法五、服务器端常用事件六、列的设置1.模板列使用超链接2.模板列使用Button用法3. 使用命令列七、其他------------------------------------------------内容:一客户端常用1.常用API: PerformCallback(t 阅读全文
posted @ 2014-03-17 22:02 武胜-阿伟 阅读(2955) 评论(0) 推荐(1) 编辑
DevExpress右键菜单使用 zt
摘要:添加BarManager和popupMenu组建:设置popupMenu组件的Manager属性:右键点击popupMenu主键,点击Customize选项添加菜单:然后便可添加到鼠标事件中,此处以TreeList为例:1.private void treeList1_MouseUp(object sender, MouseEventArgs e) 2.{ 3. TreeList tree = sender as TreeList; 4. if (e.Button == MouseButtons.Right 5. && ModifierKey... 阅读全文
posted @ 2014-03-17 22:01 武胜-阿伟 阅读(495) 评论(0) 推荐(0) 编辑
DevExpress中XtraGrid控件对GridView每行的颜色设置 zt
摘要:改变行颜色private void GridView1_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e) { DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView; if (e.RowHandle >= 0) { string category =... 阅读全文
posted @ 2014-03-17 21:49 武胜-阿伟 阅读(9327) 评论(2) 推荐(1) 编辑
devpress GridControl控件绑定RepositoryItemImageComboBox 作为下拉框使用 zt
摘要:1、拖出gridview控件,然后将字段绑定上去2、将要做下拉框的控件加入RepositoryItemImageComboBox控件3、绑定数据for (int i = 0; i = 0) { ImageComboBoxEdit edit1 = new ImageComboBoxEdit(); edit1.Properties.Items.AddRange(repositoryItemImageComboBox1.Items); e.RepositoryItem = edit1.Pr... 阅读全文
posted @ 2014-03-17 21:46 武胜-阿伟 阅读(7933) 评论(0) 推荐(1) 编辑
DevExpress gridControl控件动态绑定列 zt
摘要:DataTable dt = =Query.GetCustome=(ref customColumnCount); //绑定列 gridView.Columns.Add(new GridColumn() { Name = "NoCHK", FieldName = "NoCHK", Caption = "选择", VisibleIndex =0}); gridView.Columns.Add(new GridColumn() { Name = "No", FieldName = "No", Cap 阅读全文
posted @ 2014-03-17 21:44 武胜-阿伟 阅读(7800) 评论(0) 推荐(1) 编辑
获得WCF Client端的本地端口 z
摘要:当WCF调用远程服务时,显示该调用的网速或流量。其中比较关键的一步就是需要获得WCF Client端的本地端口,原来以为是个简单的事情,结果查了1个多小时谷歌,硬是没找到好的法子,只有自己动手了。 首先,反编译System.ServiceModel.dll的代码,查找Socket,然后,就是一直反复的“转到定义”、“查找所有引用",最后利用反射搞定了!代码分享如下,如果大家有什么更好的方法,请告知下。var temp = RASHelper.CreatProxy(SystemConfiger.ServerEndPoint);//创建ClientProxy,就是调用ChannelFac 阅读全文
posted @ 2014-03-17 21:27 武胜-阿伟 阅读(377) 评论(0) 推荐(0) 编辑
log4net.dll配置以及在项目中应用 zt
摘要:1 首先在项目中引用log4net.dll,然后项目中添加一个配置文件log4net.config View Code2,在项目中的Properties文件夹下的AssemblyInfo.cs中加入一句话当然,首先要加入using log4net;;然后添加[assembly: XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]WINFORM应用程序using log4net.Config; ...[assembly: log4net.Config.XmlConfigurator()... 阅读全文
posted @ 2014-03-17 21:17 武胜-阿伟 阅读(1709) 评论(0) 推荐(0) 编辑
系统交易策略 hylt
摘要:最令我尴尬的事情,莫过于很多朋友来到网站,不知道我说的是什么。大多数人以为鬼仆是推销软件的。其实这里理解是错的,特别是一些软件制作与经销商,更出 于推销的目的,故意夸大产品性能,模糊交易系统与一般行情播报软件或者行情的辅助分析软件的本质差异,更加剧了这种混乱的情况,很不利于交易系统的研究、 交流与开发。因此,笔者认为有必要对交易系统的概念和特征进行论述,以正视听。我相信你会遇见很多人,他们告诉你他有一套“预测”很准的系统,用这个赚钱很容易。你再仔细的询问他,他会告诉你,他的独特的交易系统会清晰的发出买入或卖出讯号,任何人只要据此操作,肯定盈利丰厚。这时候,你询问他,你的操作系统的依据是什么?他 阅读全文
posted @ 2014-03-16 20:13 武胜-阿伟 阅读(796) 评论(0) 推荐(2) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示