示例#1
0
        public void TtJira230Steps()
        {
            Assert.AreEqual(0, FdkHelper.ConnectToFdk("tp.st.soft-fx.eu", "100064", "123qwe!", ""));

            var prevNow     = new DateTime(2015, 7, 7, 18, 30, 00);
            var now         = new DateTime(2015, 7, 7, 19, 00, 00);
            var varPairBars = FdkBarPairs.ComputeGetPairBars("#SPX", "M30", prevNow, now, 10000);

            FdkVars.Unregister(varPairBars);
            FdkHelper.Disconnect();
        }
示例#2
0
        public void TtJira227Steps()
        {
            Assert.AreEqual(0, FdkHelper.ConnectToFdk("tp.st.soft-fx.eu", "100000", "123321", @"c:\FdkCaches\Cache1"));
            var endTime   = DateTime.Now;
            var startTime = endTime.AddSeconds(-0.1);

            var quotes = FdkQuotes.ComputeQuoteHistory("EURUSD_Rl", startTime, endTime, 1);

            FdkVars.Unregister(quotes);
            FdkHelper.Disconnect();
        }
示例#3
0
        public void TestGetTradeRecords()
        {
            Assert.AreEqual(0, FdkHelper.ConnectToFdk("tp.st.soft-fx.eu", "100065", "123qwe!", ""));
            //Assert.AreEqual(0, FdkHelper.ConnectToFdk("", "", "", ""));
            TradeRecord[] tradeRecords = Trade.Server.GetTradeRecords()
                                         .ToArray();
            var bars      = FdkTrade.GetTradeRecords(new DateTime(1970, 1, 2), DateTime.UtcNow);
            var comission = FdkTrade.GetTradeAgentCommission(bars);
            var profit    = FdkTrade.GetTradeTakeProfit(bars);

            FdkVars.Unregister(bars);
        }
        public void TestTradeReports()
        {
            Assert.AreEqual(0, FdkHelper.ConnectToFdk("ttdemo.fxopen.com", "100106", "123qwe123", ""));

            var _trader = FdkTradeReports.Trade;
            StreamIterator <TradeTransactionReport> tradeTransactions = _trader.Server.GetTradeTransactionReports(TimeDirection.Forward, true, null, null, 5000);

            for (; !tradeTransactions.EndOfStream; tradeTransactions.Next())
            {
                TradeTransactionReport ttr = tradeTransactions.Item;
            }
        }
示例#5
0
        public void TestBasicConnect()
        {
            //FdkHelper.UseLrp = true;
            //FdkHelper.ConnectToFdk("", "", "", "");
            FdkHelper.ConnectToFdk("localhost", "100001", "123qwe!", "");

            var tradeRecordsStream = Trade.Server.GetTradeTransactionReports(TimeDirection.Forward, false, null, null)
                                     .ToArray().ToList();
            var tradeRecordList = tradeRecordsStream.ToArray();

            Assert.IsTrue(tradeRecordList.Length == 0);
        }
示例#6
0
        public static void Main()
        {
            FdkHelper.ConnectToFdk("78.46.196.240", "100008", "123qwe!", "");
            var now     = DateTime.UtcNow;
            var prevNow = DateTime.UtcNow.Subtract(new TimeSpan(30, 0, 0));

            FdkBars.ComputeBarsRangeTime("BTCUSD_L", "BidAsk", "M1", prevNow, now, 0);
            return;

            var bars      = FdkTradeReports.GetTradeTransactionReportAll();
            var comission = FdkTradeReports.GetTradeComment(bars);

            FdkVars.Unregister(bars);
        }
        public void TestQuotesLevel2WideSpreadLastMinute()
        {
            //Assert.AreEqual(0, FdkHelper.ConnectToFdk("tp.dev.soft-fx.eu", "100106", "123qwe123", ""));
            Assert.AreEqual(0, FdkHelper.ConnectToFdk("", "", "", @"c:\FdkCaches\Cache1"));
            var time       = DateTime.UtcNow;
            var prevHour   = time.AddMinutes(-1);
            var quotes     = FdkLevel2.GetQuotePacked("AUDUSD", prevHour, time, 2);
            var volumesAsk = FdkLevel2.QuotesVolumeBid(quotes);
            var volumesBid = FdkLevel2.QuotesVolumeAsk(quotes);

            Assert.AreNotEqual(0, volumesAsk.Length);
            Assert.AreNotEqual(0, volumesBid.Length);
            FdkVars.Unregister(quotes);
        }
