Exemplo 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("---------------------------");
 }
Exemplo n.º 2
0
 internal static void LogNoStopOrderFound(LoggingConfig config)
 {
     if (config.IsWarnEnabled)
     {
         WriteWarn(config, "No STOP price has been defined");
     }
 }
Exemplo 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);
     }
 }
Exemplo 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);
     }
 }
Exemplo 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);
     }
 }
Exemplo n.º 6
0
 public PriceCalculator(LoggingConfig logConfig)
 {
     this.logConfig = logConfig;
 }
 public QuantityCalculator(LoggingConfig logConfig)
 {
     this.logConfig = logConfig;
 }
Exemplo 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);
     }
 }
Exemplo 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("---------------------------");
 }
Exemplo 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));
 }
Exemplo n.º 11
0
 internal static void WriteError(LoggingConfig config, string message)
 {
     Console.WriteLine(string.Format(ERR_STRING, DateTime.Now, config.Instrument.Symbol, message));
 }
Exemplo 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));
 }
Exemplo n.º 13
0
 public StopPriceManager(LoggingConfig logConfig)
 {
     this.logConfig = logConfig;
 }