<?php
include_once("stock.class.php");
include_once("database.class.php");


class singleStock {

	public $askingPrice;
	public $highAskingPrice;
	public $biddingPrice;
	public $highBiddingPrice;
	public $barDate;
	public $identifier;
	public $volume;
	public $barStatus;
	public $beginningBiddingPrice;
	public $endBiddingPrice;
	public $startingBiddingPrice;

	function __construct($barPosition)
	{
	//	$this->identifier = $barPosition['instrument'];
		$this->barDate = $barPosition->time;
		$this->askingPrice = $barPosition->openAsk;
		$this->biddingPrice = $barPosition->openBid;
		$this->highAskingPrice = $barPosition->highAsk;
		$this->highBiddingPrice = $barPosition->highBid;
		$this->volume = $barPosition->volume;
		$this->barStatus = $barPosition->complete;
		$this->beginningBiddingPrice = $barPosition->openMid;
		$this->startingBiddingPrice = $barPosition->openBid;
		if($this->barStatus == 1){
			$this->endBiddingPrice = $barPosition->closeBid;
		}
		else {
			$this->endBiddingPrice = $barPosition->lowBid;
		}
	}
}


?>