Пример #1
0
 private void LoadTradeSignals()
 {
     SharpRepo.InitDefault();
     signals = SharpRepo.GetSignals(accountId, symbol);
     signals.ForEach(s =>
     {
         var shift = s.Time.Second > 30;
         s.Time    = new DateTime(s.Time.Year, s.Time.Month, s.Time.Day, s.Time.Hour, s.Time.Minute, 0);
         if (shift)
         {
             s.Time = s.Time.AddMinutes(1);
         }
     });
 }
Пример #2
0
 private static void SaveSignals(string s, int accountId, string symbol)
 {
     try
     {
         var fname = ExecutablePath.Combine(s.Substring("save ".Length));
         SharpRepo.InitDefault();
         var signals = SharpRepo.GetSignals(accountId, symbol);
         SharpRepo.SaveSignalsToFile(fname, signals);
     }
     catch (Exception e)
     {
         Console.WriteLine("Error: " + e);
     }
 }