Files
spark/src/client/sparkcmd/Cmd/Historical/StaticAnalysis/Microscope.cs
T

55 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using MathNet.Numerics.Statistics;
using System.Text;
using System.IO;
using mbts.config;
using bts.config;
using bts.api.orderman;
using Google.Protobuf.WellKnownTypes;
using System.Threading.Tasks;
using System.Collections.Concurrent;
namespace bts.history{
class Microscope{
enum Actions{
Book,
Trade,
Order
}
// looks deeper into the data for
// 1. book updates for <contract,date>* bw msg seq no's
// 2. book updates for <contract,date>* bw t1 and t2
// 3. book turn stats
// 4. trades
// 5. orders
//(writes output to csv that can be plotted in some cases)
public Microscope(HistoricalDataOptions hd_options){
Console.WriteLine("Miscroscope:Hit key to continue:"); Console.ReadKey();
//book,symbol,date,contract,m1,m2
string[] args = hd_options.algo_params.Split(',');
if (Actions.Book.ToString().ToLower()==args[0].ToLower()){
string symbol = args[1];
DateTime dt = DateTime.Parse(args[2]);
string contract = args[3];
UInt32 m1 = UInt32.Parse(args[4]),
m2 = UInt32.Parse(args[5]);
BookSeries bser = MarketQueriesHelper.get_book_state(symbol,
contract,
dt);
var books = MarketQueries.find_in_range(bser,m1,m2);
foreach (BookEntry b in books)
Console.WriteLine(MarketQueriesHelper.book_entry_to_csv(b));
}
}
public void analyze(){
}
private static void _analyze_book(){
}
}
}