Ejemplo n.º 1
0
        public int filledUpdateDb(double fillPrice, LiveSystem liveSystem, string topicPrefix)
        {
            int liveOrderId;

            if (ferretSubmission == null)
            {
                liveOrderId = LiveOrders.ORDERS.insert(
                    liveSystem.id(), symbol.name, jDate(now()), null, enterExit(),
                    positionDirection().ToString(), size, new java.lang.Double(fillPrice),
                    details.ToString(), description, hostname(), topicPrefix, null
                    );
            }
            else
            {
                liveOrderId = ferretSubmission.liveOrderId;
                var submitted = LiveOrders.ORDERS.order(liveOrderId);
                submitted.updateFill(fillPrice, jDate(now()));
            }
            Db.commit();
            OrderTable.topic().send(new Dictionary <string, object> {
                { "liveOrderId", liveOrderId },
                { "timestamp", ymdHuman(now()) }
            });
            return(liveOrderId);
        }
Ejemplo n.º 2
0
        public int submittedInsertDb(LiveSystem liveSystem, string topicPrefix)
        {
            var positionDir = hasPosition() ? positionDirection() : direction;
            var liveOrderId = LiveOrders.ORDERS.insert(
                liveSystem.id(), symbol.name, null, jDate(now()), enterExit(),
                positionDir.ToString(), size, null,
                details.ToString(), description, hostname(), topicPrefix, ferretSubmission.id
                );

            Db.commit();
            OrderTable.topic().send(new Dictionary <string, object> {
                { "liveOrderId", liveOrderId },
                { "timestamp", now() }
            });
            return(liveOrderId);
        }