public void ShowFloorBenchmarkInfo(PositionList info, string Name, List <PositionList> PosList) { FloorName = Name; PerName = info.Name; PersonnelPositionListMonths = new List <PositionList>(); PersonnelPositionListMonths.AddRange(PosList); var array = info.Name.Split(new char[2] { '(', ')' }); if (array != null && array.Length > 2) { if (string.IsNullOrEmpty(array[0])) { NameText.text = "--"; } else { NameText.text = array[0]; } if (string.IsNullOrEmpty(array[0])) { NumText.text = "--"; } else { NumText.text = array[1]; } } LocationDataText.text = info.Count.ToString(); LineTog.onValueChanged.AddListener(LineTog_Click); }
public bool Remove(Position p) { bool result = PositionList.Remove(p); SaveToFile(); return(result); }
protected void Page_Load(object sender, EventArgs e) { binding = new SearchBinding(dbConn, db); //binding.add(new LikeSearchBinder(EmpNo, "EmpNo")); //binding.add(new LikeSearchBinder(EmpEngSurname, "EmpEngSurname")); //binding.add(new LikeSearchBinder(EmpEngOtherName, "EmpEngOtherName")); //binding.add(new LikeSearchBinder(EmpChiFullName, "EmpChiFullName")); //binding.add(new LikeSearchBinder(EmpAlias, "EmpAlias")); //binding.add(new DropDownVLSearchBinder(EmpGender, "EmpGender", Values.VLGender).setLocale(ci)); //binding.add(new FieldDateRangeSearchBinder(JoinDateFrom, JoinDateTo, "EmpDateOfJoin").setUseCurDate(false)); //binding.add(new DropDownVLSearchBinder(EmpStatus, "EmpStatus", EEmpPersonalInfo.VLEmpStatus)); //binding.initValues("EmpStatus", null, EEmpPersonalInfo.VLEmpStatus, ci); binding.init(DecryptedRequest, null); if (!Page.IsPostBack) { PositionList.LoadListControl(dbConn, EPosition.VLPosition, true); RankList.LoadListControl(dbConn, ERank.VLRank, false); EmploymentTypeList.LoadListControl(dbConn, EEmploymentType.VLEmploymentType, true); StaffTypeList.LoadListControl(dbConn, EStaffType.VLStaffType, true); PayrollGroupList.LoadListControl(dbConn, EPayrollGroup.VLPayrollGroup, true); //selected = PayGroupID.SelectedValue; //WebFormUtils.loadValues(PayGroupID, EPayrollGroup.VLPayrollGroup, new DBFilter(), null, (string)selected, (string)"combobox.notselected"); string selected = EmpGender.SelectedValue; WebFormUtils.loadValues(dbConn, EmpGender, Values.VLGender, new DBFilter(), ci, (string)selected, (string)"combobox.notselected"); } }
void LoadData(object obj) { if (obj == null) { return; } var p = obj as IPortfolio; if (p == null) { return; } PositionList.Clear(); p.PositionList.ForEach(v => { PositionList.Add(v.Clone() as IPosition); }); p.AccountList.ForEach(v => { AccountList.Add(v.Clone() as Account); }); Name = p.Name; Memo = p.Memo; LastMarketDataTime = p.LastMarketDataTime; CurrentCurrency = p.CurrentCurrency; }
public List <PositionList> GetPositionsCountOfDays(DateTime date, int dayCount, Func <ProgressInfo, bool> progressCallback) { List <PositionList> pos = new List <PositionList>(); for (int i = 0; i < dayCount; i++) { var dateNew = date.AddDays(-i); PositionList list = GetPositionsCountOfDay(dateNew); pos.Add(list); if (progressCallback != null) { ProgressInfo progress = new ProgressInfo(list); progress.Index = i + 1; progress.Total = dayCount; progress.Count = list.Count; progress.Date = dateNew; if (progressCallback(progress) == false) { break; } } } return(pos); }
public void ShowPersonnelBenchmarkInfo(PositionList info) { NameStr = info.Name; var array = info.Name.Split(new char[2] { '(', ')' }); if (array != null && array.Length > 2) { if (string.IsNullOrEmpty(array[0])) { NameText.text = "--"; } else { NameText.text = array[0]; } if (string.IsNullOrEmpty(array[0])) { TagText.text = "--"; } else { TagText.text = array[1]; } } LocationDataText.text = info.Count.ToString(); LineTog.onValueChanged.AddListener(ShowPersonnelChart_Line); }
public new void Clear() { List.Clear(); PositionList.Clear(); PositionList.Add(StockPane); Layout(); }
public SortedPosList Clone() { SortedPosList s = new SortedPosList(); PositionList.ForEach(s.Add); return(s); }
public void Refresh() { if (TargetObject == null) { return; } var o = TargetObject as IPortfolio; if (o == null) { return; } PositionList.Clear(); AccountList.Clear(); o.PositionList.ForEach(v => { PositionList.Add(v); }); o.AccountList.ForEach(v => { AccountList.Add(v); }); }
internal Portfolio(FreeQuant.Instruments.Portfolio portfolio) { this.portfolio = portfolio; this.positions = new PositionList(portfolio.Positions); this.transactions = new TransactionList(portfolio.Transactions); this.account = new PortfolioAccount(portfolio.Account); }
void Start() { ItemList.Add(EmptyItemSlot1); ItemList.Add(EmptyItemSlot2); ItemList.Add(EmptyItemSlot3); ItemList.Add(EmptyItemSlot4); ItemList.Add(EmptyItemSlot5); ItemList.Add(EmptyItemSlot6); ItemList.Add(EmptyItemSlot7); ItemList.Add(EmptyItemSlot8); GoldLabel.text = " " + _parentUnit.Gold; foreach (GameObject item in ItemList) { if (item.name == _inventoryDictionary[1]) { PositionList.Add(item.transform.position); slot = item.GetComponent <Item>(); ItemLogicList.Add(slot); slot.EmptySlot = true; } else { PositionList.Add(item.transform.position); slot = item.GetComponent <Item>(); ItemLogicList.Add(slot); slot.EmptySlot = false; } } }
/// <summary> /// To Get All Positions /// </summary> /// <returns></returns> public PositionList GetAllPositions() { OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString); OracleCommand cmd; string proc = "USP_MST_GET_ALLPOSITIONS"; cmd = new OracleCommand(proc, cnn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("Sp_recordset", Oracle.DataAccess.Client.OracleDbType.RefCursor).Direction = ParameterDirection.Output; cmd.Connection.Open(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); PositionBO objPosition = null; PositionList PositionList = new PositionList(); while (dr.Read()) { objPosition = new PositionBO(); objPosition.PositionID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("POSITIONID"))); objPosition.PositionName = dr.GetString(dr.GetOrdinal("POSITION")); objPosition.PositionIsDeleted = dr.GetString(dr.GetOrdinal("ISDELETED")); PositionList.Add(objPosition); } dr.Close(); return(PositionList); }
void DrawLine(Pen pen, int StartX, int StartY, int EndX, int EndY, PositionList Pos, bool SaveLine) { switch (Pos) { case PositionList.BottomLeft: { panelGraphics.DrawLine(pen, StartX, panel_graphic.Size.Height - StartY, EndX, panel_graphic.Size.Height - EndY); break; } case PositionList.BottomRight: { panelGraphics.DrawLine(pen, panel_graphic.Size.Width - StartX, panel_graphic.Size.Height - StartY, panel_graphic.Size.Width - EndX, panel_graphic.Size.Height - EndY); break; } case PositionList.TopLeft: { panelGraphics.DrawLine(pen, StartX, StartY, EndX, EndY); break; } case PositionList.TopRight: { panelGraphics.DrawLine(pen, panel_graphic.Size.Width - StartX, StartY, panel_graphic.Size.Width - EndX, EndY); break; } } if (SaveLine) { Lines.Add(new Line(pen, StartX, StartY, EndX, EndY, Pos)); } }
public IOrder GenerateOrderByCapital(string ticker, double price, double capital, OrderType orderType, string currency = null) { if (price < CommonProc.EPSILON) { return(null); } var t = capital / price; if (t < CommonProc.EPSILON) { return(null); } var shares = Convert.ToInt32(t); shares = Math.Max(Order.MinOperationShares, shares); if (string.IsNullOrEmpty(currency)) { currency = "RMB"; } Order o = new Order(); o.Ticker = ticker; o.Price = price; o.Currency = currency; o.OrderDirection = orderType; o.OrderTime = DateTime.Now; if (orderType == OrderType.Buy) { var account = GetAccount(currency); if (account == null) { return(null); } if (account.CurrentValue.Number >= price * shares && shares >= Order.MinOperationShares)//min buy is 100; { o.Shares = (int)shares; } } else { if (IsUnlimited) { o.Shares = shares; } else { var position = PositionList.FirstOrDefault(v => v.InstrumentTicker == ticker); if (position != null && position.Shares > 0) { o.Shares = (int)Math.Min(Convert.ToInt32(position.Shares), shares); } } } if (o.Shares > 0) { return(o); } return(null); }
/// <summary> /// MExchangeテーブルの設定内容で初期化する /// </summary> public void InitializeExchange() { // 初期化 // 資産情報 CollateralList = InitializeDictionary(CollateralList); // 注文情報 ParentOrderList = InitializeDictionary(ParentOrderList); ChildOrderList = InitializeDictionary(ChildOrderList); // 建玉情報 PositionList = InitializeDictionary(PositionList); // 取引所状態情報 StateList = InitializeDictionary(StateList); // テクニカル管理 TechnicalList = InitializeDictionary(TechnicalList); // クライアント Client = InitializeDictionary(Client); // パラメータ読み込み using (var db = new MExchangeDbContext(DbContextOptions)) { // データを取得 var mExchange = db.MExchange; foreach (var item in mExchange) { if (item.Enabled == Enabled) { // 資産情報 CollateralList.Add(item.Id, new Collateral(new RawCollateral())); // 注文情報 ParentOrderList.Add(item.Id, new List <Order>()); ChildOrderList.Add(item.Id, new List <Order>()); // 建玉情報 PositionList.Add(item.Id, new List <Position>()); // 取引所状態情報 StateList.Add(item.Id, new RawBoardState()); // テクニカル管理生成 Dictionary <int, PubnubManager> pubnub = null; if (PubnubList.ContainsKey(item.Id)) { pubnub = PubnubList[item.Id]; } TechnicalList.Add(item.Id, new TechnicalManager(item.Id, pubnub, TimeScaleList, DbContextOptions, TechnicalList)); // 通信用クライアント生成 Client.Add(item.Id, new BitflyerClient(item.Id, DbContextOptions)); } } } }
public IPosition GetTargetPosition(IInstrument inst) { if (inst == null) { return(null); } return(PositionList.FirstOrDefault(v => v.InstrumentTicker == inst.Ticker)); }
public void ProcessMarketData(List <IMarketData> data) { PositionList.ForEach(v => v.ProcessMarketData(data)); if (PositionList.Count > 0) { LastMarketDataTime = PositionList.Max(v => v.DataTime); } }
public void PositionListTest() { var method = new PositionList() { CompanyID = 3786, PositionType = API.Entities.PositionTypes.技术 }; var a = ApiClient.Execute(method).Result; }
public void ProcessOrderList(List <IOrder> orderlist) { orderlist.ForEach(v => { ProcessOrder(v); }); PositionList.RemoveAll(v => Math.Abs(v.Shares) < CommonProc.EPSILON); }
private void DeletePositionClosing(object sender, DialogClosingEventArgs args) { bool result = false; if (Equals(args.Parameter, "Cancel")) { return; } if (_isOkMessageOpen) { _isOkMessageOpen = false; return; } if (Equals(args.Parameter, "Ok")) { args.Session.UpdateContent(new PleaseWaitView()); Task.Run(() => { Thread.Sleep(1000); try { _context.Entry(SelectedPosition).State = EntityState.Deleted; var councilMembers = _context.CouncilMembers.Where(c => c.CouncilPosition.Id == SelectedPosition.Id); foreach (var entity in councilMembers) { _context.CouncilMembers.Remove(entity); } _context.SaveChanges(); result = true; } catch (Exception e) { Console.WriteLine(e.Message); result = false; } }).ContinueWith((t, _) => { if (result) { PositionList.Remove(SelectedPosition); } else { args.Cancel(); _isOkMessageOpen = true; args.Session.UpdateContent(new OkMessageDialog() { DataContext = "Failed to Delete" }); } }, null, TaskScheduler.FromCurrentSynchronizationContext()); } }
public bool AddPosition(Position position) { if (PositionList.Count == 0 || PositionList.Last().GetNeighbourType(position) != Position.NeighbourType.None) { PositionList.Add(position); return(true); } return(false); }
public Line(Pen _P, int _StartX, int _StartY, int _EndX, int _EndY, PositionList _Pos) { P = _P; StartX = _StartX; StartY = _StartY; EndX = _EndX; EndY = _EndY; Position = _Pos; }
public void Setup() { Order = new Order { Positions = Positions = new PositionList {new Position{Id = 2, Price = 100m} }, Buyer = Buyer = new Buyer { Id = 1, Name = "BuyerName-A" }, Seller = Seller = new Seller { Id = 1, Name = "SellerName-B" } }; }
public void Add(Position p) { PositionList.Add(p); PositionList.Sort(delegate(Position p1, Position p2) { return(p1.Lenght().CompareTo(p2.Lenght())); }); SaveToFile(); }
private void frmPosition_Load(object sender, EventArgs e) { dgvPosition.AutoGenerateColumns = false; pl = new PositionList(); pl = pl.GetAll(); dgvPosition.DataSource = pl.List; saveToolStripMenuItem.Enabled = false; pl.Savable += Pl_Savable; }
public void SetLineChart(List <PositionList> PosLIst) { PosLIst.Sort((x, y) => { return(x.Count.CompareTo(y.Count)); }); DeleteLinePrefabs(); LineChart_Y_value.DateY(PosLIst[PosLIst.Count - 1].Count); PersonnelLineChart.yMax = (float)PosLIst[PosLIst.Count - 1].Count; List <float> data = new List <float>(); PosLIst.Sort((x, y) => { return(x.Name.CompareTo(y.Name)); }); DateTime dt = Convert.ToDateTime(PosLIst[PosLIst.Count - 1].Name); DateTime MinDt = Convert.ToDateTime(PosLIst[0].Name); int DifferencetIME = int.Parse((dt - MinDt).TotalDays.ToString()); for (int i = 0; i <= DifferencetIME; i++) { TimeInstantiateLine(); DateTime HoursAdd = MinDt.AddDays(i); string TimeT = HoursAdd.ToString(("yyyy-MM-dd")); PositionList item = PosLIst.Find(j => j.Name.Contains(TimeT)); if (item != null) { data.Add(float.Parse(item.Count.ToString())); //TimeScreenPositionList.Remove(item); } else { data.Add(1);//没有数据的日期补上1 } } if (data.Count == 1) { TimeInstantiateLine(); data.Insert(0, 1); } float Width = data.Count * 120f; scrollView.transform.GetComponent <RectTransform>().sizeDelta = new Vector2((data.Count + 1) * 120f, 375); coordinate.transform.GetComponent <RectTransform>().sizeDelta = new Vector2((data.Count + 1) * 120f, 325); UGUI_LineChartObj.transform.GetComponent <RectTransform>().sizeDelta = new Vector2((data.Count - 1) * 120f, 305); PersonnelLineChart.width = ((data.Count - 1) * 120f); if (PersonnelLineChart.pointImageList.Count != 0) { PersonnelLineChart.pointImageList.Clear(); ClearLinePoint(); } SetHourLineChartDate(PosLIst, Personnel_X_Data, data.Count); PersonnelLineChart.UpdateData(data); }
public double GetWeight(string ticker) { var p = PositionList.FirstOrDefault(v => v.InstrumentTicker == ticker); if (p == null) { return(0); } return(p.CurrentValue.Number / PositionCapital.Number); }
internal Pane Add(Pane pane, Pane insertAfter, float percentHeight) { pane.PercentHeight = percentHeight; List.Add(pane); int index = PositionList.IndexOf(insertAfter); PositionList.Insert(index + 1, pane); Chart.PerformLayout(); return(pane); }
public void SavePositions(List <Position> posList, string name) { PositionList list = new PositionList(name); list.Add(posList); //XmlSerializeHelper. string filePath = AppDomain.CurrentDomain.BaseDirectory + "\\Data\\ErrorPoints\\" + name + ".xml"; XmlSerializeHelper.Save(list, filePath); }
public Walker(PositionList positions) { this.currentPosition = -1; this.positions = positions; if (positions == null || positions.Count == 0) { throw new ArgumentNullException("WalkingPoints"); } }
public void AddPosition() { var c = new Position() { Name = "New Position" }; PositionList.Add(c); CurrentPosition = c; }
public override void OnQueryPosition(PositionList posInfos) { Console.WriteLine("- OnQueryPosition:"); for (int i = 0; i < posInfos.Count; i++) { Position pos = posInfos[i]; PrintPositionInfo(pos); } //ToDo ... }
private async Task LoadPosByType() { this.IsBusy = true; var method = new PositionList() { CompanyID = this.CompanyID, PositionType = (PositionTypes)Enum.Parse(typeof(PositionTypes), this.SelectedPositionType), Page = this.Page }; var datas = await API.ApiClient.Execute(method); if (!method.HasError && datas.Count() > 0) { this.Page++; this.Datas.AddRange(datas); } this.IsBusy = false; }
public virtual void Setup() { Order = new Order { Positions = Positions, Buyer = Buyer = new Buyer{Id = 1, Name = "BuyerName-A"}, Seller = Seller = new Seller { Id = 1, Name = "SellerName-B" } }; Positions = new PositionList { new Position {Id = 1, Price = 22.0m}, new Position {Id = 2, Price = 47.3m}, new Position {Id = 3, Price = 55.3m} }; }
/// <summary> /// Initializes a new instance of the <see cref="EntityRegistry"/>. /// </summary> /// <param name="storage">The special interface for direct access to the storage.</param> public EntityRegistry(IStorage storage) { if (storage == null) throw new ArgumentNullException(nameof(storage)); Storage = storage; ConfigManager.TryRegisterService(storage); Exchanges = new ExchangeList(storage) { BulkLoad = true }; ExchangeBoards = new ExchangeBoardList(storage) { BulkLoad = true }; Securities = new SecurityList(this); Trades = new TradeList(storage); MyTrades = new MyTradeList(storage); Orders = new OrderList(storage); OrderFails = new OrderFailList(storage); Portfolios = new PortfolioList(storage); Positions = new PositionList(storage); News = new NewsList(storage); }