Location: PHPKode > projects > Uniform Price Markets > UPmarkets-0.1.0/inc.d/market_common_finale.php
<?php

// (C) 2000 LinuxFutures.com, Inc.
// 
// Part of UPmarkets - the software behind the LinuxFutures game site
//                     visit www.LinuxFutures.com to play
//
//  We are making the software available to you under the GNU General Public License,
//  a copy of which should accompany this software in the file LICENSE.
//
// A web-based copy of the LICENSE is located at http://www.gnu.org/copyleft/gpl.txt
//
// While there is no charge for using this software, there are important restrictions.
//
// This LICENSE does not allow, in general, proprietary modifications or proprietary derivative works.
// If you base new commercial products on our work, great, but you have to give them away just as we did.
//
// This software carries ABSOLUTELY NO WARRANTY. It is offered AS-IS, and may not work at all
//  or may have harmful or hazardous side effects.
//
// 
// -------------------- what this file does ---------------------
// html generator for markets in finale 
// 


// get the exact finale closing date

$sql = "select DATE_ADD(trading_closes, INTERVAL finale_days DAY) as finale_closes FROM markets WHERE symbolid=".$symbolid.";";
$r = mysql_query($sql,$db_link);
mysql_error_sanity("market_common_finale.php ".$sql);
$finale_closes = mysql_result($r,0,0);
mysql_free_result($r);

// echo the header

echo "<H1>Market ".$symbolid." -- ".market_symbol($symbolid)."</H1><P>";
?>

<H2>Finale</H2><br>

<H3>Explanation</H3>
 Trading in this market finished on <?php echo $M["trading_closes"]; ?>. 
The market is now in the finale round where the final value of market
units will be determined. This determination is made by the <b>referees</b>.<P>

When a market is created, the proposer can choose who the referees will be: {anyone}, {traders}, or {partners}. These terms are defined as follows:

<UL>
<LI><i>anyone</i> includes everyone with a user id on this web site</LI>
<LI><i>traders</i> include anyone who, at any time, has traded the units in this market</LI>
<LI><i>partners</i> is very restrictive, and includes only close associates of the market chairperson for this market.   Please remember that often, markets are created and run by fellow users of this website.  Neither the owners of this website nor its management is responsible for what your fellow game participants do or the decisions they make for their market.
</LI>
</UL>
<P> 
In this market, <b>referees</b> are <i><?php echo $M["referees"]; ?></i>.<P>
<P>
<H3>Procedure</H3>
 <OL>
 <LI>Referees submit their estimates of the fair value for leftover market units, a feedback score that rates the quality of the market managers' efforts, and a rationale -- which can explain these entries, (and say goodbye, hooray, etc.)</LI>
 <LI>At <?php echo $finale_closes; ?>  the finale period is closed.</LI>
 <LI>The <b>median</b> estimate of fair value is used to liquidate leftover units in the market.  [Note: the median is found by sorting all the values from high to low and picking the value that is in the middle of the list. It is NOT the average] If you have a + position, you will receive the median fair value for each of the units you had bought earlier. If you have a - position, you will pay the median fair value for each of the units you had sold short earlier. </LI>  
 <LI>The market chairman and partners earn feedback points equal to the <b>sum</b> of all the feedback entries left by the referees. We use the sum here, instead of the median, because we felt that the market managers deserved some credit for the popularity (or notoriety) of their market.  </LI>
</OL>

<H3>Postings</H3>
<?php echo finale_as_discussion($symbolid); ?>
<P>

<H3>Summary</H3>
The <b>median fair value</b> is currently 
<b><?php echo finale_fairvalue($symbolid); ?></b>.
<P>

<H3>Add Your Opinion!</H3>
<br>
<P>
<form action=<?echo $PHP_SELF?> method=post>
<input type=hidden name=symbolid value=<?php echo $symbolid; ?>>
<table columns=2 width=80% border=1>
<tr>
<th><b>Item</b></th>
<th><b>Your Opinion</b></th>
</tr>
<tr>
<td>Fair Price for liquidating left over market units
<?php echo "[price of ".$M["price_floor"]." to ".$M["price_ceiling"]."]"; ?>
</td>
<td><input type=text name=fairvalue size=10></td>
</tr>
<tr>
<td>Rate the market managers [feedback of -255 to 255 points]</td>
<td><input type=text name=feedback  size=10> </td>
</tr>
</table><br>
Rationale/Commentary [255 characters max]
<br>
<textarea name=rationale cols=41 rows=6 wrap=physical>
</textarea>
<table columns=2 width=40>
<tr>
<td>Userid</td>
<td>Password</td>
</tr>
<tr> 
<td><input type=text name=userid size=5></td>
<td><input type=password name=password size=20></td> 
</tr>
</table><br>
<input type=submit name=submit value="submit">
<small><b>Be warned</b>: You can only post once. You can not revise or undo a previous posting.</small>



Return current item: Uniform Price Markets