示例#8
0
        public void TestCurrency()
        {
            Assert.AreEqual(0, FdkHelper.ConnectToFdk("", "", "", ""));

            var symbolInfos = FdkCurrencyInfo.GetCurrencyInfos();

            FdkCurrencyInfo.GetCurrencyName(symbolInfos);
            FdkCurrencyInfo.GetCurrencyDescription(symbolInfos);
            FdkCurrencyInfo.GetCurrencyPrecision(symbolInfos);
            FdkCurrencyInfo.GetCurrencySortOrder(symbolInfos);

            FdkVars.Unregister(symbolInfos);

            FdkHelper.Disconnect();
        }
示例#9
0
        public void TestErrorQuotesDefaultAccount100Milli()
        {
            Assert.AreEqual(0, FdkHelper.ConnectToFdk("", "", "", @""));
            var time     = DateTime.Now;
            var prevHour = time.AddMilliseconds(-100);
            var symbols  = FdkSymbolInfo.GetSymbolInfos();

            var quotes = FdkQuotes.ComputeQuoteHistory("EURUSD", prevHour, time, 3);
            var asks   = FdkQuotes.QuotesAsk(quotes);
            var bids   = FdkQuotes.QuotesBid(quotes);
            var opens  = FdkQuotes.QuotesCreatingTime(quotes);
            var spread = FdkQuotes.QuotesSpread(quotes);

            FdkVars.Unregister(quotes);
            FdkHelper.Disconnect();
        }
示例#10
0
        public void TestTradeReports2()
        {
            Library.Path = "<FRE>";
            Assert.AreEqual(0, FdkHelper.ConnectToFdk("ttdemo.fxopen.com", "50001933", "123123", ""));

            var _trader   = FdkTradeReports.Trade;
            var startTime = new DateTime(2015, 05, 1, 0, 0, 0);
            var endTime   = new DateTime(2015, 07, 30, 0, 0, 0);
            StreamIterator <TradeTransactionReport> tradeTransactions = _trader.Server.GetTradeTransactionReports(TimeDirection.Forward, true,
                                                                                                                  startTime, endTime, 50);

            for (; !tradeTransactions.EndOfStream; tradeTransactions.Next())
            {
                TradeTransactionReport ttr = tradeTransactions.Item;
            }
        }
示例#11
0
        public static void Main()
        {
            //Library.Path = "<FRE>";
            //FdkHelper.UseLrp = true;
            //FdkHelper.ConnectToFdk("", "", "", "");
            //FdkHelper.ConnectToFdk("localhost", "100001", "123qwe!", "");

            FdkHelper.ConnectToFdk("exchange.tts.st.soft-fx.eu", "100033", "123qwe!", "");

            TradeTransactionReport[] tradeRecordList = GetTrades();
            var bars = FdkHelper.Feed.Server.GetHistoryBars("EURUSD", DateTime.UtcNow, -100, PriceType.Bid, BarPeriod.H1);

            /*
             * var trade = tradeRecordList.Last();
             * Trade.ModifyTradeRecord("236005", trade.ClientId, trade.Symbol, trade.TradeRecordType, trade.TradeRecordSide, trade.TransactionAmount, newComment: "");
             * var tradeRecordList2 = GetTrades();
             */
        }
示例#12
0
        public void TestDualConnect()
        {
            Assert.AreEqual(0, FdkHelper.ConnectToFdk("tp.st.soft-fx.eu", "100033", "123qwe!", ""));
            //Assert.AreEqual(0, FdkHelper.ConnectToFdk("", "", "", ""));
            var time      = DateTime.Now;
            var prevTime  = time.AddHours(-1);
            var bars      = FdkTradeReports.GetTradeTransactionReportAll();
            var comission = FdkTradeReports.GetTradeAgentCommission(bars);

            FdkVars.Unregister(bars);
            FdkHelper.Disconnect();

            Assert.AreEqual(0, FdkHelper.ConnectToFdk("tp.st.soft-fx.eu", "100055", "123qwe!", ""));
            var bars2      = FdkTradeReports.GetTradeTransactionReportAll();
            var comission2 = FdkTradeReports.GetTradeAgentCommission(bars2);

            FdkVars.Unregister(bars2);
            FdkHelper.Disconnect();
        }
