private void frame3 ( ) { // ===== Simplified Version ===== // SELECT co_id = s_co_id, exch_id = s_ex_id, s_name = s_name // FROM security WHERE s_symb = symbol String sql = "SELECT s_co_id, s_ex_id, s_name FROM security WHERE " + "s_symb = " + paramHelper . getSymbol ( ) ; Scan s = executeQuery ( sql ) ; coId = ( Long ) s . getVal ( "s_co_id" ) . asJavaVal ( ) ; exchId = ( String ) s . getVal ( "s_ex_id" ) . asJavaVal ( ) ; sName = ( String ) s . getVal ( "s_name" ) . asJavaVal ( ) ; // SELECT market_price = lt_price FROM last_trade // WHERE lt_s_symb = symbol sql = "SELECT lt_price FROM last_trade WHERE " + "lt_s_symb = " + paramHelper . getSymbol ( ) ; s = executeQuery ( sql ) ; marketPrice = ( Double ) s . getVal ( "lt_price" ) . asJavaVal ( ) ; // SELECT type_is_market = tt_is_mrkt, type_is_sell = tt_is_sell // FROM trade_type WHERE tt_id = trade_type_id sql = "SELECT tt_is_mrkt, tt_is_sell FROM trade_type WHERE " + "tt_id = " + paramHelper . getTradeTypeId ( ) ; s = executeQuery ( sql ) ; typeIsMarket = ( Integer ) s . getVal ( "tt_is_mrkt" ) . asJavaVal ( ) ; typeIsSell = ( Integer ) s . getVal ( "tt_is_sell" ) . asJavaVal ( ) ; if ( typeIsMarket == 1 ) { statusId = "A" ; } else { statusId = "B" ; } // TODO: Implement this version // ===== Full Version ===== // Get information on the security if ( true ) { // SELECT co_id = co_id FROM company WHERE co_name = co_name // SELECT exch_id = s_ex_id, s_name = s_name, symbol = s_symb // FROM security WHERE s_co_id = co_id AND s_issue = issue } else { // SELECT co_id = s_co_id, exch_id = s_ex_id, s_name = s_name // FROM security WHERE s_symb = symbol // SELECT co_name = co_name FROM company WHERE co_id = co_id } // Get current pricing information for the security // SELECT market_price = lt_price FROM last_trade // WHERE lt_s_symb = symbol // Set trade characteristics based on the type of trade // SELECT type_is_market = tt_is_mrkt, type_is_sell = tt_is_sell // FROM trade_type WHERE tt_id = trade_type_id // If this is a limit-order, then the requested_price was passed in to the frame, // but if this a market-order, then the requested_price needs to be set to the // current market price. // if( type_is_market ) then { // requested_price = market_price // } // TODO: Estimation }
Estimate overall effects of the trade