示例#1
0
        public override void PopulateSymbols(DataSource ds, List <string> symbols)
        {
            Trace.WriteLine("PopulateSymbols()");
            // Get csv files
            List <string> availableSymbols = QuikQuotesLoader.GetHistorySymbols();

            symbols.AddRange(availableSymbols);
            if (string.IsNullOrEmpty(ds.DSString))
            {
                return;
            }
            QuikSettings settings   = (QuikSettings)QuikSettings.DeserializeFromString(ds.DSString);
            SymbolList   symbolList = new SymbolList(settings.Symbols);

            symbols.AddRange(symbolList.Items);
        }
示例#2
0
        /// <summary>
        /// Catch DDE Data
        /// </summary>
        /// <param name="conversation"></param>
        /// <param name="item"></param>
        /// <param name="data"></param>
        /// <param name="format"></param>
        /// <returns></returns>
        protected override PokeResult OnPoke(DdeConversation conversation, string item, byte[] data, int format)
        {
            //QuikLoader.StaticDataLoadedSync.WaitOne();
            object[][] table = XLTable.Cells(data);


            string symbol = null; string dataType = null;

            GetDataType(conversation, out symbol, out dataType);
            switch (dataType.ToLower())
            {
            case "dom":
                // Dom data load
                Dom.DomLoader.AddSnapShotFromDde(symbol, table);
                break;

            case "quotes":
            default:
                // Load quotes data
                QuikQuotesLoader.AddQuotesFromDde(table);
                break;
            }

            Trace.WriteLine("OnPoke:".PadRight(16)
                            + " Service='" + conversation.Service + "'"
                            + " Topic='" + conversation.Topic + "'"
                            + " Handle=" + conversation.Handle.ToString()
                            + " Item='" + item + "'"
                            + " Data=" + data.Length.ToString()
                            + " Format=" + format.ToString());


            // Static data is loaded sygnal
//                QuikLoader.StaticDataLoadedSync.Set();


            // Tell the client that the data was processed.
            return(PokeResult.Processed);
        }
示例#3
0
 /// <summary>
 /// History request
 /// </summary>
 /// <param name="ds"></param>
 /// <param name="symbol"></param>
 /// <param name="startDate"></param>
 /// <param name="endDate"></param>
 /// <param name="maxBars"></param>
 /// <param name="includePartialBar"></param>
 /// <returns></returns>
 public override Bars RequestData(DataSource ds, string symbol, DateTime startDate, DateTime endDate, int maxBars, bool includePartialBar)
 {
     Trace.WriteLine("RequestData()");
     // History data
     return(QuikQuotesLoader.GetHistoryBars(symbol, ds, startDate, endDate));
 }