Esempio n. 1
0
 internal static void LogOrder(LoggingConfig config, string orderName, OrderSide orderSide, double qty, double price, int retryCount)
 {
     Console.WriteLine("---------------------------");
     string message = string.Format("{0} - {1} {2} @ {3} for {4:C}", orderName, orderSide, qty, price, qty * price);
     Console.WriteLine(string.Format(ORDER_STRING, DateTime.Now, config.Instrument.Symbol, message, retryCount));
     Console.WriteLine("---------------------------");
 }
Esempio n. 2
0
 internal static void LogNoStopOrderFound(LoggingConfig config)
 {
     if (config.IsWarnEnabled)
     {
         WriteWarn(config, "No STOP price has been defined");
     }
 }
Esempio n. 3
0
 internal static void LogOrderQueued(LoggingConfig config, string orderStyle, string symbol, DateTime time)
 {
     if (config.IsInfoEnabled)
     {
         string message = string.Format("{0} order queued for {1} @ {2}", orderStyle, symbol, time);
         WriteInfo(config, message);
     }
 }
Esempio n. 4
0
 internal static void LogCurrentBarArrival(LoggingConfig config, Bar bar)
 {
     if (config.IsDebugEnabled)
     {
         string message = string.Format("Bar with begin time {0} arrived: {1}", bar.BeginTime, bar);
         WriteDebug(config, message);
     }
 }
Esempio n. 5
0
 internal static void LogOkToTriggerOrder(LoggingConfig config, Bar bar)
 {
     if (config.IsInfoEnabled)
     {
         string message = string.Format("It is OK to trigger the trade @ bar: {0}", bar);
         Console.WriteLine();
         WriteInfo(config, message);
     }
 }
 public PriceCalculator(LoggingConfig logConfig)
 {
     this.logConfig = logConfig;
 }
 public QuantityCalculator(LoggingConfig logConfig)
 {
     this.logConfig = logConfig;
 }
Esempio n. 8
0
 internal static void LogStopOrderQueued(LoggingConfig config, string orderStyle, string symbol, DateTime time, double stopPrice)
 {
     if (config.IsInfoEnabled)
     {
         string message = string.Format("{0} stop order queued for {1} @ {2} at a stop price of {3:c}", orderStyle, symbol, time, stopPrice);
         WriteInfo(config, message);
     }
 }
Esempio n. 9
0
 internal static void LogRetryOrder(LoggingConfig config, Bar bar, int retryNumber)
 {
     Console.WriteLine("---------------------------");
     string message = string.Format("RETRYING THE ORDER. RETRY #{0} @ Bar: {1}", retryNumber, bar);
     WriteWarn(config, message);
     Console.WriteLine("---------------------------");
 }
Esempio n. 10
0
 internal static void WriteWarn(LoggingConfig config, string message)
 {
     if (config.IsWarnEnabled)
         Console.WriteLine(string.Format(WARN_STRING, DateTime.Now, config.Instrument.Symbol, message));
 }
Esempio n. 11
0
 internal static void WriteError(LoggingConfig config, string message)
 {
     Console.WriteLine(string.Format(ERR_STRING, DateTime.Now, config.Instrument.Symbol, message));
 }
Esempio n. 12
0
 internal static void WriteDebug(LoggingConfig config, string message)
 {
     if (config.IsDebugEnabled)
         Console.WriteLine(string.Format(DEBUG_STRING, DateTime.Now, config.Instrument.Symbol, message));
 }
Esempio n. 13
0
 public StopPriceManager(LoggingConfig logConfig)
 {
     this.logConfig = logConfig;
 }