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 ...
随机推荐
- css display属性介绍
none此元素不会被显示. block此元素将显示为块级元素,此元素前后会带有换行符. inline默认.此元素会被显示为内联元素,元素前后没有换行符. inline-block行内块元素.(CSS2 ...
- Spring-MVC填坑之旅-返回json数据
本文是自己开发中所遇到的问题,对一些及百度到的解决方案做一个记录. DispatcherServlet配置文件 <!-- 定义跳转的文件的前后缀 ,视图模式配置--> <bean i ...
- 第九十三节,html5+css3移动手机端流体布局,基础CSS,头部设计,轮播设计,底部设计
html5+css3移动手机端流体布局,基础CSS,头部设计,轮播设计,底部设计 基础CSS 首先将通用css属性写好 @charset "utf-8"; /*通用样式*/ /*去 ...
- html5--画布
简介 canvas是HTML5中的新元素,你可以使用javascript用它来绘制图形.图标.以及其它任何视觉性图像.它也可用于创建图片特效和动画.canvas 元素本身是没有绘图能力的.所有的绘制工 ...
- Java中ArrayList的使用
//创建ArrayList ArrayList arr = new ArrayList(); //ArrayList添加数据 arr.add("123"); arr.add(&q ...
- UVa 10305 Ordering Tasks (例题 6-15)
传送门: https://uva.onlinejudge.org/external/103/10305.pdf 拓扑排序(topological sort)简单题 自己代码的思路来自: ==> ...
- POJ 2311 Cutting Game(SG+记忆化)
题目链接 #include<iostream> #include<cstdio> #include<cstring> using namespace std; ][ ...
- hdu_5858_Hard problem(数学题)
题目链接:hdu_5858_Hard problem 题意: 让你求阴影部分面积 题解: 推推公式就行 #include<stdio.h> #include<math.h> # ...
- 6、50道JAVA基础编程练习题跟答案
50道JAVA基础编程练习题 [程序1] 题目:古典问题:有一对兔子,从出生后第3个月起每个月都生一对兔子,小兔子长到第三个月后每个月又生一对兔子,假如兔子都不死,问每个月的兔子总数为多少? 程序分析 ...
- Entity Framework删除数据
注:本文为个人学习摘录,原文地址:http://blog.csdn.net/itmaxin/article/details/47659817 最近在学EF,目前了解到删除操作有三种方式, 第一,官方推 ...