Bid Ask History prices?
Bid Ask History prices?
07 May 2016, 19:40
Hello everybody.. Got a bot that exporting chat data to Excel CSV file, the code for it is this:
using System;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
namespace cAlgo
{
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]
public class DumpToCSV : Robot
{
protected override void OnStop()
{
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
var desktopFolder = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
var folderPath = Path.Combine(desktopFolder, "FXP-Files");
Directory.CreateDirectory(folderPath);
var filePath = Path.Combine(folderPath, Symbol.Code + " " + TimeFrame + ".csv");
using (var writer = File.CreateText(filePath))
{
for (var i = 0; i < MarketSeries.Open.Count + 1; i++)
{
writer.WriteLine(ConcatWithComma(MarketSeries.OpenTime[i].AddHours(3), MarketSeries.OpenTime[i].AddHours(3).DayOfWeek, MarketSeries.OpenTime[i].AddHours(3).Hour, MarketSeries.Open[i], MarketSeries.High[i], MarketSeries.Low[i], MarketSeries.Close[i], MarketSeries.TickVolume[i]));
}
writer.WriteLine("Done.");
Console.WriteLine("Done.");
}
}
private string ConcatWithComma(params object[] parameters)
{
return string.Join(",", parameters.Select(p => p.ToString()));
}
}
}
But this one just exporting bid or ask data, and i need both..
Can anyone help? please!..
Also does anyone knows how to view the Console for the cAlgo like with Visual Studio to see all the processes? [i added the "Done" message to the code but i do not see it]
Thanks ahead and have a nice day..