SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Mon Jul 26, 2021 7:17 am

All times are UTC + 3 hours

Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: How to change Quotedata?
PostPosted: Thu Jan 04, 2018 2:15 pm 

Joined: Thu Mar 16, 2006 12:15 pm
Posts: 184
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!

Expect the unexpected. May your MM/RM be with you.

PostPosted: Tue Jan 09, 2018 11:08 am 

Joined: Wed May 05, 2010 9:49 pm
Posts: 583
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

PostPosted: Tue Jan 09, 2018 12:36 pm 

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6817
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)


PostPosted: Thu Nov 15, 2018 3:12 pm 

Joined: Fri Jun 15, 2018 1:15 pm
Posts: 1
Hi Dr. Anton, is there more info about the DataSeries.Update method anywhere that I can check out?

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 3 hours

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group