Package org.td.common.beans

Examples of org.td.common.beans.Trade


  }
 
  private Trade[] initTrade(){
   
    Trade trade = new Trade();
    trade.setBasketId(1);
    trade.setCloseDate(new Date());
    trade.setClosePrice(45.67);
    trade.setCloseSignal("Some signal");
    trade.setEntryDate(new Date());
    trade.setOpenSignal("Signal to open");
    trade.setPrice(67.66);
    trade.setStopLoss(67.33);
    trade.setStopProfit(34.55);
    trade.setTicker("GAZP");
    trade.setType('L');
    trade.setVol(107);
   
    return new Trade[] {trade};
  }
View Full Code Here


        "FROM trades WHERE basket_id = ? ORDER BY entry_date DESC";

    public Trade getTrades(final Integer basketId) {
        ParameterizedRowMapper<Trade> mapper = new ParameterizedRowMapper<Trade>() {
            public Trade mapRow(ResultSet rs, int rowNum) throws SQLException {
                Trade trade = new Trade();
                trade.setBasketId(basketId);
                trade.setTicker(rs.getString("ticker"));
                trade.setType((char) rs.getByte("type"));
                trade.setPrice(rs.getDouble("price"));
                trade.setClosePrice(rs.getDouble("close_price"));
                trade.setStopLoss(rs.getDouble("stop_loss"));
                trade.setStopProfit(rs.getDouble("stop_profit"));
                trade.setVol(rs.getInt("vol"));
                trade.setOpenSignal(rs.getString("open_signal"));
                trade.setCloseSignal(rs.getString("close_signal"));
                trade.setEntryDate(rs.getDate("entry_date"));
                trade.setCloseDate(rs.getDate("close_date"));
                return trade;
            }
        };

        return getSimpleJdbcTemplate().queryForObject(ALL_TRADES_SQL, mapper,
View Full Code Here

TOP

Related Classes of org.td.common.beans.Trade

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.