MC 在1分钟图拿出5分钟,15分钟,30分钟,1小时的K线
using System;
using System.Drawing;
using System.Linq;
using System.Collections; namespace PowerLanguage
{
namespace Function
{
public class OtherFrame
{ DateTime d;double o=; double h=; double l=;double c=; ArrayList listm5 = null;
ArrayList listm15 = null;
ArrayList listm30=null;
ArrayList listh1 = null;
public OtherFrame()
{ listm5 = new ArrayList();
listm15 = new ArrayList(); listm30 = new ArrayList();
listh1 = new ArrayList(); } public void setBarsData(DateTime d, double o, double h, double l, double c)
{
this.c = c;
this.o = o;
this.h = h;
this.l = l;
this.d = d;
calM30();
calH1();
calM15();
calm5();
} public ArrayList getm5list()
{
return listm5; }
public ArrayList getm15list()
{ return listm15; } public ArrayList getm30list()
{
return listm30; } public ArrayList getH1list()
{ return listh1; } int lasthour = -; double temp_open_h1 = ;
double temp_high_h1 = ;
double temp_low_h1 = ; ///小时线的算法
void calH1()
{ if (lasthour != d.Hour && d.Minute > )
{ temp_high_h1 = h;
temp_low_h1 = l; temp_open_h1 = o;
OLHC olhc = new OLHC();
olhc.close = c;
olhc.open = temp_open_h1;
olhc.high = temp_high_h1;
olhc.low = temp_low_h1; if (listh1.Count == ) listh1.Add(olhc);
else listh1.Insert(, olhc); lasthour = d.Hour;
}
else
{ if (temp_high_h1 == || h > temp_high_h1) temp_high_h1 = h;
if (temp_low_h1 == || l < temp_low_h1) temp_low_h1 = l;
if (listh1.Count > )
{ OLHC olhc = (OLHC)listh1[];
olhc.close = c;
olhc.high = temp_high_h1;
olhc.low = temp_low_h1;
listh1[] = olhc; } } } int last30min = -; double temp_open_m30 = ;
double temp_high_m30 = ;
double temp_low_m30 = ; void calM30()
{ int willlast = ;
if (d.Minute >= && d.Minute <= ) willlast = ;
if (d.Minute >= || d.Minute == ) willlast = ; if (willlast != last30min)
{
temp_high_m30 = h;
temp_low_m30 = l; temp_open_m30 = o;
OLHC olhc = new OLHC();
olhc.close = c;
olhc.open = temp_open_m30;
olhc.high = temp_high_m30;
olhc.low = temp_low_m30;
if (listm30.Count == ) listm30.Add(olhc);
else listm30.Insert(, olhc); last30min = willlast; }
else
{
if (temp_high_m30 == || h > temp_high_m30) temp_high_m30 = h;
if (temp_low_m30 == || l < temp_low_m30) temp_low_m30 = l;
if (listm30.Count > )
{ OLHC olhc = (OLHC)listm30[];
olhc.close = c;
olhc.high = temp_high_m30;
olhc.low = temp_low_m30;
listm30[] = olhc; } } } //--------------------------------------------- int last15min = -; double temp_open_m15 = ;
double temp_high_m15 = ;
double temp_low_m15 = ;
void calM15()
{ int willlast = ;
if (d.Minute >= && d.Minute <= ){ willlast = ;}
if (d.Minute >= && d.Minute <= ) willlast = ;
if (d.Minute >= && d.Minute <= ) willlast = ;
if (d.Minute >= || d.Minute == ) willlast = ; //HTTP.write("C:\\mc\\e.xxx",d+" "+ last15min +" "+willlast+" "+"\r\n"); if (willlast != last15min)
{
temp_high_m15 = h;
temp_low_m15 = l; temp_open_m15 = o;
OLHC olhc = new OLHC();
olhc.close = c;
olhc.open = temp_open_m15;
olhc.high = temp_high_m15;
olhc.low = temp_low_m15;
if (listm15.Count == ) listm15.Add(olhc);
else listm15.Insert(, olhc); last15min = willlast; }
else
{
if (temp_high_m15 == || h > temp_high_m15) temp_high_m15 = h;
if (temp_low_m15 == || l < temp_low_m15) temp_low_m15 = l;
if (listm15.Count > )
{ OLHC olhc = (OLHC)listm15[];
olhc.close = c;
olhc.high = temp_high_m15;
olhc.low = temp_low_m15;
listm15[] = olhc; } } } //-------------------------------- int last5min = -; double temp_open_m5 = ;
double temp_high_m5 = ;
double temp_low_m5 = ;
void calm5()
{ int willlast = ;
if (d.Minute >= && d.Minute <= ) willlast = ;
if (d.Minute >= && d.Minute <= ) willlast = ;
if (d.Minute >= && d.Minute <= ) willlast = ;
if (d.Minute >= && d.Minute <= ) willlast = ;
if (d.Minute >= && d.Minute <= ) willlast = ;
if (d.Minute >= && d.Minute <= ) willlast = ;
if (d.Minute >= && d.Minute <= ) willlast = ;
if (d.Minute >= && d.Minute <= ) willlast = ;
if (d.Minute >= && d.Minute <= ) willlast = ;
if (d.Minute >= && d.Minute <= ) willlast = ;
if (d.Minute >= && d.Minute <= ) willlast = ;
if (d.Minute >= || d.Minute == ) willlast = ; if (willlast != last5min)
{
temp_high_m5 = h;
temp_low_m5 = l; temp_open_m5 = o;
OLHC olhc = new OLHC();
olhc.close = c;
olhc.open = temp_open_m5;
olhc.high = temp_high_m5;
olhc.low = temp_low_m5;
if (listm5.Count == ) listm5.Add(olhc);
else listm5.Insert(, olhc); last5min = willlast; }
else
{
if (temp_high_m5 == || h > temp_high_m5) temp_high_m5 = h;
if (temp_low_m5 == || l < temp_low_m5) temp_low_m5 = l;
if (listm5.Count > )
{ OLHC olhc = (OLHC)listm5[];
olhc.close = c;
olhc.high = temp_high_m5;
olhc.low = temp_low_m5;
listm5[] = olhc; } } } //-------------------------------- }
}
}
MC 在1分钟图拿出5分钟,15分钟,30分钟,1小时的K线的更多相关文章
- python pandas 画图、显示中文、股票K线图
目录: 1.pandas官方画图链接 2.标记图中数据点 3.画图显示中文 4.画股票K线图 5.matplotlib基本用法 6.format输出 6.format输出例子 eps_range=[0 ...
- Shell脚本编程30分钟入门
Shell脚本编程30分钟入门 转载地址: Shell脚本编程30分钟入门 什么是Shell脚本 示例 看个例子吧: #!/bin/sh cd ~ mkdir shell_tut cd shell_t ...
- 如何设置一个严格30分钟过期的Session(转载)
本文地址: http://www.laruence.com/2012/01/10/2469.html 今天在我的微博(Laruence)上发出一个问题: 我在面试的时候, 经常会问一个问题: &quo ...
- 如何设置session过期时间为30分钟
今天在我的微博(Laruence)上发出一个问题: 我在面试的时候, 经常会问一个问题: “如何设置一个30分钟过期的Session?”, 大家不要觉得看似简单, 这里面包含的知识挺多, 特别适合考察 ...
- 如何设置一个严格30分钟过期的Session
今天在我的微博(Laruence)上发出一个问题: 我在面试的时候, 经常会问一个问题: “如何设置一个30分钟过期的Session?”, 大家不要觉得看似简单, 这里面包含的知识挺多, 特别适合考察 ...
- 利用JFreeChart绘制股票K线图完整解决方案
http://blog.sina.com.cn/s/blog_4ad042e50100q7d9.html 利用JFreeChart绘制股票K线图完整解决方案 (2011-04-30 13:27:17) ...
- 5分钟K线图压力线买点怎么看?
某开盘后底开一直呈现形成了一个长时间的箱体振荡的走势,K线在底位振荡时,其波动底点总是在不断抬高的话,这种走势说明有资金在场中积极运作,正是由于资金悄然建仓导致了底点慢慢抬高的走势,在底点不断抬高时, ...
- GIS案例学习笔记-ArcGIS整图大图出图实例教程
GIS案例学习笔记-ArcGIS整图大图出图实例教程 联系方式:谢老师,135-4855-4328,xiexiaokui#qq.com 1. 通过出图比例尺(1:2000),地图范围测算图纸大小. 图 ...
- 10分钟轻松设置出 A+ 评分的 HTTP/2 网站
前言 其实 HTTP/2 应该是 2015 年的老话题了(2015 年 5 月 14 日 HTTP/2 协议正式版的发布),但是 2018 年都到了很多网站依旧没有使用,作为新一代互联网协议,HTTP ...
随机推荐
- 中小型公司数据仓库搭建——以mysql为例
为了方便公司的数据分析平台的独立运行和数据挖掘的探索,今年上半年在公司搭建了支持数据平台和数据挖掘的数据仓库:现就数据仓库的创建工作总结如下,供大家参考: 首先介绍下数据仓库搭建的缘由: 公司创建两年 ...
- C3P0连接池参数详解
<c3p0-config> <default-config> <!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数.Default: 3 --> < ...
- ubuntu 上配置python +selenium环境
1.ubuntu 自带了python, 可以打开终端输入python 回车后如果显示版本信息就说明已经安装 2.安装安装python setup tools apt-get install pytho ...
- 分布式版本控制系统Git-----5.Git 的push命令总结
git push git push命令用于将本地分支的更新,推送到远程主机.它的格式与git pull命令相仿. git push <远程主机名> <本地分支名>:<远程 ...
- mpich2 下运行时出现“由于目标计算机积极拒绝,无法连接”的错误
进行mpi并行编程时候,win8下使用mpich2时候,安装目录下找到wmpiexec.exe程序打开,填入编写好的.exe程序地址并制定执行的任务数目的想要运行时候,出现错误: unable to ...
- hadoop 完全分布式
转自:http://blog.itpub.net/26613085/viewspace-1219710/ 1.JDK安装和SSH互信(略过) 2.各节点IP和hostname如下(各节点需配置) [h ...
- Java AOP - Aspectj
1. 序 Aspect Oriented Programming (AOP)是近来一个比较热门的话题. AspectJ是AOP的Java语言的实现,获得了Java程序员的广泛关注. 关于AspectJ ...
- Windows中 RabbitMQ安装与环境变量配置
RabbitMQ是一个在AMQP基础上完整的,可复用的企业消息系统.他遵循Mozilla Public License开源协议.1:安装RabbitMQ需要先安装Erlang语言开发包.下载地址 ht ...
- Redis高可用配置(Keepalived)
主:172.16.0.104 备:172.16.0.105 VIP:172.16.0.107 客户端直接连VIP,当master 104的redis挂掉后,105作为master.当104重启后,10 ...
- Jira 6.0.3安装破解汉化
前段时间和上海的朋友交流了下,他们公司使用JIRA管理项目.回来整理了下感觉很不错. http://www.unlimax.com/jira.html工作中总是有各种事务要去处理,而这些事务不仅仅是代 ...