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线的更多相关文章

  1. python pandas 画图、显示中文、股票K线图

    目录: 1.pandas官方画图链接 2.标记图中数据点 3.画图显示中文 4.画股票K线图 5.matplotlib基本用法 6.format输出 6.format输出例子 eps_range=[0 ...

  2. Shell脚本编程30分钟入门

    Shell脚本编程30分钟入门 转载地址: Shell脚本编程30分钟入门 什么是Shell脚本 示例 看个例子吧: #!/bin/sh cd ~ mkdir shell_tut cd shell_t ...

  3. 如何设置一个严格30分钟过期的Session(转载)

    本文地址: http://www.laruence.com/2012/01/10/2469.html 今天在我的微博(Laruence)上发出一个问题: 我在面试的时候, 经常会问一个问题: &quo ...

  4. 如何设置session过期时间为30分钟

    今天在我的微博(Laruence)上发出一个问题: 我在面试的时候, 经常会问一个问题: “如何设置一个30分钟过期的Session?”, 大家不要觉得看似简单, 这里面包含的知识挺多, 特别适合考察 ...

  5. 如何设置一个严格30分钟过期的Session

    今天在我的微博(Laruence)上发出一个问题: 我在面试的时候, 经常会问一个问题: “如何设置一个30分钟过期的Session?”, 大家不要觉得看似简单, 这里面包含的知识挺多, 特别适合考察 ...

  6. 利用JFreeChart绘制股票K线图完整解决方案

    http://blog.sina.com.cn/s/blog_4ad042e50100q7d9.html 利用JFreeChart绘制股票K线图完整解决方案 (2011-04-30 13:27:17) ...

  7. 5分钟K线图压力线买点怎么看?

    某开盘后底开一直呈现形成了一个长时间的箱体振荡的走势,K线在底位振荡时,其波动底点总是在不断抬高的话,这种走势说明有资金在场中积极运作,正是由于资金悄然建仓导致了底点慢慢抬高的走势,在底点不断抬高时, ...

  8. GIS案例学习笔记-ArcGIS整图大图出图实例教程

    GIS案例学习笔记-ArcGIS整图大图出图实例教程 联系方式:谢老师,135-4855-4328,xiexiaokui#qq.com 1. 通过出图比例尺(1:2000),地图范围测算图纸大小. 图 ...

  9. 10分钟轻松设置出 A+ 评分的 HTTP/2 网站

    前言 其实 HTTP/2 应该是 2015 年的老话题了(2015 年 5 月 14 日 HTTP/2 协议正式版的发布),但是 2018 年都到了很多网站依旧没有使用,作为新一代互联网协议,HTTP ...

随机推荐

  1. IP地址接口小结

    1 百度http://api.map.baidu.com/location/ip?ak=F454f8a5efe5e577997931cc01de3974&ip=58.67.143.169 {& ...

  2. hbase自带mapreduce计数表行数功能

    $HBASE_HOME/bin/hbase org.apache.hadoop.hbase.mapreduce.RowCounter ‘tablename’ mapreduce来计数,很快的!!!

  3. Shell出现cd命令无法识别

    出现cd 等命令无法识别的原因可能是: 当前文件实在windows环境下编辑的其换行结尾是 \r\n 和linux环境的 \n 不一致导致错误, 最好在linux系统上通过 VI 命令新建文件,然后通 ...

  4. DPDK l2fwd 浅注

    l2fwd是DPDK中的非常经典的例子.二层转发模型. 就是在相邻的网卡接口间互相传递报文. 网口0和网口1之间报文互传. 网口2和网口3之间报文互传. ............ 运行参数 . 在目录 ...

  5. 关于通过addClass与removeClass用jquery控制有良好兼容的CSS3样式

    hi:)好久不见~最近被jquery的animate对某些CSS3特性不兼容搞的头晕眼花,果断百度,阅读了一些高手的博客后突然发现平常很少用到的addClass和removeClass属性居然还可以这 ...

  6. block的内部实现原理

    一.简单定义 block是一个指向结构体的指针,编译器将block内部代码生成对应的函数,上述结构体中的函数指针(funcPtr)指向该函数的实现: 二.相关概念 形参和实参 形参:形式参数,用于定义 ...

  7. C socket指南

    1.介绍 Socket 编程让你沮丧吗?从man pages中很难得到有用的信息吗?你想跟上时代去编Internet相关的程序,但是为你在调用 connect() 前的bind() 的结构而不知所措? ...

  8. java 读取excel(Map结构)xls

    package com.sun.test; import java.io.FileInputStream;import java.io.FileNotFoundException;import jav ...

  9. scale相关设置—手动设置

    在ggplot2 中,可以进行手动设置的函数有: scale_colour_manual(..., values).scale_fill_manual(..., values). scale_size ...

  10. 3、Data对象

    1.创建part1.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "htt ...