Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- class Algorithms{
- //Create an array, find the specified file and input every line of the file into the array
- static string[] dates = System.IO.File.ReadAllLines(@"Date.txt");
- static string[] days = System.IO.File.ReadAllLines(@"Day.txt");
- static string[] SH1Close = System.IO.File.ReadAllLines(@"SH1_Close.txt");
- static string[] SH1Diff = System.IO.File.ReadAllLines(@"SH1_Diff.txt");
- static string[] SH1Open = System.IO.File.ReadAllLines(@"SH1_Open.txt");
- static string[] SH1Vol = System.IO.File.ReadAllLines(@"SH1_Volume.txt");
- static string[] SH2Close = System.IO.File.ReadAllLines(@"SH2_Close.txt");
- static string[] SH2Diff = System.IO.File.ReadAllLines(@"SH2_Diff.txt");
- static string[] SH2Open = System.IO.File.ReadAllLines(@"SH2_Open.txt");
- static string[] SH2Vol = System.IO.File.ReadAllLines(@"SH2_Volume.txt");
- public static void Main(string[] args){
- //Create array of different data types so dates can be read and sorted properly
- int[] iDates = new int[dates.Length];
- //Converts the initial arrays into the correct data types
- iDays = iConvert(iDates,dates);
- for(int i = 0; i < iDates.Length; i++){
- Console.WriteLine(iDates[i]);
- }
- }
- //Methods for converting array to appropriate data type
- public static int[] iConvert(int[] a, string[] b){
- for(int i = 0; i < a.Length; i++){
- int temp = Convert.ToInt32(b[i]);
- a[i] = temp;
- }
- return a;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement