Example #1
0
        public ExecutionStatus GetExecutionStatus(string strategyName)
        {
            ExecutionStatus status = null;

            if (strategyName != null && executionStatus.ContainsKey(strategyName))
            {
                status = executionStatus[strategyName];
            }

            return(status);
        }
Example #2
0
        public void Sell(EZInstrument instrument, int quantity, string strategyName)
        {
            if (strategyName != null)
            {
                executionStatus[strategyName] = new ExecutionStatus(strategyName);
            }

            ezPrice bid = instrument.Bid;

            EZOrder ezo = api.SellLimit(instrument, quantity, bid, strategyName);

            StoreOrder(strategyName, ezo);

            Spy.Print("SELL: {0} @ {1}", quantity, bid);
        }
Example #3
0
        public void Buy(EZInstrument instrument, int quantity, string strategyName)
        {
            if (strategyName != null)
            {
                executionStatus[strategyName] = new ExecutionStatus(strategyName);
                executionStatus[strategyName].quantitySubmitted = quantity;
            }

            ezPrice ask = instrument.Ask;

            EZOrder ezo = api.BuyLimit(instrument, quantity, ask, strategyName);

            StoreOrder(strategyName, ezo);

            Spy.Print("BUY: {0} @ {1}", quantity, ask);
        }