SmartQuant Discussion

How to change Quotedata?
Page 1 of 1

Author:  fliesch [ Thu Jan 04, 2018 2:15 pm ]
Post subject:  How to change Quotedata?

I try to filter quote data:
- I can delete bad quotes with something like this: DataManager.DeleteQuote(thisinstrument, quote.DateTime);
- But I cannot change a quote. E.g. I there is a mistake with the . that the quote is 1005 instead of 100.5...
How to solve that?

I mean I can do something like:
{lastquoteask = quote.Ask/10;

the problem is: I cannot save myquote, change a quote.

Thanks for help!

Author:  skuvv [ Tue Jan 09, 2018 11:08 am ]
Post subject:  Re: How to change Quotedata?

Hello fliesch,
you cannot update quotes or other market data in database.
You should delete old record and next add updated record.

Script example:
public class MyScript : Script
   public override void Run()
      Instrument instrument  = InstrumentManager.Instruments["DAX Mar18"];
      QuoteSeries quotes =  DataManager.GetHistoricalQuotes(instrument, DateTime.MinValue, DateTime.MaxValue);
      Console.WriteLine("total quotes: {0}", quotes.Count);

      foreach(Quote quote in quotes)
      Console.WriteLine("update quote");
      DataManager.DeleteQuote(instrument, quotes[0].DateTime);
      Quote newquote = new Quote(quotes[0].DateTime, quotes[0].Bid+1, quotes[0].BidSize, quotes[0].Ask+2, quotes[0].AskSize);
      DataManager.Add(instrument, newquote);

      quotes =  DataManager.GetHistoricalQuotes(instrument, DateTime.MinValue, DateTime.MaxValue);
      foreach(Quote quote in quotes)

Build succeeded.
total quotes: 1
09.01.2018 10:50:57 bidSize=1 bid=100 ask=102 askSize=2
update quote
09.01.2018 10:50:57 bidSize=1 bid=101 ask=104 askSize=2

Author:  Dr. Anton Fokin [ Tue Jan 09, 2018 12:36 pm ]
Post subject:  Re: How to change Quotedata?

Hi, I think we are talking about OQ 3 here, correct?

OQ 2014 has DataSeries.Update method

public virtual void Update(Int64 index, DataObject obj)


Author:  HarlandB [ Thu Nov 15, 2018 3:12 pm ]
Post subject:  Re: How to change Quotedata?

Hi Dr. Anton, is there more info about the DataSeries.Update method anywhere that I can check out?

Page 1 of 1 All times are UTC + 3 hours
Powered by phpBB® Forum Software © phpBB Group