示例#13
0
        public void TestLevel2()
        {
            //Assert.AreEqual(0, FdkHelper.ConnectToFdk("tp.dev.soft-fx.eu", "100106", "123qwe123", ""));
            Assert.AreEqual(0, FdkHelper.ConnectToFdk("", "", "", @"c:\FdkCaches\Cache3"));
            var time     = DateTime.Now;
            var prevHour = time.AddDays(-1);

            var quotes = FdkQuotes.ComputeQuoteHistory("EURUSD", prevHour, time, 3);
            var asks   = FdkQuotes.QuotesAsk(quotes);
            var bids   = FdkQuotes.QuotesBid(quotes);
            var opens  = FdkQuotes.QuotesCreatingTime(quotes);
            var spread = FdkQuotes.QuotesSpread(quotes);

            FdkVars.Unregister(quotes);
            Assert.AreEqual(0, FdkHelper.ConnectToFdk("", "", "", @"c:\FdkCaches\Cache1"));
            quotes = FdkQuotes.ComputeQuoteHistory("EURUSD", prevHour, time, 3);

            FdkVars.Unregister(quotes);
        }
示例#14
0
        public void TestBarsRangeAskBid()
        {
            //Assert.AreEqual(0, FdkHelper.ConnectToFdk("tp.dev.soft-fx.eu", "100106", "123qwe123", ""));
            Assert.AreEqual(0, FdkHelper.ConnectToFdk("", "", "", ""));
            var time     = DateTime.Now;
            var prevHour = time.AddDays(-1);

            var bars    = FdkBars.ComputeBarsRangeTime("EURUSD", "AskBid", "M1", prevHour, DateTime.Now, 10000);
            var highs   = FdkBars.BarHighs(bars);
            var lows    = FdkBars.BarLows(bars);
            var opens   = FdkBars.BarOpens(bars);
            var volumes = FdkBars.BarVolumes(bars);
            var closes  = FdkBars.BarCloses(bars);
            var froms   = FdkBars.BarFroms(bars);
            var tos     = FdkBars.BarTos(bars);

            FdkVars.Unregister(bars);

            FdkHelper.Disconnect();
        }
示例#15
0
        public void TestSymbolsStaging()
        {
            Assert.AreEqual(0, FdkHelper.ConnectToFdk("tp.st.soft-fx.eu", "100033", "123qwe!", ""));
            var symbolInfos = FdkSymbolInfo.GetSymbolInfos();

            FdkSymbolInfo.GetRoundLot(symbolInfos);
            FdkSymbolInfo.GetSymbolComission(symbolInfos);
            FdkSymbolInfo.GetSymbolContractMultiplier(symbolInfos);
            FdkSymbolInfo.GetSymbolCurrency(symbolInfos);
            FdkSymbolInfo.GetSymbolLimitsCommission(symbolInfos);
            FdkSymbolInfo.GetSymbolMaxTradeVolume(symbolInfos);
            FdkSymbolInfo.GetSymbolMinTradeVolume(symbolInfos);
            FdkSymbolInfo.GetSymbolName(symbolInfos);
            FdkSymbolInfo.GetSymbolPrecision(symbolInfos);
            FdkSymbolInfo.GetSymbolSettlementCurrency(symbolInfos);
            FdkSymbolInfo.GetSymbolSwapSizeLong(symbolInfos);
            FdkSymbolInfo.GetSymbolSwapSizeShort(symbolInfos);
            FdkVars.Unregister(symbolInfos);

            FdkHelper.Disconnect();
        }
示例#16
0
 public void ConnectToAccountStaging57()
 {
     Assert.AreEqual(0, FdkHelper.ConnectToFdk("tp.st.soft-fx.eu", "100066", "123qwe!", @"c:\FdkCaches\Cache1"));
     FdkHelper.Disconnect();
 }