Reading binary or dat file
Created at 27 Sep 2016, 10:09
ST
Reading binary or dat file
27 Sep 2016, 10:09
Hello,
I am new to cTrader and I would like to test my code and see if it can read a DAT file before I attach it to a chart. How can I go about this? Below is my code.
private bool FileRead() { string _run_file = "@C:\\cAlgo\\" + _FILE; if (!File.Exists(_run_file)) { Print(_run_file + " does not exist! "); return false; } using (BinaryReader _binary = new BinaryReader(File.Open(_run_file, FileMode.Open))) { string _build_time = _binary.ReadString(); _instrument.build_time = DateTime.Parse(_build_time); Print(" BUILD OF: " + _instrument.build_time.ToString()); int _capacity = _binary.ReadInt32(); Print(" BUILD AT: " + _capacity.ToString());// How can I read this from cTrader } return true; }
stevennjuki
27 Sep 2016, 10:44
To my point, if I attach the bot below to a chart I do not see the print message in either the journal or the log.
@stevennjuki