예제 #1
0
        public IObservable <RealTimeBarMessage> Request(Contract contract, WhatToShow whatToShow, bool useRth = false)
        {
            var stream = Construct();

            IbClient.ClientSocket.ReqRealTimeBars(RequestId, contract, 5, whatToShow, useRth, null);
            return(stream);
        }
 public MarketDataRequest(Contract contract, DateTime endDateTime, Duration duration, BarSize barSize, WhatToShow whatToShow)
 {
     Contract    = contract ?? throw new ArgumentNullException(nameof(contract));
     EndDateTime = endDateTime;
     Duration    = duration;
     BarSize     = barSize;
     WhatToShow  = whatToShow;
 }
예제 #3
0
        internal NodeIterator(Node root, WhatToShow whatToShow, NodeFilter filter)
        {
            Root = root;

            ReferenceNode = root;
            PointerBeforeReferenceNode = true;

            WhatToShow = whatToShow;
            Filter = filter;
        }
예제 #4
0
        /// <summary>
        /// Specify either start or end date. It doesn't accept both
        /// </summary>
        /// <param name="reqId"></param>
        /// <param name="contract"></param>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <param name="whatToShow"></param>
        public void GetLatestHistoricalTimeAndSales(int reqId, Contract contract, WhatToShow whatToShow)
        {
            _historicalTicks      = new Dictionary <int, List <HistoricalTick> >();
            _historicalTickBidAsk = new Dictionary <int, List <HistoricalTickBidAsk> >();
            _historicalTickLast   = new Dictionary <int, List <HistoricalTickLast> >();

            if (_allowedTimeAndSalesTickTypes.Contains(whatToShow))
            {
                string endTime = DateHelper.ConvertToApiDate(DateTime.Now);
                InitializeHistoricalTickDictionary(reqId, whatToShow);
                ClientSocket.reqHistoricalTicks(reqId, contract, null, endTime, 1000, whatToShow.ToString(), 0, true, null);
                Notify($"Time and Sales for symbol {contract.Symbol} requested");
            }
            else
            {
                NotifyError($"WhatToShow tick type: {whatToShow} not allowed");
            }
        }
예제 #5
0
 void Update()
 {
     if (whatToShow != lastFrame)
     {
         if (whatToShow == WhatToShow.SceneOnly)
         {
             holoplay.renderOverrideBehind = true;
             holoplay.background           = new Color(0, 0, 1, 1);
         }
         if (whatToShow == WhatToShow.QuiltOnly)
         {
             holoplay.renderOverrideBehind = false;
             holoplay.background           = new Color(0, 0, 1, 1);
         }
         if (whatToShow == WhatToShow.SceneOnQuilt)
         {
             holoplay.renderOverrideBehind = true;
             holoplay.background           = new Color(0, 0, 1, 0);
         }
         lastFrame = whatToShow;
     }
 }
예제 #6
0
        private void InitializeHistoricalTickDictionary(int reqId, WhatToShow whatToShow)
        {
            switch (whatToShow)
            {
            case WhatToShow.TRADES:
            {
                _historicalTickLast[reqId] = new List <HistoricalTickLast>();
                break;
            }

            case WhatToShow.MIDPOINT:
            {
                _historicalTicks[reqId] = new List <HistoricalTick>();
                break;
            }

            case WhatToShow.BID_ASK:
            {
                _historicalTickBidAsk[reqId] = new List <HistoricalTickBidAsk>();
                break;
            }
            }
        }
예제 #7
0
 /// <summary>
 /// For Bar Sizes check BarSize class
 /// For durations check Duration class
 /// </summary>
 public void GetHistoricalData(int reqId, Contract contract, string duration, string barSize, WhatToShow whatToShow, Rth rth, bool keepUpToDate)
 {
     _historicalData.Add(reqId, new List <Bar>());
     ClientSocket.reqHistoricalData(reqId, contract, string.Empty, duration, barSize, whatToShow.ToString(), (int)rth, 1, keepUpToDate, null);
     Notify($"Historical data for symbol {contract.Symbol} requested");
 }
예제 #8
0
 internal TreeWalker(Node root, WhatToShow whatToShow, NodeFilter filter)
 {
     Root = root;
     WhatToShow = whatToShow;
     Filter = filter;
 }
