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); }
internal BrokerPositionFieldList(FreeQuant.Providers.BrokerPositionField[] fields) { this.fields = fields; this.table = new Dictionary<string, FreeQuant.Providers.BrokerPositionField>(); foreach (FreeQuant.Providers.BrokerPositionField brokerPositionField in fields) this.table.Add(brokerPositionField.Name, brokerPositionField); }
public FreeQuant.Data.Bar FilterBarOpen(FreeQuant.Data.Bar bar, string symbol) { Bar bar1 = this.oqFilter.FilterBarOpen(new Bar(bar), symbol); if (bar1 != null) return bar1.bar; else return (FreeQuant.Data.Bar) null; }
public FreeQuant.Data.Trade FilterTrade(FreeQuant.Data.Trade trade, string symbol) { Trade trade1 = this.oqFilter.FilterTrade(new Trade(trade), symbol); if (trade1 == null) return (FreeQuant.Data.Trade) null; else return trade1.trade; }
public FreeQuant.Data.Quote FilterQuote(FreeQuant.Data.Quote quote, string symbol) { Quote quote1 = this.oqFilter.FilterQuote(new Quote(quote), symbol); if (quote1 == null) return (FreeQuant.Data.Quote) null; else return quote1.quote; }
public override double Convert(double amount, FreeQuant.Instruments.Currency fromCurrency, FreeQuant.Instruments.Currency toCurrency) { if (fromCurrency == toCurrency) return amount; Instrument instrument1 = InstrumentManager.Instruments[fromCurrency.Code + "_" + toCurrency.Code]; if (instrument1 != null) return amount * this.GetAmount(instrument1, amount); Instrument instrument2 = InstrumentManager.Instruments[toCurrency.Code + "_" + fromCurrency.Code]; if (instrument2 == null) return amount; else return amount / this.GetAmount(instrument2, amount); }
internal BrokerAccountFieldList(FreeQuant.Providers.BrokerAccountField[] fields) { this.fields = fields; this.table = new Dictionary<string, Dictionary<string, FreeQuant.Providers.BrokerAccountField>>(); foreach (FreeQuant.Providers.BrokerAccountField brokerAccountField in fields) { Dictionary<string, FreeQuant.Providers.BrokerAccountField> dictionary; if (!this.table.TryGetValue(brokerAccountField.Name, out dictionary)) { dictionary = new Dictionary<string, FreeQuant.Providers.BrokerAccountField>(); this.table.Add(brokerAccountField.Name, dictionary); } dictionary.Add(brokerAccountField.Currency, brokerAccountField); } }
private static void AddPortfolio(FreeQuant.Instruments.Portfolio sq_portfolio) { Portfolio portfolio = new Portfolio(sq_portfolio); Map.OQ_FQ_Portfolio[portfolio] = sq_portfolio; Map.FQ_OQ_Portfolio[sq_portfolio] = portfolio; }
// private static void SQ_OrderManager_OrderListUpdated(object sender, EventArgs e) // { // OpenQuant.orders.Clear(); // Map.OQ_FQ_Order.Clear(); // Map.FQ_OQ_Order.Clear(); // foreach (SingleOrder order1 in (FIXGroupList) ((InstrumentOrderListTable) OrderManager.Orders).All) // { // Order order2 = new Order(order1); // OpenQuant.orders.Add(order2); // Map.OQ_FQ_Order[order2] = order1; // Map.FQ_OQ_Order[order1] = order2; // } // } private static void AddInstrument(FreeQuant.Instruments.Instrument fq_instrument) { Instrument instrument = new Instrument(fq_instrument); OpenQuant.instruments.Add(fq_instrument.Symbol, instrument); Map.OQ_FQ_Instrument[instrument] = fq_instrument; Map.FQ_OQ_Instrument[fq_instrument] = instrument; }
internal void cXaFP441d(double obj0, FreeQuant.Instruments.Currency obj1, DateTime obj2, string obj3) { this.portfolio.Account.Deposit(obj0, obj1, obj2, obj3); foreach (Portfolio portfolio in this.portfolios.Values) portfolio.Account.Deposit(obj0, obj1, obj2, obj3); }
public double Price(FreeQuant.Instruments.Position position) { return this.pricer.Price(new Position(position)); }
internal BrokerOrder(FreeQuant.Providers.BrokerOrder brokerOrder) { this.brokerOrder = brokerOrder; }
internal BrokerAccount(FreeQuant.Providers.BrokerAccount brokerAccount) { this.brokerAccount = brokerAccount; }
internal TransactionList(FreeQuant.Instruments.TransactionList transactionList) { this.transactionList = transactionList; }
internal BrokerOrderField(FreeQuant.Providers.BrokerOrderField field) { this.field = field; }
internal static StopStatus Convert(FreeQuant.Trading.StopStatus stopStatus) { switch (stopStatus) { case FreeQuant.Trading.StopStatus.Active: return StopStatus.Active; case FreeQuant.Trading.StopStatus.Executed: return StopStatus.Executed; case FreeQuant.Trading.StopStatus.Canceled: return StopStatus.Canceled; default: throw new NotImplementedException("Stop status is not supported : " + (object)stopStatus); } }
internal static IndicatorStyle Convert(FreeQuant.Indicators.EIndicatorStyle indicatorStyle) { switch (indicatorStyle) { case FreeQuant.Indicators.EIndicatorStyle.SmartQuant: return IndicatorStyle.SmartQuant; case FreeQuant.Indicators.EIndicatorStyle.MetaStock: return IndicatorStyle.MetaStock; case FreeQuant.Indicators.EIndicatorStyle.FreeQuant: return IndicatorStyle.FreeQuant; case FreeQuant.Indicators.EIndicatorStyle.QuantStudio: return IndicatorStyle.QuantStudio; default: throw new NotImplementedException("Indicator style is not supported: " + indicatorStyle); } }
public void EmitMarketDepth(FreeQuant.Data.MarketDepth depth, Instrument instrument) { if (this.WiB4iTUE4w == null) return; this.WiB4iTUE4w((object)this, new MarketDepthEventArgs(depth, (IFIXInstrument)instrument, (IMarketDataProvider)this)); }
internal Quote(FreeQuant.Data.Quote quote) { this.quote = quote; }
internal OrderBookEntry(FreeQuant.Data.OrderBookEntry entry) { this.entry = entry; }
internal Bar(FreeQuant.Data.Bar bar) { this.bar = bar; }
internal ProviderError(FreeQuant.Providers.ProviderError error) { this.error = error; }
internal PositionList(FreeQuant.Instruments.PositionList positionList) { this.positionList = positionList; }
internal static BarType Convert(FreeQuant.Data.BarType barType) { switch (barType) { case FreeQuant.Data.BarType.Time: return BarType.Time; case FreeQuant.Data.BarType.Tick: return BarType.Tick; case FreeQuant.Data.BarType.Volume: return BarType.Volume; case FreeQuant.Data.BarType.Range: return BarType.Range; default: throw new ArgumentException(string.Format("Unsupported BarType - {0}", barType)); } }
internal void qZcLyn7Uf(double obj0, FreeQuant.Instruments.Currency obj1, DateTime obj2, string obj3) { this.portfolio.Account.Withdraw(obj0, obj1, obj2, obj3); foreach (Portfolio portfolio in this.portfolios.Values) portfolio.Account.Withdraw(obj0, obj1, obj2, obj3); }
internal static RegressionDistanceMode Convert(FreeQuant.Indicators.RegressionDistanceMode mode) { switch (mode) { case FreeQuant.Indicators.RegressionDistanceMode.Time: return RegressionDistanceMode.Time; case FreeQuant.Indicators.RegressionDistanceMode.Index: return RegressionDistanceMode.Index; default: throw new NotImplementedException("RegressionDistanceMode is not supported : " + (object)mode); } }
private static void RemoveInstrument(FreeQuant.Instruments.Instrument fq_instrument) { OpenQuant.instruments.Remove(fq_instrument.Symbol); Instrument instrument = Map.FQ_OQ_Instrument[fq_instrument] as Instrument; Map.OQ_FQ_Instrument.Remove(instrument); Map.FQ_OQ_Instrument.Remove(fq_instrument); }
internal static StopType Convert(FreeQuant.Trading.StopType stopType) { switch (stopType) { case FreeQuant.Trading.StopType.Fixed: return StopType.Fixed; case FreeQuant.Trading.StopType.Trailing: return StopType.Trailing; case FreeQuant.Trading.StopType.Time: return StopType.Time; default: throw new NotImplementedException("Stop type is not supported : " + (object)stopType); } }
internal BarSeriesEnumerator(FreeQuant.Series.BarSeries series) { this.series = series; this.enumerator = series.GetEnumerator(); }
internal static StopMode Convert(FreeQuant.Trading.StopMode stopMode) { switch (stopMode) { case FreeQuant.Trading.StopMode.Absolute: return StopMode.Absolute; case FreeQuant.Trading.StopMode.Percent: return StopMode.Percent; default: throw new NotImplementedException("Stop mode is not supported : " + (object)stopMode); } }