Beispiel #1
0
        public void putOrderExeEvents(ExecutionMessage message, String stgNo)
        {
            String side = message.Execution.Side;
            int    bqty = 0;
            int    sqty = 0;

            if ("BOT".Equals(side))
            {
                bqty = message.Execution.Shares;
            }
            if ("SLD".Equals(side))
            {
                sqty = message.Execution.Shares;
            }

            AppOrderExecutedEvent exeEvent = new AppOrderExecutedEvent();

            exeEvent.TickerName = message.Contract.LocalSymbol;
            exeEvent.BQty       = bqty.ToString();
            exeEvent.SQty       = sqty.ToString();
            exeEvent.Price      = message.Execution.Price.ToString();
            exeEvent.SNo        = stgNo;
            exeEvent.Status     = "Filled";
            exeEvent.Time       = message.Execution.Time;

            IAppMainteanceManager maintenanceManager = stgManager.getAppMainteanceManager();

            if (maintenanceManager != null)
            {
                maintenanceManager.storeEventQueue.Add(exeEvent);
            }
        }
Beispiel #2
0
 public void run(Object argObj)
 {
     while (true)
     {
         AppEvent appEvent = storeEventQueue.Take();
         if (appEvent.Type.Equals(AppEventType.TimeEvent))
         {
             AppTimeEvent timeEvent = (AppTimeEvent)appEvent;
             handleDailyAllFlagsReset(timeEvent);
             handleResetRTBRequest(timeEvent);
             handleDailyDayEndExport(timeEvent);
             handleHBEmail(timeEvent);
         }
         if (appEvent.Type.Equals(AppEventType.OrderExecuted))
         {
             AppOrderExecutedEvent exeEvent = (AppOrderExecutedEvent)appEvent;
             handOrderExeEvent(exeEvent);
         }
     }
 }
Beispiel #3
0
        public void handOrderExeEvent(AppOrderExecutedEvent exeEvent)
        {
            UserPref pref        = stgManager.ParentUI.getUserPref();
            Boolean  isSendEmail = pref.sendEmail;
            Boolean  isPlaySound = pref.playSound;

            if (!isSendEmail)
            {
                return;
            }
            ISendMailManager manager   = SendMailManager.getManager();
            String           emailBody = "";
            String           template  = "Ticker Name:[0], BQty=[1], SQty=[2], Price=[3], Time=[4], Status=[5], SNo=[6]\n";

            emailBody += template.Replace("[0]", exeEvent.TickerName).Replace("[1]", exeEvent.BQty).Replace("[2]", exeEvent.SQty).Replace("[3]", exeEvent.Price)
                         .Replace("[4]", exeEvent.Time).Replace("[5]", exeEvent.Status).Replace("[6]", exeEvent.SNo);
            manager.SendEmail("<AlgoEdge Alert> ***Execution*** : from " + System.Environment.MachineName + " " + exeEvent.Time, emailBody);
            if (isPlaySound)
            {
                playTradeAlertSound();
            }
        }