예제 #9
0
        /*public void Restart()
         * {
         *      LogTracker.Quality_Matrix_csv_string = "";
         *      LogTracker.matrix_index = 0;
         *      ESC_Count = 0;
         *      imageIndex = 0;
         *      last_number = 0;
         *      set_number_count = 0;
         *      KeyNext();
         *      CanMove = true;
         * }*/
        void Update()
        {
            if (Input.GetKeyUp("r"))             // debugging
            {
                Next_Compare_quality();
            }

            if (ESC_Count == 5)
            {
                while (true)
                {
                    CanMove = false;
                    if (PathIndex == 5)
                    {
                        User_Study_Finish.gameObject.SetActive(true);
                        break;
                    }
                    UIStart.gameObject.SetActive(true);
                    //NextSet();
                    break;
                }
            }
            if (CanMove)
            {
                if (Input.GetKeyUp(KeyCode.RightArrow))
                {
                    set_number_count += 1;
                    if (imageIndex < (textures.Length - 1))
                    {
                        imageIndex = imageIndex + 1;
                    }
                    else
                    {
                        UIEnd.gameObject.SetActive(true);
                        CanMove = false;
                    }
                    Debug.Log("Right");
                }
                if (Input.GetKeyUp(KeyCode.LeftArrow))
                {
                    while (true)
                    {
                        if (set_number_count == 0)
                        {
                            Debug.Log("This is the first picture");
                            break;
                        }
                        else if (last_number == set_number_count)
                        {
                            Debug.Log("You reach last ESC");
                            break;
                        }
                        set_number_count -= 1;
                        if (imageIndex > 0)
                        {
                            imageIndex = imageIndex - 1;
                        }
                        Debug.Log("Left");
                        break;
                    }
                }



                if (Input.GetKeyUp(KeyCode.Escape))
                {
                    while (true)
                    {
                        if (set_number_count == 0)
                        {
                            Debug.Log("This is the first picture");
                            break;
                        }
                        if (last_number == set_number_count)
                        {
                            Debug.Log("This is the last JND you perceive");
                            break;
                        }
                        ESC_Count++;
                        Debug.Log("You press ESC, you had press ( " + ESC_Count + " / 5");
                        last_number = set_number_count;
                        LogTracker.file_name_to_parse = result;
                        LogTracker.log_flag           = true;
                        // Debug.Log(result);
                        break;
                    }
                }

                if (textureType != null && textureType.Length > 0 && (Input.GetKeyUp(KeyCode.RightArrow) || Input.GetKeyUp(KeyCode.LeftArrow)))
                {
                    //KeyNext();
                }
            }
            if (whatToShow != lastFrame)
            {
                if (whatToShow == WhatToShow.SceneOnly)
                {
                    holoplay.renderOverrideBehind = true;
                    holoplay.background           = new Color(0, 0, 1, 1);
                }
                if (whatToShow == WhatToShow.QuiltOnly)
                {
                    holoplay.renderOverrideBehind = false;
                    holoplay.background           = new Color(0, 0, 1, 1);
                }
                if (whatToShow == WhatToShow.SceneOnQuilt)
                {
                    holoplay.renderOverrideBehind = true;
                    holoplay.background           = new Color(0, 0, 1, 0);
                }
                lastFrame = whatToShow;
            }
            timer += Time.deltaTime;
            // frame player

            /*
             * if (textureType != null  && textureType.Length > 0 && timer > 0.3f)
             * {
             *      imageIndex++;
             *              if (imageIndex >= textureType.Length){
             *                      imageIndex = 1;
             *              }
             *
             *      //quiltToOverrideWith = (Texture2D)textures[imageIndex];
             *      quiltToOverrideWith = (Texture2D)Resources.Load<Texture2D>( imagePath + "/Tile_generate__" + imageIndex.ToString());
             *
             *      holoplay.overrideQuilt = quiltToOverrideWith;
             *      timer = 0f;
             *      print("now imageIndex" + imageIndex);
             *      print(imagePath + "/Tile_generate__" + imageIndex.ToString() + ".png");
             * }*/
        }