OmegaChartのソースコードの保守
Révision | c073e44d03fdbfec48fa7181c39e0aed6031ed11 (tree) |
---|---|
l'heure | 2014-07-21 14:33:52 |
Auteur | panacoran <panacoran@user...> |
Commiter | panacoran |
1円未満の株価に対応する
- 株価データを10倍で格納する
- 値が10倍でない古い株価データを10倍化する
- 5000円以下の株価を小数点以下1桁まで表示する
ソフトバンク9984の2014年7月18日、6月18日、5月19日の株価のいずれかが
存在し、数値が10倍でない場合に古い株価データの10倍化を行う。
@@ -240,7 +240,7 @@ namespace Zanetti.Data | ||
240 | 240 | public virtual double PriceScale { |
241 | 241 | get { |
242 | 242 | if(!IsBuiltIn) //多くはこれだ |
243 | - return 1; | |
243 | + return 0.1; | |
244 | 244 | else if(IsDomesticIndex) { |
245 | 245 | if(_code==(int)BuiltInIndex.Nikkei225_F) |
246 | 246 | return 1; |
@@ -263,7 +263,7 @@ namespace Zanetti.Data | ||
263 | 263 | public virtual string PriceFormatString { |
264 | 264 | get { |
265 | 265 | if(!IsBuiltIn) //多くはこれだ |
266 | - return "F0"; | |
266 | + return "F1"; | |
267 | 267 | else if(IsDomesticIndex) { |
268 | 268 | if(_code==(int)BuiltInIndex.Nikkei225_F) |
269 | 269 | return "F0"; |
@@ -478,12 +478,13 @@ namespace Zanetti.UI | ||
478 | 478 | //節 |
479 | 479 | int upmargin = _pref.InverseChart ? 5 : -5-_layout.DefaultTextHeight; |
480 | 480 | int downmargin = _pref.InverseChart ? -5-_layout.DefaultTextHeight : 5; |
481 | - if(td.Fushi==Fushi.High) | |
481 | + if(td.Fushi==Fushi.High) | |
482 | 482 | { |
483 | 483 | int y = (int)_priceTrans.TransValue(td.High)+upmargin; |
484 | 484 | if(ChartUtil.HasIntersectionY(clip, y, y + _layout.DefaultTextHeight)) { |
485 | - Win32.SetTextColor(hdc, Util.ToCOLORREF(_pref.FushiColor)); | |
486 | - string t = td.High.ToString(_brand.PriceFormatString); | |
485 | + Win32.SetTextColor(hdc, Util.ToCOLORREF(_pref.FushiColor)); | |
486 | + var bp = _brand.IsBuiltIn || td.High <= 5000 ? _brand.PriceFormatString : "F0"; | |
487 | + string t = td.High.ToString(bp); | |
487 | 488 | ChartUtil.DrawText(hdc, x-t.Length*_layout.DefaultTextWidth/2, y, t); |
488 | 489 | } |
489 | 490 | } |
@@ -491,7 +492,8 @@ namespace Zanetti.UI | ||
491 | 492 | int y = (int)_priceTrans.TransValue(td.Low)+downmargin; |
492 | 493 | if(ChartUtil.HasIntersectionY(clip, y, y + _layout.DefaultTextHeight)) { |
493 | 494 | Win32.SetTextColor(hdc, Util.ToCOLORREF(_pref.FushiColor)); |
494 | - string t = td.Low.ToString(_brand.PriceFormatString); | |
495 | + var bp = _brand.IsBuiltIn || td.High <= 5000 ? _brand.PriceFormatString : "F0"; | |
496 | + string t = td.Low.ToString(bp); | |
495 | 497 | ChartUtil.DrawText(hdc, x-t.Length*_layout.DefaultTextWidth/2, y, t); |
496 | 498 | } |
497 | 499 | low = true; |
@@ -671,11 +673,27 @@ namespace Zanetti.UI | ||
671 | 673 | if(td!=null) { |
672 | 674 | val = td.GetValue(ind); |
673 | 675 | } |
674 | - ChartUtil.DrawText(hdc, vx, y, Util.FormatFixedLenValue(val, 9, ind.GetFormatString(_brand), ind.FormatModifier)); | |
676 | + | |
677 | + ChartUtil.DrawText(hdc, vx, y, Util.FormatFixedLenValue(val, 9, RetFormatString(_brand, ind, val), ind.FormatModifier)); | |
675 | 678 | y += _layout.DefaultTextHeight; |
676 | 679 | } |
677 | 680 | } |
678 | 681 | |
682 | + private string RetFormatString(AbstractBrand br, Indicator ind, double val) | |
683 | + { | |
684 | + switch ((PrimitiveIndicator)ind.LaneID) | |
685 | + { | |
686 | + case PrimitiveIndicator.Open: | |
687 | + case PrimitiveIndicator.High: | |
688 | + case PrimitiveIndicator.Low: | |
689 | + case PrimitiveIndicator.Close: | |
690 | + if (!br.IsBuiltIn && val > 5000) | |
691 | + return "F0"; | |
692 | + break; | |
693 | + } | |
694 | + return ind.GetFormatString(br); | |
695 | + } | |
696 | + | |
679 | 697 | private void DrawExplanation(IntPtr hdc) { |
680 | 698 | Win32.SelectObject(hdc, _pref.DefaultHFont); |
681 | 699 | Win32.SetTextColor(hdc, Util.ToCOLORREF(_pref.TextColor)); |
@@ -0,0 +1,134 @@ | ||
1 | +namespace Zanetti | |
2 | +{ | |
3 | + partial class DecupleData | |
4 | + { | |
5 | + /// <summary> | |
6 | + /// Required designer variable. | |
7 | + /// </summary> | |
8 | + private System.ComponentModel.IContainer components = null; | |
9 | + | |
10 | + /// <summary> | |
11 | + /// Clean up any resources being used. | |
12 | + /// </summary> | |
13 | + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> | |
14 | + protected override void Dispose(bool disposing) | |
15 | + { | |
16 | + if (disposing && (components != null)) | |
17 | + { | |
18 | + components.Dispose(); | |
19 | + } | |
20 | + base.Dispose(disposing); | |
21 | + } | |
22 | + | |
23 | + #region Windows Form Designer generated code | |
24 | + | |
25 | + /// <summary> | |
26 | + /// Required method for Designer support - do not modify | |
27 | + /// the contents of this method with the code editor. | |
28 | + /// </summary> | |
29 | + private void InitializeComponent() | |
30 | + { | |
31 | + this.label1 = new System.Windows.Forms.Label(); | |
32 | + this.label2 = new System.Windows.Forms.Label(); | |
33 | + this.buttonOk = new System.Windows.Forms.Button(); | |
34 | + this.buttonIgnore = new System.Windows.Forms.Button(); | |
35 | + this.backgroundWorkerDecuple = new System.ComponentModel.BackgroundWorker(); | |
36 | + this.progressBar1 = new System.Windows.Forms.ProgressBar(); | |
37 | + this.labelProgress = new System.Windows.Forms.Label(); | |
38 | + this.SuspendLayout(); | |
39 | + // | |
40 | + // label1 | |
41 | + // | |
42 | + this.label1.Location = new System.Drawing.Point(13, 51); | |
43 | + this.label1.Name = "label1"; | |
44 | + this.label1.Size = new System.Drawing.Size(309, 43); | |
45 | + this.label1.TabIndex = 0; | |
46 | + this.label1.Text = "このバージョンのOmegaChartは、株価データが10倍の値で格納されていないと正しく動きません。既存の株価データが10倍でない可能性があります。"; | |
47 | + // | |
48 | + // label2 | |
49 | + // | |
50 | + this.label2.AutoSize = true; | |
51 | + this.label2.Location = new System.Drawing.Point(77, 23); | |
52 | + this.label2.Name = "label2"; | |
53 | + this.label2.Size = new System.Drawing.Size(174, 12); | |
54 | + this.label2.TabIndex = 1; | |
55 | + this.label2.Text = "株価データの値を10倍化しますか?"; | |
56 | + // | |
57 | + // buttonOk | |
58 | + // | |
59 | + this.buttonOk.Location = new System.Drawing.Point(166, 135); | |
60 | + this.buttonOk.Name = "buttonOk"; | |
61 | + this.buttonOk.Size = new System.Drawing.Size(75, 23); | |
62 | + this.buttonOk.TabIndex = 3; | |
63 | + this.buttonOk.Text = "OK"; | |
64 | + this.buttonOk.UseVisualStyleBackColor = true; | |
65 | + this.buttonOk.Click += new System.EventHandler(this.buttonOk_Click); | |
66 | + // | |
67 | + // buttonIgnore | |
68 | + // | |
69 | + this.buttonIgnore.DialogResult = System.Windows.Forms.DialogResult.Cancel; | |
70 | + this.buttonIgnore.Location = new System.Drawing.Point(247, 135); | |
71 | + this.buttonIgnore.Name = "buttonIgnore"; | |
72 | + this.buttonIgnore.Size = new System.Drawing.Size(75, 23); | |
73 | + this.buttonIgnore.TabIndex = 4; | |
74 | + this.buttonIgnore.Text = "終了"; | |
75 | + this.buttonIgnore.UseVisualStyleBackColor = true; | |
76 | + // | |
77 | + // backgroundWorkerDecuple | |
78 | + // | |
79 | + this.backgroundWorkerDecuple.WorkerReportsProgress = true; | |
80 | + this.backgroundWorkerDecuple.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorkerDecuple_DoWork); | |
81 | + this.backgroundWorkerDecuple.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundWorkerDecuple_ProgressChanged); | |
82 | + this.backgroundWorkerDecuple.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorkerDecuple_RunWorkerCompleted); | |
83 | + // | |
84 | + // progressBar1 | |
85 | + // | |
86 | + this.progressBar1.Location = new System.Drawing.Point(92, 100); | |
87 | + this.progressBar1.Name = "progressBar1"; | |
88 | + this.progressBar1.Size = new System.Drawing.Size(230, 19); | |
89 | + this.progressBar1.TabIndex = 2; | |
90 | + // | |
91 | + // labelProgress | |
92 | + // | |
93 | + this.labelProgress.Location = new System.Drawing.Point(17, 105); | |
94 | + this.labelProgress.Name = "labelProgress"; | |
95 | + this.labelProgress.Size = new System.Drawing.Size(69, 12); | |
96 | + this.labelProgress.TabIndex = 5; | |
97 | + this.labelProgress.Text = "進行状況"; | |
98 | + // | |
99 | + // DecupleData | |
100 | + // | |
101 | + this.AcceptButton = this.buttonIgnore; | |
102 | + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); | |
103 | + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |
104 | + this.CancelButton = this.buttonIgnore; | |
105 | + this.ClientSize = new System.Drawing.Size(335, 171); | |
106 | + this.Controls.Add(this.labelProgress); | |
107 | + this.Controls.Add(this.buttonIgnore); | |
108 | + this.Controls.Add(this.buttonOk); | |
109 | + this.Controls.Add(this.progressBar1); | |
110 | + this.Controls.Add(this.label2); | |
111 | + this.Controls.Add(this.label1); | |
112 | + this.MaximizeBox = false; | |
113 | + this.MinimizeBox = false; | |
114 | + this.Name = "DecupleData"; | |
115 | + this.Padding = new System.Windows.Forms.Padding(10); | |
116 | + this.ShowIcon = false; | |
117 | + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; | |
118 | + this.Text = "株価データ変換"; | |
119 | + this.ResumeLayout(false); | |
120 | + this.PerformLayout(); | |
121 | + | |
122 | + } | |
123 | + | |
124 | + #endregion | |
125 | + | |
126 | + private System.Windows.Forms.Label label1; | |
127 | + private System.Windows.Forms.Label label2; | |
128 | + private System.Windows.Forms.Button buttonOk; | |
129 | + private System.Windows.Forms.Button buttonIgnore; | |
130 | + private System.ComponentModel.BackgroundWorker backgroundWorkerDecuple; | |
131 | + private System.Windows.Forms.ProgressBar progressBar1; | |
132 | + private System.Windows.Forms.Label labelProgress; | |
133 | + } | |
134 | +} | |
\ No newline at end of file |
@@ -0,0 +1,132 @@ | ||
1 | +using System; | |
2 | +using System.ComponentModel; | |
3 | +using System.IO; | |
4 | +using System.Windows.Forms; | |
5 | +using Zanetti.Data; | |
6 | + | |
7 | +namespace Zanetti | |
8 | +{ | |
9 | + public partial class DecupleData : Form | |
10 | + { | |
11 | + public DecupleData() | |
12 | + { | |
13 | + InitializeComponent(); | |
14 | + } | |
15 | + | |
16 | + public static void Decuple() | |
17 | + { | |
18 | + if (IsDecoupled()) | |
19 | + return; | |
20 | + using (var dialog = new DecupleData()) | |
21 | + { | |
22 | + if (dialog.ShowDialog() == DialogResult.Cancel) | |
23 | + Application.Exit(); | |
24 | + } | |
25 | + } | |
26 | + | |
27 | + private static bool IsDecoupled() | |
28 | + { | |
29 | + var farm = Env.BrandCollection.FindBrand(9984).CreateFarm(ChartFormat.Daily); // ソフトバンクでテスト | |
30 | + if (farm.IsEmpty || farm.FirstDate >= 20140721) // そもそも過去のデータがない | |
31 | + return true; | |
32 | + var dates = new[] {20140718, 20140618, 20140519}; | |
33 | + var closes = new[] {7654, 7610, 6766}; | |
34 | + for (var i = 0; i < dates.Length; i++) | |
35 | + { | |
36 | + if (farm.LastDate < dates[i]) | |
37 | + continue; | |
38 | + var head = farm.DateToIndex(dates[i]) * DataFarm.RECORD_LENGTH; | |
39 | + return farm.GetInt(head + DataFarm.CLOSE_OFFSET) == closes[i] * 10; | |
40 | + } | |
41 | + return false; | |
42 | + } | |
43 | + | |
44 | + private void buttonOk_Click(object sender, EventArgs e) | |
45 | + { | |
46 | + buttonOk.Enabled = false; | |
47 | + buttonIgnore.Enabled = false; | |
48 | + Cursor = Cursors.WaitCursor; | |
49 | + backgroundWorkerDecuple.RunWorkerAsync(); | |
50 | + } | |
51 | + | |
52 | + private void backgroundWorkerDecuple_DoWork(object sender, DoWorkEventArgs e) | |
53 | + { | |
54 | + var worker = (BackgroundWorker)sender; | |
55 | + Backup(worker); | |
56 | + Convert(worker); | |
57 | + } | |
58 | + | |
59 | + private void Backup(BackgroundWorker worker) | |
60 | + { | |
61 | + var org = Path.Combine(Env.GetAppDir(), @"data"); | |
62 | + var back = Path.Combine(Env.GetAppDir(), @"data\back"); | |
63 | + if (Directory.Exists(back)) | |
64 | + throw new Exception(back + "\nバックアップディレクトリが存在します。\n移動するか削除してからやり直してください。"); | |
65 | + Directory.CreateDirectory(back); | |
66 | + worker.ReportProgress(0, "バックアップ中"); | |
67 | + var files = Directory.CreateDirectory(org).GetFiles(); | |
68 | + var i = 0; | |
69 | + foreach (var finfo in files) | |
70 | + { | |
71 | + finfo.CopyTo(Path.Combine(back, finfo.Name)).LastWriteTime = finfo.LastWriteTime; | |
72 | + worker.ReportProgress(100 * i++ / files.Length, "バックアップ中"); | |
73 | + } | |
74 | + } | |
75 | + | |
76 | + private void Convert(BackgroundWorker worker) | |
77 | + { | |
78 | + var i = 0; | |
79 | + worker.ReportProgress(0, "変換中"); | |
80 | + foreach (AbstractBrand br in Env.BrandCollection.Values) | |
81 | + { | |
82 | + var basic = br as BasicBrand; | |
83 | + if (basic == null || basic.Market == MarketType.B || basic.Market == MarketType.Custom) | |
84 | + continue; | |
85 | + using (var farm = (DailyDataFarm)br.CreateDailyFarm(0)) | |
86 | + { | |
87 | + if (!farm.IsEmpty) | |
88 | + { | |
89 | + DoupleFarm(farm); | |
90 | + farm.Save(Util.GetDailyDataFileName(br.Code)); | |
91 | + } | |
92 | + } | |
93 | + worker.ReportProgress(100 * i++ / Env.BrandCollection.StockBrandCount, "変換中"); | |
94 | + } | |
95 | + } | |
96 | + | |
97 | + private void DoupleFarm(DataFarm farm) | |
98 | + { | |
99 | + for (var i = 0; i < farm.FilledLength; i++) | |
100 | + { | |
101 | + var head = i * DataFarm.RECORD_LENGTH; | |
102 | + var open = farm.GetInt(head + DataFarm.OPEN_OFFSET); | |
103 | + var high = farm.GetInt(head + DataFarm.HIGH_OFFSET); | |
104 | + var low = farm.GetInt(head + DataFarm.LOW_OFFSET); | |
105 | + var close = farm.GetInt(head + DataFarm.CLOSE_OFFSET); | |
106 | + | |
107 | + var raw = farm.RawDataImage; | |
108 | + DataFarm.SetInt(raw, head + DataFarm.OPEN_OFFSET, open * 10); | |
109 | + DataFarm.SetInt(raw, head + DataFarm.HIGH_OFFSET, high * 10); | |
110 | + DataFarm.SetInt(raw, head + DataFarm.LOW_OFFSET, low * 10); | |
111 | + DataFarm.SetInt(raw, head + DataFarm.CLOSE_OFFSET, close * 10); | |
112 | + } | |
113 | + } | |
114 | + | |
115 | + private void backgroundWorkerDecuple_ProgressChanged(object sender, ProgressChangedEventArgs e) | |
116 | + { | |
117 | + labelProgress.Text = (string)e.UserState; | |
118 | + progressBar1.Value = e.ProgressPercentage; | |
119 | + } | |
120 | + | |
121 | + private void backgroundWorkerDecuple_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) | |
122 | + { | |
123 | + if (e.Error != null) | |
124 | + { | |
125 | + MessageBox.Show(e.Error.Message, "変換エラー", MessageBoxButtons.OK, MessageBoxIcon.Error); | |
126 | + Application.Exit(); | |
127 | + } | |
128 | + DialogResult = DialogResult.OK; | |
129 | + Close(); | |
130 | + } | |
131 | + } | |
132 | +} | |
\ No newline at end of file |
@@ -0,0 +1,123 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | +<root> | |
3 | + <!-- | |
4 | + Microsoft ResX Schema | |
5 | + | |
6 | + Version 2.0 | |
7 | + | |
8 | + The primary goals of this format is to allow a simple XML format | |
9 | + that is mostly human readable. The generation and parsing of the | |
10 | + various data types are done through the TypeConverter classes | |
11 | + associated with the data types. | |
12 | + | |
13 | + Example: | |
14 | + | |
15 | + ... ado.net/XML headers & schema ... | |
16 | + <resheader name="resmimetype">text/microsoft-resx</resheader> | |
17 | + <resheader name="version">2.0</resheader> | |
18 | + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |
19 | + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |
20 | + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |
21 | + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |
22 | + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |
23 | + <value>[base64 mime encoded serialized .NET Framework object]</value> | |
24 | + </data> | |
25 | + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |
26 | + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |
27 | + <comment>This is a comment</comment> | |
28 | + </data> | |
29 | + | |
30 | + There are any number of "resheader" rows that contain simple | |
31 | + name/value pairs. | |
32 | + | |
33 | + Each data row contains a name, and value. The row also contains a | |
34 | + type or mimetype. Type corresponds to a .NET class that support | |
35 | + text/value conversion through the TypeConverter architecture. | |
36 | + Classes that don't support this are serialized and stored with the | |
37 | + mimetype set. | |
38 | + | |
39 | + The mimetype is used for serialized objects, and tells the | |
40 | + ResXResourceReader how to depersist the object. This is currently not | |
41 | + extensible. For a given mimetype the value must be set accordingly: | |
42 | + | |
43 | + Note - application/x-microsoft.net.object.binary.base64 is the format | |
44 | + that the ResXResourceWriter will generate, however the reader can | |
45 | + read any of the formats listed below. | |
46 | + | |
47 | + mimetype: application/x-microsoft.net.object.binary.base64 | |
48 | + value : The object must be serialized with | |
49 | + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | |
50 | + : and then encoded with base64 encoding. | |
51 | + | |
52 | + mimetype: application/x-microsoft.net.object.soap.base64 | |
53 | + value : The object must be serialized with | |
54 | + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |
55 | + : and then encoded with base64 encoding. | |
56 | + | |
57 | + mimetype: application/x-microsoft.net.object.bytearray.base64 | |
58 | + value : The object must be serialized into a byte array | |
59 | + : using a System.ComponentModel.TypeConverter | |
60 | + : and then encoded with base64 encoding. | |
61 | + --> | |
62 | + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |
63 | + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |
64 | + <xsd:element name="root" msdata:IsDataSet="true"> | |
65 | + <xsd:complexType> | |
66 | + <xsd:choice maxOccurs="unbounded"> | |
67 | + <xsd:element name="metadata"> | |
68 | + <xsd:complexType> | |
69 | + <xsd:sequence> | |
70 | + <xsd:element name="value" type="xsd:string" minOccurs="0" /> | |
71 | + </xsd:sequence> | |
72 | + <xsd:attribute name="name" use="required" type="xsd:string" /> | |
73 | + <xsd:attribute name="type" type="xsd:string" /> | |
74 | + <xsd:attribute name="mimetype" type="xsd:string" /> | |
75 | + <xsd:attribute ref="xml:space" /> | |
76 | + </xsd:complexType> | |
77 | + </xsd:element> | |
78 | + <xsd:element name="assembly"> | |
79 | + <xsd:complexType> | |
80 | + <xsd:attribute name="alias" type="xsd:string" /> | |
81 | + <xsd:attribute name="name" type="xsd:string" /> | |
82 | + </xsd:complexType> | |
83 | + </xsd:element> | |
84 | + <xsd:element name="data"> | |
85 | + <xsd:complexType> | |
86 | + <xsd:sequence> | |
87 | + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |
88 | + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |
89 | + </xsd:sequence> | |
90 | + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |
91 | + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |
92 | + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |
93 | + <xsd:attribute ref="xml:space" /> | |
94 | + </xsd:complexType> | |
95 | + </xsd:element> | |
96 | + <xsd:element name="resheader"> | |
97 | + <xsd:complexType> | |
98 | + <xsd:sequence> | |
99 | + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |
100 | + </xsd:sequence> | |
101 | + <xsd:attribute name="name" type="xsd:string" use="required" /> | |
102 | + </xsd:complexType> | |
103 | + </xsd:element> | |
104 | + </xsd:choice> | |
105 | + </xsd:complexType> | |
106 | + </xsd:element> | |
107 | + </xsd:schema> | |
108 | + <resheader name="resmimetype"> | |
109 | + <value>text/microsoft-resx</value> | |
110 | + </resheader> | |
111 | + <resheader name="version"> | |
112 | + <value>2.0</value> | |
113 | + </resheader> | |
114 | + <resheader name="reader"> | |
115 | + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
116 | + </resheader> | |
117 | + <resheader name="writer"> | |
118 | + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |
119 | + </resheader> | |
120 | + <metadata name="backgroundWorkerDecuple.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |
121 | + <value>17, 17</value> | |
122 | + </metadata> | |
123 | +</root> | |
\ No newline at end of file |
@@ -73,7 +73,7 @@ namespace Zanetti.DataSource.Specialized | ||
73 | 73 | (d2.Year < 2006 ? !CheckMarketOld(br.Market, tokens[8]) : !CheckMarket(br.Market, tokens[2]))) |
74 | 74 | continue; |
75 | 75 | var vv = IsIndex(code) ? 0.001 : 1; |
76 | - var pv = IsIndex(code) ? 100 : 1; | |
76 | + var pv = IsIndex(code) ? 100 : 10; // 指数は100倍、株価は10倍で記録。 | |
77 | 77 | result[code] = new NewDailyData |
78 | 78 | { |
79 | 79 | open = (int)(double.Parse(tokens[3]) * pv), |
@@ -143,13 +143,14 @@ namespace Zanetti.DataSource.Specialized | ||
143 | 143 | if (br == null || !CheckMarket(br.Market, tokens[1])) |
144 | 144 | continue; |
145 | 145 | var volume = (int)ParseField(tokens[8]); |
146 | + const int shift = 10; // 株価は10倍で記録 | |
146 | 147 | var td = new NewDailyData |
147 | 148 | { |
148 | 149 | volume = volume, |
149 | - open = (int)ParseField(tokens[4]), | |
150 | - high = (int)ParseField(tokens[5]), | |
151 | - low = (int)ParseField(tokens[6]), | |
152 | - close = (int)ParseField(tokens[7]) | |
150 | + open = (int)(ParseField(tokens[4]) * shift), | |
151 | + high = (int)(ParseField(tokens[5]) * shift), | |
152 | + low = (int)(ParseField(tokens[6]) * shift), | |
153 | + close = (int)(ParseField(tokens[7]) * shift) | |
153 | 154 | }; |
154 | 155 | result[code] = td; |
155 | 156 | } |
@@ -997,7 +997,8 @@ namespace Zanetti.Forms | ||
997 | 997 | this.Cursor = Cursors.AppStarting; |
998 | 998 | _asyncLoader = new AsyncSchemaLoader(this); |
999 | 999 | _asyncLoader.AsyncLoad(); |
1000 | - } | |
1000 | + DecupleData.Decuple(); // データの10倍化 | |
1001 | + } | |
1001 | 1002 | protected override void OnClosing(CancelEventArgs e) { |
1002 | 1003 | base.OnClosing (e); |
1003 | 1004 | Env.Options.FrameLocation = new Rectangle(this.Location, this.Size); |
@@ -91,7 +91,7 @@ namespace Zanetti.DataSource.Specialized { | ||
91 | 91 | BasicBrand br = Env.BrandCollection.FindBrand(code) as BasicBrand; |
92 | 92 | if(br!=null && CheckMarket(br, Util.ParseInt(t[2], 0))) { |
93 | 93 | |
94 | - double vv = 1, pv = 1; | |
94 | + double vv = 1, pv = 10; // 株価は10倍で記録 | |
95 | 95 | //倍率調整 |
96 | 96 | if(IsDomesticIndex(code)) { |
97 | 97 | vv = 0.001; //DreamVisorのものにあわせる格好で。1000株単位かな |
@@ -252,7 +252,7 @@ namespace Zanetti.DataSource.Specialized | ||
252 | 252 | } |
253 | 253 | try |
254 | 254 | { |
255 | - var shift = IsIndex(code) ? 100 : 1; | |
255 | + var shift = IsIndex(code) ? 100 : 10; // 指数は100倍、株式は10倍で記録する | |
256 | 256 | const NumberStyles s = NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands; |
257 | 257 | foreach (Match m in matches) |
258 | 258 | { |
@@ -109,6 +109,12 @@ | ||
109 | 109 | <SubType>Form</SubType> |
110 | 110 | </Compile> |
111 | 111 | <Compile Include="Data.cs" /> |
112 | + <Compile Include="DecupleData.cs"> | |
113 | + <SubType>Form</SubType> | |
114 | + </Compile> | |
115 | + <Compile Include="DecupleData.Designer.cs"> | |
116 | + <DependentUpon>DecupleData.cs</DependentUpon> | |
117 | + </Compile> | |
112 | 118 | <Compile Include="DataSource.cs" /> |
113 | 119 | <Compile Include="DateRangeChecker.cs" /> |
114 | 120 | <Compile Include="DisplayKitTemplateDialog.cs"> |
@@ -226,6 +232,9 @@ | ||
226 | 232 | <DependentUpon>CustomizeDialog.cs</DependentUpon> |
227 | 233 | <SubType>Designer</SubType> |
228 | 234 | </EmbeddedResource> |
235 | + <EmbeddedResource Include="DecupleData.resx"> | |
236 | + <DependentUpon>DecupleData.cs</DependentUpon> | |
237 | + </EmbeddedResource> | |
229 | 238 | <EmbeddedResource Include="DisplayKitTemplateDialog.resx"> |
230 | 239 | <DependentUpon>DisplayKitTemplateDialog.cs</DependentUpon> |
231 | 240 | <SubType>Designer</SubType> |