Exemple #1
0
        public static zBuySell FromBuySell(BuySell buySell)
        {
            string   sSide = buySell.ToString();
            zBuySell side  = (zBuySell)Enum.Parse(typeof(zBuySell), sSide, true);

            return(side);
        }
Exemple #2
0
        public EZFill(DateTime fillTime, EZInstrument instrument, zBuySell buySell, ezQuantity quantity, ezPrice price, zFillType fillType)
        {
            TimeZoneInfo cst       = TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time");
            DateTime     localTime = TimeZoneInfo.ConvertTimeFromUtc(fillTime, cst);

            DateTime time         = localTime;
            string   timeStr      = time.ToString("H:mm:ss.fff");
            string   shortTimeStr = time.ToString("hh:mm:ss tt");

            Time           = timeStr;
            ShortTime      = shortTimeStr;
            Identifiers    = ""; // GetFillIdenifiers(fill);
            Instrument     = instrument;
            BuySell        = buySell;
            InstrumentName = ""; // ParseInstrumentKey(fill.InstrumentKey.ToString());
            Quantity       = quantity;
            Price          = price;
            FFT2           = ""; // fill.FFT2;
            FFT3           = ""; // fill.FFT3;
            FillType       = fillType;
            //_fill = fill;
            Originator         = FillOriginator.TRADER;
            Action             = FillAction.ADD;
            ReplacementForFill = null;
        }
Exemple #3
0
        public static BuySell ToBuySell(zBuySell buySell)
        {
            string  sSide = buySell.ToString();
            BuySell side  = (BuySell)Enum.Parse(typeof(BuySell), sSide, true);

            return(side);
        }
Exemple #4
0
 public ezSpreadLeg(EZInstrument instrument, zBuySell buySell, int executeSize, double priceMultiplier)
 {
     this.Instrument      = instrument;
     this.buySell         = buySell;
     this.executeSize     = executeSize;
     this.priceMultiplier = priceMultiplier;
 }
 public EZOrder(ezInstrumentKey instrumentKey, zBuySell buySell, ezQuantity quantity, ezPrice price)
 {
     InstrumentKey = instrumentKey;
     BuySell       = buySell;
     _quantity     = quantity;
     _price        = price;
     Status        = EZOrderStatus.None;
 }
Exemple #6
0
 private void chkSell_Click(object sender, EventArgs e)
 {
     if (chkSell.Checked == true)
     {
         entrySide      = zBuySell.Sell;
         chkBuy.Checked = false;
     }
     else
     {
         entrySide      = zBuySell.Buy;
         chkBuy.Checked = true;
     }
     FormatBuySellButtons();
 }
        private void SendOrder(zBuySell buySell, zOrderType orderType, int qty, double price)
        {
            //OrderRoute.GetOrderRoute(this, this.Market.Name);

            /*ezOrderProfile prof = new ezOrderProfile(OrderRoute.OrderFeed, TTAPI_Instrument);
             * prof.BuySell = buySell;
             * prof.OrderType = orderType;
             * prof.OrderQuantity = ezQuantity.FromInt(this, qty);
             * prof.LimitPrice = ezPrice.FromDouble(this, price);
             * prof.AccountType = OrderRoute.AccountType;
             * prof.AccountName = OrderRoute.AccountName;
             * TTAPI_Instrument.Session.SendOrder(prof);
             */
            APIMain.SendOrder();
        }
 private void SendLimitOrder(zBuySell buySell, int qty, double price)
 {
     /*
      * ezOrderFeed feed = GetOrderFeed();
      * zLaunchReturnCode lrc = SpreadInstrument.LaunchToOrderFeed(feed);
      * if (lrc == zLaunchReturnCode.Success)
      * {
      *  ezAutospreaderSyntheticOrderProfile prof = new ezAutospreaderSyntheticOrderProfile(feed, SpreadInstrument);
      *  prof.BuySell = buySell;
      *  prof.OrderQuantity = ezQuantity.FromInt(SpreadInstrument, qty);
      *  prof.OrderType = zOrderType.Limit;
      *  prof.LimitPrice = ezPrice.FromDouble(SpreadInstrument, price);
      *
      *  if (!SpreadInstrument.Session.SendOrder(prof))
      *  {
      *      Console.WriteLine("send order failed: {0}", prof.RoutingStatus.Message);
      *  }
      * }
      */
 }
Exemple #9
0
        public TradeBuilderForm()
        {
            InitializeComponent();

            api = APIMain.Instance;

            this.DialogResult = DialogResult.Abort;

            initialTradeNameText = txtTradeName.Text;
            // Default to a buy-side entry.
            entrySide = zBuySell.Buy;

            tradeStepPanels = new CircularLinkedList <TradeRulePanelControl>();
            tradeStepPanels.AddFirst(panelPreconditions);
            tradeStepPanels.AddLast(panelStop);
            tradeStepPanels.AddLast(panelExit);
            tradeStepPanels.AddLast(panelEntry);

            ChangeActivePanel(tradeStepPanels.Head);

            ruleChooserForm             = new RuleChooserForm(this);
            ruleChooserForm.RuleSelect += ruleChooserForm_RuleSelect;
        }