#56 [svn] <login successful - then this message>

closed-fixed
7
2006-08-24
2006-08-24
Anonymous
No

<will try again later - suspect something is just down>

Message: Post-Condition of function virtual time_t realtime_expiry::expiry_date(market_record&) const was violated, expression: now > libawf::date().
File: expiry_rules.cc
Line: 59
Function: virtual time_t realtime_expiry::expiry_date(market_record&) const
Error Type: N6libawf22postcondition_violatedE
Stack Trace:
#1 libawf::basic_exception::basic_exception(std::string const&, std::string const&, long, std::string const&, bool) [0x83be4fe]
#2 libawf::postcondition_violated::postcondition_violated(std::string const&, std::string const&, unsigned long, std::string const&) [0x83bfae7]
#3 libawf::awf_assert_post(bool, std::string const&, std::string const&, unsigned long, std::string const&) [0x83bee48]
#4 realtime_expiry::expiry_date(market_record&) const [0x81f0cc9]
#5 realtime_quote::get_quotes(std::vector<std::string, std::allocator<std::string> > const&, std::vector<std::string, std::allocator<std::string> > const&, std::vector<unsigned long, std::allocator<unsigned long> > const&, rtquote_record*) [0x81cef1b]
#6 portfolio_view::preview_done() [0x82ac721]
#7 libawf::dataview::begin_data_acquire(libawf::parameter_set const&) [0x841081c]
#8 libawf::record_view::display_grid(libawf::parameter_set&, std::ostream&) [0x84a34d4]
#9 libawf::record_view::render(libawf::parameter_set&, std::ostream&) [0x84a1b45]
#10 libawf::web_process::run(libawf::parameter_set&, std::ostream&) [0x83d400c]
#11 libawf::secure_web_process::run(libawf::parameter_set&, std::ostream&) [0x84000ae]
#12 libawf::web_application::run_process(libawf::process*, libawf::parameter_set&) [0x83bcc5e]
#13 libawf::web_application::run(int, char**) [0x83ba24e]
#14 /var/www/localhost/htdocs/ast/ast(main+0x4a) [0x8184f18]
#15 /lib/libc.so.6(__libc_start_main+0xa6) [0xb797e396]
#16 /var/www/localhost/htdocs/ast/ast(__gxx_personality_v0+0x12d) [0x81671a1]

Parameters: process=portfolio

Version: svn
Language: NOT USING NLS
Crypto: libmhash
TA-lib Version: < 0.2.0
Compression: enabled
SQL Support: enabled
OS: Linux 2.6.16-gentoo-r7
Bit Size: 32 bits
Server: Apache
User Agent: Opera/9.00 (Windows NT 5.1; U; en)
Contact: karenwilliamson@aci.on.ca

Discussion

  • Michael Williamson

    Logged In: YES
    user_id=1281708

    I can see how this is possible. I think if you logged in
    between 9:50 and 10:00 you would see this error. I have
    fixed the code as well this fixed another bug where AST
    didn't see the market open until 10:00. Thanks!

    SVN Commit #327:
    Index: src/src/expiry_rules.cc
    ===================================================================
    --- src/src/expiry_rules.cc (revision 323)
    +++ src/src/expiry_rules.cc (working copy)
    @@ -39,25 +39,37 @@
    {
    now.set_hour( m.open_hour() );
    now.set_minute( m.open_min() );
    - now += libawf::days(2) + libawf::minutes(20); //
    account for delay in quotes
    + now += libawf::days(2) + libawf::minutes(15); //
    account for delay in quotes
    AWF_ASSERT_POST( now > libawf::date() );
    return now;
    }else if( now.get_hour() >= m.close_hour() ||
    now.get_day_of_week() == 0 ) // sunday, or after 5 on any
    other day
    {
    now.set_hour( m.open_hour() );
    now.set_minute( m.open_min() );
    - now += libawf::days(1) + libawf::minutes(20); //
    account for delay in quotes
    + now += libawf::days(1) + libawf::minutes(15); //
    account for delay in quotes
    AWF_ASSERT_POST( now > libawf::date() );
    return now;
    }else if( now.get_hour() <= m.open_hour() )
    {
    - // bump time up to market open... I hope i'm
    - // not up this early.
    - now.set_hour( m.open_hour() );
    - now.set_minute( m.open_min() );
    - now += libawf::minutes(20); // account for delay in
    quotes
    - AWF_ASSERT_POST( now > libawf::date() );
    - return now;
    + libawf::date market_open;
    + market_open.set_hour( m.open_hour() );
    + market_open.set_minute( m.open_min() );
    + // Add 15 minutes to the market open time to account
    for
    + // delay in quotes. This should be configurable (in
    market options)
    + // since SQL database quotes might now have this delay.
    + market_open += libawf::minutes(15);
    +
    + // Market has not opened yet, expire at market open.
    + if( now < market_open )
    + {
    + return market_open;
    + }else
    + {
    + // The market is already open, and it is in the first
    + // hour of being open. Expire in 5 (as usual)
    + now += libawf::minutes(5);
    + return now;
    + }
    }

    // Just expire 5 minutes from now.

     
  • Michael Williamson

    • status: open --> closed
     
  • Michael Williamson

    • labels: --> Quote Engine (Yahoo)
    • milestone: --> Version 0.2.x (Final)
    • priority: 5 --> 7
    • assigned_to: nobody --> mwilliamson
    • status: closed --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks