public PosInfo(IPosition pos)
            {
                m_isLong          = pos.IsLong;
                m_isShort         = pos.IsShort;
                m_isVirtual       = pos.IsVirtual;
                m_entryBarNum     = pos.EntryBarNum;
                m_shares          = pos.Shares;
                m_entryPrice      = pos.AverageEntryPrice;
                m_entrySignalName = pos.EntrySignalName;
                m_entryNotes      = pos.EntryNotes;
                m_entryCommission = pos.EntryCommission;

                m_exitBarNum     = pos.ExitBarNum;
                m_exitPrice      = pos.ExitPrice;
                m_exitCommission = pos.ExitCommission;

                m_secInfo = new SecInfo(pos.Security.SecurityDescription);

                try
                {
                    m_avgPx = pos.GetBalancePrice(pos.Security.Bars.Count - 1);
                }
                catch (Exception)
                {
                    // подавляю все возможные исключения здесь
                    m_avgPx = Double.NaN;
                }
            }
            public PosInfo()
            {
                m_entrySignalName = "";
                m_entryNotes      = "";

                m_secInfo = new SecInfo();
            }
Ejemplo n.º 3
0
            public bool Equals(SecInfo secInfo)
            {
                if (secInfo == null)
                {
                    return(false);
                }

                // проверка специально разбита на 3 части, чтобы легче было дебажить
                bool res = FullName.Equals(secInfo.FullName, StringComparison.InvariantCultureIgnoreCase);

                res &= Name.Equals(secInfo.Name, StringComparison.InvariantCultureIgnoreCase);
                res &= DsName.Equals(secInfo.DsName, StringComparison.InvariantCultureIgnoreCase);
                return(res);
            }
Ejemplo n.º 4
0
            public IvTargetInfo()
            {
                m_entrySignalName = "";
                m_entryNotes      = "";

                m_entryIv         = 0;
                m_entryShiftPrice = 0;
                m_quoteMode       = QuoteIvMode.Relative;

                m_startDate      = DateTime.MinValue;
                m_expirationDate = DateTime.MaxValue;

                m_secInfo = new SecInfo();
            }
Ejemplo n.º 5
0
            public IvTargetInfo(bool isLong, double targetQty,
                                QuoteIvMode quoteMode, double iv, int shiftPrice, string signalName, string notes)
            {
                m_isLong  = isLong;
                m_isShort = !isLong;

                m_entryIv         = iv;
                m_entryShiftPrice = shiftPrice;
                m_quoteMode       = quoteMode;
                m_targetShares    = targetQty;

                m_entrySignalName = signalName;
                m_entryNotes      = notes;

                m_startDate      = DateTime.MinValue;
                m_expirationDate = DateTime.MaxValue;

                m_secInfo = new SecInfo();
                //m_secInfo = new SecInfo(sec.FinInfo.Security);
            }
Ejemplo n.º 6
0
    //////////////////////

    //根據碰撞箱父物件生成建築,成為目前地板的子物件
    private void BuildHouse(Collider2D B)
    {
        //播放音效
        Debug.Log(GetComponent <AudioSource>().clip);
        GetComponent <AudioSource>().Play();

        //將透明度改回去
        SparkleOff();

        //從棋子Info取得所有建築物資訊
        Info = B.gameObject.transform.GetComponent <DragChess>().Info;

        //扣資源
        GameObject.Find("BuildMaterialMonitor").GetComponent <MaterialManage>().AddMaterial(-1 * Info.Coin, -1 * Info.Wood, -1 * Info.Metal, -1 * Info.Concrete);

        //更改建築名稱
        BuildingName = Info.Title;

        //製造建築模板
        CreateBuildingTemplate();
    }