public void SetNewQuote(FreeQuant.Instruments.Instrument instrument, FreeQuant.Data.Quote quote) { try { if (this.stops.Count != 0) { List <ATSStop> list = (List <ATSStop>)null; if (this.activeStops.TryGetValue(instrument, out list)) { foreach (ATSStop atsStop in new ArrayList((ICollection)list)) { if (atsStop.Connected) { atsStop.OnNewQuote(quote); } } } } Strategy strategy = (Strategy)null; if (!this.strategies.TryGetValue(instrument, out strategy)) { return; } strategy.OnQuote((OpenQuant.API.Quote) this.objectConverter.Convert(quote)); } catch (Exception ex) { this.EmitError(ex); } }
public zo21q6cy3fImtUHATQ(SimulationExecutionProvider obj0, FIXNewOrderSingle obj1) { this.smCF4MYTNu = new Quote(); this.j57Fjc16NJ = 1E-08; this.A8bFJItyyx = obj0; this.PYBF7sahqY = obj1; this.kUyFaL3cQu = obj0.FillOnBarMode; this.L27FNaAWTp = obj0.FillAtLimitPrice; this.yFOFUpVbqt = obj0.FillAtStopPrice; if (obj1.TradeVolumeDelay == 0) this.gxTF8gufMx = true; if ((this.PYBF7sahqY as SingleOrder).OrdType == OrdType.TrailingStop || (this.PYBF7sahqY as SingleOrder).OrdType == OrdType.TrailingStopLimit) { switch ((this.PYBF7sahqY as SingleOrder).Side) { case Side.Buy: case Side.BuyMinus: this.zGRFvN99ge = double.MaxValue; break; case Side.Sell: case Side.SellShort: this.zGRFvN99ge = double.MinValue; break; default: throw new NotSupportedException("" + obj1.Side.ToString()); } } this.A8bFJItyyx.MyIPdEI7fi.Add(this.PYBF7sahqY.ClOrdID, this); this.dGEFgdOydF(); }
public MarketDataUpdateItem(MarketDataViewRow row, Quote quote, Trade trade, Bar bar) { this.Row = row; this.Quote = quote; this.Trade = trade; this.Bar = bar; }
protected override void OnUpdateQuote(Quote quote) { this.Cells[1].Value = quote.DateTime; this.Cells[6].Value = quote.BidSize; this.Cells[7].Value = quote.Bid; this.Cells[8].Value = quote.Ask; this.Cells[9].Value = quote.AskSize; }
public void Update(Quote quote, Trade trade, Bar bar) { if (!this.enabled) return; if (quote != null) this.OnUpdateQuote(quote); if (trade != null) this.OnUpdateTrade(trade); if (bar == null) return; this.OnUpdateBar(bar); }
public void OnNewQuote(IFIXInstrument instrument, Quote quote) { if (!this.Enabled) return; Quote quote1; if (!this.ALv6cyCmM.TryGetValue(instrument, out quote1)) { quote1 = new Quote(); this.ALv6cyCmM.Add(instrument, quote1); } switch (this.Input) { case BarFactoryInput.Bid: if (quote.Bid != quote1.Bid || quote.BidSize != quote1.BidSize) { this.AddTrade(instrument, quote.DateTime, quote.Bid, quote.BidSize); } break; case BarFactoryInput.Ask: if (quote.Ask != quote1.Ask || quote.AskSize != quote1.AskSize) { this.AddTrade(instrument, quote.DateTime, quote.Ask, quote.AskSize); } break; case BarFactoryInput.BidAsk: if (quote.Ask != quote1.Ask || quote.AskSize != quote1.AskSize) this.AddTrade(instrument, quote.DateTime, quote.Ask, quote.AskSize); if (quote.Bid != quote1.Bid || quote.BidSize != quote1.BidSize) { this.AddTrade(instrument, quote.DateTime, quote.Bid, quote.BidSize); } break; case BarFactoryInput.Middle: if (quote.Ask != quote1.Ask || quote.AskSize != quote1.AskSize || (quote.Bid != quote1.Bid || quote.BidSize != quote1.BidSize)) { this.AddTrade(instrument, quote.DateTime, (quote.Ask + quote.Bid) / 2.0, (quote.AskSize + quote.BidSize) / 2); } break; case BarFactoryInput.Spread: if (quote.Ask != quote1.Ask || quote.AskSize != quote1.AskSize || (quote.Bid != quote1.Bid || quote.BidSize != quote1.BidSize)) { this.AddTrade(instrument, quote.DateTime, quote.Ask - quote.Bid, 0); } break; } quote1.Ask = quote.Ask; quote1.Bid = quote.Bid; quote1.AskSize = quote.AskSize; quote1.BidSize = quote.BidSize; }
public void OnNewQuote(IFIXInstrument instrument, Quote quote) { if (!this.Enabled) return; double price; int size; switch (this.Input) { case BarFactoryInput.Bid: price = quote.Bid; size = quote.BidSize; break; case BarFactoryInput.Ask: price = quote.Ask; size = quote.AskSize; break; case BarFactoryInput.BidAsk: this.AddTrade(instrument, DateTime.Now, quote.Bid, quote.BidSize); this.AddTrade(instrument, DateTime.Now, quote.Ask, quote.AskSize); return; case BarFactoryInput.Middle: this.AddTrade(instrument, DateTime.Now, (quote.Ask + quote.Bid) / 2.0, (quote.AskSize + quote.BidSize) / 2); return; case BarFactoryInput.Spread: price = quote.Ask - quote.Bid; size = 0; break; default: return; } BarFactory.mU5OEr88NSmCpsBxeD u5Oer88NsmCpsBxeD = this.cqyLFWMOvs[instrument] as BarFactory.mU5OEr88NSmCpsBxeD; if (u5Oer88NsmCpsBxeD == null) { u5Oer88NsmCpsBxeD = new BarFactory.mU5OEr88NSmCpsBxeD(); this.cqyLFWMOvs.Add(instrument, u5Oer88NsmCpsBxeD); } if (price == u5Oer88NsmCpsBxeD.price && size == u5Oer88NsmCpsBxeD.size) return; this.AddTrade(instrument, DateTime.Now, price, size); u5Oer88NsmCpsBxeD.price = price; u5Oer88NsmCpsBxeD.size = size; }
public void EmitQuote(Instrument instrument, DateTime time, byte providerId, double bid, int bidSize, double ask, int askSize) { FreeQuant.Data.Quote quote = new FreeQuant.Data.Quote(time, bid, bidSize, ask, askSize); quote.ProviderId = providerId; if (this.MarketDataFilter != null) { quote = this.MarketDataFilter.FilterQuote(quote, instrument.Symbol); } if (quote == null) { return; } if (this.NewQuote != null) { this.NewQuote((object)this, new QuoteEventArgs(quote, (IFIXInstrument)instrument.instrument, (IMarketDataProvider)this)); } if (this.barFactory == null) { return; } this.barFactory.OnNewQuote((IFIXInstrument)instrument.instrument, quote); }
private double CcXFPEywDQ(Quote obj0, Trade obj1, Bar obj2) { SingleOrder singleOrder = this.PYBF7sahqY as SingleOrder; if (singleOrder.ContainsField(11103) && singleOrder.StrategyFill) return singleOrder.StrategyPrice; bool flag = !singleOrder.IsStopLimitReady && (singleOrder.OrdType == OrdType.TrailingStop || singleOrder.OrdType == OrdType.TrailingStopLimit || singleOrder.OrdType == OrdType.StopLimit); if (obj0 != null && (this.A8bFJItyyx.FillOnQuote && !flag || this.A8bFJItyyx.TriggerOnQuote && flag)) { if (!this.A8bFJItyyx.FillAtWorstQuoteRate || obj0.Bid <= obj0.Ask) { switch (singleOrder.Side) { case Side.Buy: case Side.BuyMinus: if (obj0.Ask != 0.0) return obj0.Ask; else break; case Side.Sell: case Side.SellShort: if (obj0.Bid != 0.0) return obj0.Bid; else break; default: throw new NotSupportedException("" + ((object) singleOrder.Side).ToString()); } } else { switch (singleOrder.Side) { case Side.Buy: case Side.BuyMinus: if (obj0.Bid != 0.0) return obj0.Bid; else break; case Side.Sell: case Side.SellShort: if (obj0.Ask != 0.0) return obj0.Ask; else break; default: throw new NotSupportedException("" + ((object) singleOrder.Side).ToString()); } } } if (obj1 != null && (this.A8bFJItyyx.FillOnTrade && !flag || this.A8bFJItyyx.TriggerOnTrade && flag) && obj1.Price != 0.0) return obj1.Price; if (obj2 != null && (this.A8bFJItyyx.FillOnBar && !flag || this.A8bFJItyyx.TriggerOnBar && flag)) { if (singleOrder.StrategyComponent == "which") return singleOrder.StrategyPrice; if (singleOrder.ForceMarketOrder) { if (obj2.Close != 0.0) return obj2.Close; if (obj2.Open != 0.0) return obj2.Open; } switch (this.kUyFaL3cQu) { case FillOnBarMode.LastBarClose: case FillOnBarMode.NextBarClose: return obj2.Close; case FillOnBarMode.NextBarOpen: return obj2.Open; } } return 0.0; }
public static void Add(Instrument instrument, string suffix, Quote quote) { DataManager.Add(instrument.Symbol + SERIES_SEPARATOR + suffix, quote); }
internal void miSxH6BDd(Instrument obj0, Quote obj1) { if (!this.isActive) return; if (Trace.IsLevelEnabled(TraceLevel.Verbose)) Trace.WriteLine(string.Format("fsfd", (object) this.Name, (object) obj0.Symbol, (object) obj1)); this.OnNewQuote(obj0, obj1); }
public SimpleDataObject(IFIXInstrument instrument, Quote quote) { this.DateTime = quote.DateTime; this.Instrument = instrument; this.DataType = 1; }
public QuoteAction(Instrument instrument, Quote quote) : base(instrument) { this.quote = quote; }
public HistoricalQuoteEventArgs(Quote quote, string requestId, IFIXInstrument instrument, IHistoricalDataProvider provider, int dataLength) : base(requestId, instrument, provider, dataLength) { this.Quote = quote; }
private void dGEFgdOydF() { if (!(this.PYBF7sahqY is SingleOrder)) return; SingleOrder singleOrder = this.PYBF7sahqY as SingleOrder; if (singleOrder.ContainsField(11201)) this.kUyFaL3cQu = (FillOnBarMode) singleOrder.FillOnBarMode; Instrument instrument = singleOrder.Instrument; bool flag = !singleOrder.IsStopLimitReady && (singleOrder.OrdType == OrdType.TrailingStop || singleOrder.OrdType == OrdType.TrailingStopLimit || singleOrder.OrdType == OrdType.StopLimit); if (singleOrder.OrdType == OrdType.Market) { if ((this.A8bFJItyyx.FillOnQuote && !flag || this.A8bFJItyyx.TriggerOnQuote && flag) && this.A8bFJItyyx.FillOnQuoteMode == FillOnQuoteMode.LastQuote) this.Y18FFPmDy5(instrument.Quote, (Trade) null, (Bar) null); if ((this.A8bFJItyyx.FillOnTrade && !flag || this.A8bFJItyyx.TriggerOnTrade && flag) && this.A8bFJItyyx.FillOnTradeMode == FillOnTradeMode.LastTrade) this.Y18FFPmDy5((Quote) null, instrument.Trade, (Bar) null); if ((this.A8bFJItyyx.FillOnBar && !flag || this.A8bFJItyyx.TriggerOnBar && flag) && ((this.kUyFaL3cQu == FillOnBarMode.LastBarClose || singleOrder.ForceMarketOrder) && this.A8bFJItyyx.BarFilter.Contains(instrument.Bar.BarType, instrument.Bar.Size))) this.Y18FFPmDy5((Quote) null, (Trade) null, instrument.Bar); } else { if (instrument.Quote != null && (this.A8bFJItyyx.FillOnQuote && !flag || this.A8bFJItyyx.TriggerOnQuote && flag) && this.A8bFJItyyx.FillOnQuoteMode == FillOnQuoteMode.LastQuote) this.Y18FFPmDy5(instrument.Quote, (Trade) null, (Bar) null); if (instrument.Trade != null && (this.A8bFJItyyx.FillOnTrade && !flag || this.A8bFJItyyx.TriggerOnTrade && flag) && this.A8bFJItyyx.FillOnTradeMode == FillOnTradeMode.LastTrade) this.Y18FFPmDy5((Quote) null, instrument.Trade, (Bar) null); if (instrument.Bar != null && (this.A8bFJItyyx.FillOnBar && !flag || this.A8bFJItyyx.TriggerOnBar && flag) && (this.A8bFJItyyx.BarFilter.Contains(instrument.Bar.BarType, instrument.Bar.Size) && this.A8bFJItyyx.FillOnBarMode == FillOnBarMode.LastBarClose)) { double close = instrument.Bar.Close; if (close != 0.0) this.wYBFLwFB4S(close, singleOrder.OrderQty); } } if (this.aXtFGP76FH) return; if (this.A8bFJItyyx.FillOnQuote || this.A8bFJItyyx.TriggerOnQuote) instrument.NewQuote += new QuoteEventHandler(this.PyJFklA8yp); if (this.A8bFJItyyx.FillOnTrade || this.A8bFJItyyx.TriggerOnTrade) instrument.NewTrade += new TradeEventHandler(this.YGKFrq1UXP); this.smCF4MYTNu = instrument.Quote; if (this.A8bFJItyyx.FillOnBar || this.A8bFJItyyx.TriggerOnBar) { if (singleOrder.ForceMarketOrder) { instrument.NewBar += new BarEventHandler(this.YgkFRBfPV0); instrument.NewBarOpen += new BarEventHandler(this.OyPFEsHGL2); } else if (singleOrder.OrdType == OrdType.Market) { switch (this.kUyFaL3cQu) { case FillOnBarMode.LastBarClose: case FillOnBarMode.NextBarClose: instrument.NewBar += new BarEventHandler(this.YgkFRBfPV0); break; case FillOnBarMode.NextBarOpen: instrument.NewBarOpen += new BarEventHandler(this.OyPFEsHGL2); break; } } else { instrument.NewBar += new BarEventHandler(this.YgkFRBfPV0); instrument.NewBarOpen += new BarEventHandler(this.OyPFEsHGL2); } } if ((int) this.PYBF7sahqY.TimeInForce != 54) return; Clock.AddReminder(new ReminderEventHandler(this.xT1FyAqCPT), this.PYBF7sahqY.ExpireTime, (object) null); }
public object Convert(FreeQuant.Data.Quote quote) { return(new Quote(quote)); }
protected virtual void OnUpdateQuote(Quote quote) { }
public override void Write(Instrument instrument, Quote quote) { if (this.error != null) throw this.error; this.Enqueue(instrument, (IDataObject) quote); }
private void Y18FFPmDy5(Quote obj0, Trade obj1, Bar obj2) { SingleOrder singleOrder = this.PYBF7sahqY as SingleOrder; if (singleOrder.OrdStatus != OrdStatus.New && singleOrder.OrdStatus != OrdStatus.PendingNew && (singleOrder.OrdStatus != OrdStatus.PartiallyFilled && singleOrder.OrdStatus != OrdStatus.Replaced)) return; double num1 = this.CcXFPEywDQ(obj0, obj1, obj2); double num2 = this.VirF0ddUxQ(singleOrder, obj0, obj1, obj2); if (num1 == 0.0 || num2 == 0.0) return; if (singleOrder.OrdType == OrdType.Market || singleOrder.OrdType == OrdType.TrailingStop && singleOrder.IsStopLimitReady) this.D35FmNWSPm(num1, num2); else this.wYBFLwFB4S(num1, num2); }
private void PyJFklA8yp(object obj0, QuoteEventArgs obj1) { SingleOrder singleOrder = this.PYBF7sahqY as SingleOrder; Quote quote = obj1.Quote; if (this.A8bFJItyyx.FillAtWorstQuoteRate || this.smCF4MYTNu.Bid <= this.smCF4MYTNu.Ask || quote.Bid <= quote.Ask) { switch (singleOrder.Side) { case Side.Buy: if (quote.Ask != this.smCF4MYTNu.Ask || quote.AskSize != this.smCF4MYTNu.AskSize) { this.Y18FFPmDy5(quote, (Trade) null, (Bar) null); break; } else break; case Side.Sell: case Side.SellShort: if (quote.Bid != this.smCF4MYTNu.Bid || quote.BidSize != this.smCF4MYTNu.BidSize) { this.Y18FFPmDy5(quote, (Trade) null, (Bar) null); break; } else break; } } else { switch (singleOrder.Side) { case Side.Buy: if (quote.Bid != this.smCF4MYTNu.Bid || quote.BidSize != this.smCF4MYTNu.BidSize) { this.Y18FFPmDy5(quote, (Trade) null, (Bar) null); break; } else break; case Side.Sell: case Side.SellShort: if (quote.Ask != this.smCF4MYTNu.Ask || quote.AskSize != this.smCF4MYTNu.AskSize) { this.Y18FFPmDy5(quote, (Trade) null, (Bar) null); break; } else break; } } this.smCF4MYTNu = quote; }
protected override void OnNewQuote(Instrument instrument, Quote quote) { foreach (ATSStop atsStop in new ArrayList((ICollection) this.activeStops[instrument])) { if (atsStop.Connected) atsStop.OnNewQuote(quote); } this.marketManager.OnQuote(instrument, quote); this.klBiFcxZsD.OnQuote(instrument, quote); this.csNiLdTRqH[instrument].OnQuote(quote); }
public void OnNewQuote(Quote quote) { if (!this.fTraceOnQuote) return; switch (this.fSide) { case PositionSide.Long: this.fCurrPrice = quote.Ask; break; case PositionSide.Short: this.fCurrPrice = quote.Bid; break; } this.fFillPrice = this.fCurrPrice; this.fTrailPrice = this.fCurrPrice; this.oEtiRP16ys(); }
private void ST74ZxO7ZP([In] object obj0, [In] FIXMarketDataSnapshotEventArgs obj1) { Console.WriteLine(BeAEwTZGlZaeOmY5cm.J00weU3cM6(4536)); FIXMarketDataSnapshot snapshotFullRefresh = obj1.MarketDataSnapshotFullRefresh; Instrument instrument = InstrumentManager.Instruments[(this.mdRequests[(object)snapshotFullRefresh.MDReqID] as RequestRecord).Symbol]; Trade trade = this.OEp4ErKILr[(object)instrument] as Trade; Quote quote = this.Hmv4SHEnBE[(object)instrument] as Quote; if (trade == null) { trade = new Trade(); this.OEp4ErKILr[(object)instrument] = (object)trade; } if (quote == null) { quote = new Quote(); this.Hmv4SHEnBE[(object)instrument] = (object)quote; } bool flag1 = false; bool flag2 = false; for (int i = 0; i < snapshotFullRefresh.NoMDEntries; ++i) { FIXMDEntriesGroup mdEntriesGroup = snapshotFullRefresh.GetMDEntriesGroup(i); switch (mdEntriesGroup.MDEntryType) { case '0': if (quote.Bid != mdEntriesGroup.MDEntryPx || quote.BidSize != (int)mdEntriesGroup.MDEntrySize) { quote.DateTime = Clock.Now; quote.Bid = mdEntriesGroup.MDEntryPx; quote.BidSize = (int)mdEntriesGroup.MDEntrySize; flag2 = true; break; } else break; case '1': if (quote.Ask != mdEntriesGroup.MDEntryPx || quote.AskSize != (int)mdEntriesGroup.MDEntrySize) { quote.DateTime = Clock.Now; quote.Ask = mdEntriesGroup.MDEntryPx; quote.AskSize = (int)mdEntriesGroup.MDEntrySize; flag2 = true; break; } else break; case '2': if (trade.Price != mdEntriesGroup.MDEntryPx || trade.Size != (int)mdEntriesGroup.MDEntrySize) { trade.DateTime = Clock.Now; trade.Price = mdEntriesGroup.MDEntryPx; trade.Size = (int)mdEntriesGroup.MDEntrySize; flag1 = true; break; } else break; } } if (flag1 && this.odL46gHXsq != null) this.odL46gHXsq((object)this, new TradeEventArgs(new Trade(trade), (IFIXInstrument)instrument, (IMarketDataProvider)this)); if (flag2 && this.uQX4e0V1fj != null) this.uQX4e0V1fj((object)this, new QuoteEventArgs(new Quote(quote), (IFIXInstrument)instrument, (IMarketDataProvider)this)); if (this.oSc4rhuvbm == null) return; this.oSc4rhuvbm((object)this, new MarketDataSnapshotEventArgs(obj1.MarketDataSnapshotFullRefresh)); }
internal void ddk6JqyZZD(Quote obj0) { if (!this.fTraceOnQuote) return; switch (this.fSide) { case PositionSide.Long: this.fCurrPrice = obj0.Bid; break; case PositionSide.Short: this.fCurrPrice = obj0.Ask; break; } this.fFillPrice = this.fCurrPrice; this.fTrailPrice = this.fCurrPrice; this.XqY6FAU6Mj(); }
public void EmitQuote(Quote quote, Instrument instrument) { if (this.MarketDataFilter != null) { quote = this.MarketDataFilter.FilterQuote(quote, instrument.Symbol); if (quote == null) return; } if (this.uQX4e0V1fj != null) this.uQX4e0V1fj((object)this, new QuoteEventArgs(quote, (IFIXInstrument)instrument, (IMarketDataProvider)this)); if (this.barFactory == null) return; this.barFactory.OnNewQuote((IFIXInstrument)instrument, quote); }
public abstract void Write(Instrument instrument, Quote quote);
public void Add(string series, Quote quote) { DataManager.Add(this, series, quote); }
protected virtual void OnNewQuote(Instrument instrument, Quote quote) { }
public void Add(Quote quote) { DataManager.Add(this, quote); }
public static void Add(string series, Quote quote) { DataManager.server.Add(series, quote); }
protected override void OnNewQuote(Instrument instrument, Quote quote) { foreach (Stop stop in new ArrayList((ICollection) this.activeStops[instrument])) { if (stop.Connected) stop.ddk6JqyZZD(quote); } this.A6MpF2380O.OnQuote(instrument, quote); this.HeHpDewVKD.OnQuote(instrument, quote); this.marketManager.OnQuote(instrument, quote); this.exits[instrument].OnQuote(quote); this.entries[instrument].OnQuote(quote); this.moneyManagers[instrument].OnQuote(quote); this.riskManagers[instrument].OnQuote(quote); }
public static void Add(Instrument instrument, Quote quote) { DataManager.Add(instrument, SUFFIX_QUOTE, quote); }
private double VirF0ddUxQ(SingleOrder obj0, Quote obj1, Trade obj2, Bar obj3) { bool flag = !obj0.IsStopLimitReady && (obj0.OrdType == OrdType.TrailingStop || obj0.OrdType == OrdType.TrailingStopLimit || obj0.OrdType == OrdType.StopLimit); if (obj1 != null && this.A8bFJItyyx.PartialFills && (this.A8bFJItyyx.FillOnQuote && !flag || this.A8bFJItyyx.TriggerOnQuote && flag)) { if (!this.A8bFJItyyx.FillAtWorstQuoteRate || obj1.Bid <= obj1.Ask) { switch (obj0.Side) { case Side.Buy: if (obj1.AskSize > 0) return (double) obj1.AskSize; else break; case Side.Sell: case Side.SellShort: if (obj1.BidSize > 0) return (double) obj1.BidSize; else break; default: return obj0.OrderQty; } } else { switch (obj0.Side) { case Side.Buy: if (obj1.BidSize > 0) return (double) obj1.BidSize; else break; case Side.Sell: case Side.SellShort: if (obj1.Ask > 0.0) return (double) obj1.AskSize; else break; default: return obj0.OrderQty; } } } if ((this.A8bFJItyyx.FillOnTrade && !flag || this.A8bFJItyyx.TriggerOnTrade && flag) && obj2 != null) { if ((obj0.OrdType == OrdType.Limit || (obj0.OrdType == OrdType.StopLimit || obj0.OrdType == OrdType.TrailingStopLimit) && obj0.IsStopLimitReady) && (obj0.CumQty == 0.0 && Math.Abs(obj2.Price - obj0.Price) < 0.001 && (obj0.TradeVolumeDelay != 0 && !this.gxTF8gufMx))) { this.w02FZf7vnP += obj2.Size; if (this.w02FZf7vnP <= obj0.TradeVolumeDelay) return 0.0; this.gxTF8gufMx = true; if (this.A8bFJItyyx.PartialFills) return (double) (this.w02FZf7vnP - obj0.TradeVolumeDelay); else return obj0.OrderQty; } else if (this.A8bFJItyyx.PartialFills) return (double) obj2.Size; } return obj0.OrderQty; }