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为例
为了方便公司的数据分析平台的独立运行和数据挖掘的探索,今年上半年在公司搭建了支持数据平台和数据挖掘的数据仓库:现就数据仓库的创建工作总结如下,供大家参考: 首先介绍下数据仓库搭建的缘由: 公司创建两年 ...
- dump报文转换为wrieshark报文
我们开发中经常会出原始的报文,如下所示: 45 00 01 3d 8e 6a 00 00 80 11 ab 46 00 00 00 00 ff ff ff ff 00 44 00 43 01 29 6 ...
- Adding DOM elements to document
1.JavaScript 添加DOM Element 执行效率比较: 抄自:http://wildbit.com/blog/2006/11/21/javascript-optimization-add ...
- Android原生Cling演化的覆盖层
package com.example.demotest; import android.content.Context; import android.graphics.Paint; import ...
- wxpython 安装教程
wxpython在windows 上的安装,需要在wxpython官网上下载对应的版本:Python分为32和64位系统不是系统的32位和64位 所以可以先在IDE 下输入Python看下当前是32还 ...
- Maven-项目构建技术(工具)
Maven-项目构建技术(工具) 主要的内容目标:如何创建项目.如何导入jar.如何进行其他配置.如何管理生命周期 今天的主要安排: maven的概述(为什么要用?是什么) 快速入门(配置.名词解释. ...
- JUit——(三)JUnit核心对象(测试、测试类、Suit和Runner)
JUnit的核心对象:测试.测试类.测试集(Suite).测试运行器 1. 测试: @Test注释的.公共的.不带有任何参数.并且返回void类型的方法 2. 测试类: 公共的,包含对应类的测试方法的 ...
- 《Javascript网页经典特性300例》
<Javascript网页经典特性300例> 基础篇 第1章:网页特性 刷新.后退.前进.关闭.标题.跳转禁止网页放入框架动态加载js避免浏览器使用缓存加载页面 第2章:DOM操作 根据n ...
- screen 对象当当获取屏幕而已 innethtml可以知道调整屏幕宽度
<div id='lidepeng' style="height: 100px;width: 100px;"></div><script type=& ...
- Linux添加软件连接方法
这是linux中一个非常重要命令,请大家一定要熟悉.它的功能是为某一个文件或目录在另外一个位置建立一个同步的链接,类似Windows下的超级链接. 这个命令最常用的参数是-s,具体用法是:sudo l ...