<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="UAgentForm.xsl" ?>
<!DOCTYPE ApplicationForm SYSTEM "UAgentForm.dtd">

	<ApplicationForm>
		<TeamName>
			<!-- Team Name -->
			U-Mart Project
		</TeamName>
		<Copyright>
			(c)2000 Rikiya FUKUMOTO
		</Copyright>
		<Copyright>
			(c)2002 U-Mart Project
		</Copyright>
		<Producer>
			<!-- All Producers should be written -->
			<Name>
				Yuji KAWABE
			</Name>
			<Affiliation>
				Dept. of Information Science and Intelligent Systems, 
                                Faculty of Engineering, The University of Tokushima
			</Affiliation>
			<Address>
				2-1 Minamijosanjima, Tokushima, Tokushima, 770-8506, Japan.
			</Address>
			<Phone>
				+81-88-656-9139
			</Phone>
			<Fax>
				+81-88-656-9139
			</Fax>
			<Email>
				yuuji@is.tokushima-u.ac.jp
			</Email>
			<URL>			
			</URL>
		</Producer>
		<Producer>
			<!-- All Producers should be written -->
			<Name>
				Isao ONO
			</Name>
			<Affiliation>
				Dept. of Information Science and Intelligent Systems, 
                                Faculty of Engineering, The University of Tokushima
			</Affiliation>
			<Address>
				2-1 Minamijosanjima, Tokushima, Tokushima, 770-8506, Japan.
			</Address>
			<Phone>
				+81-88-656-9139
			</Phone>
			<Fax>
				+81-88-656-9139
			</Fax>
			<Email>
				isao@is.tokushima-u.ac.jp
			</Email>
			<URL>			
			</URL>
		</Producer>
		<Producer>
			<!-- All Producers should be written -->
			<Name>
				Hajime KITA
			</Name>
			<Affiliation>
				National Institution for Academic Degree
			</Affiliation>
			<Address>
				3-29-1 Ootsuka, Bunkyo, Tokyo, 112-0012, Japan.
			</Address>
			<Phone>
				+81-3-3942-9972
			</Phone>
			<Fax>
				+81-3-3942-9972
			</Fax>
			<Email>
				kita@niad.ac.jp
			</Email>
			<URL>			
			</URL>
		</Producer>
		<Agent>
			<AgentName>SFSpreadStrategy</AgentName>
			<Summary>
				The agent orders when a spread between spot and future price is wider
				than threshold.
				If future price is higher than spot price, the agent send a buying order, and it send a selling order
				when futures price is lower than spot price.
			</Summary>
			<ExecutionAndArguments>
				<!-- Command and arguments for the experiment -->
				according as TestStrategy.java 
			</ExecutionAndArguments>
			<SummaryOfArguments>
				according as TestStrategy.java 
			</SummaryOfArguments>
			<Type>
				<!-- To charactalize the agent, please answer following items. -->
				<Tool>
					<!-- distributed program used or based on the agent-->
					<!-- TestStrategy.java, SampleStrategy.java or 
					CProcotol.java -->
					TestStrategy.java 
				</Tool>
				<NumberOfOrders>
					<!-- How many orders the agent sends to server at one session-->
					1
				</NumberOfOrders>
				<MarketOrLimit>
					<!-- Dose the agent order by limit price or market price? -->
					Limit Price
				</MarketOrLimit>
				<AssetManagement>
					<!-- Dose the agent manage it's own asset? -->
					Yes
				</AssetManagement>
				<ReferenceData>
					<!-- Please list data that the agent uses. -->
				futures price, spot price, position, cash, remaining session
				</ReferenceData>
				<LongOrShortTerm>
					<!-- Which is the agent long term or short term trader? -->
					Short term trader
				</LongOrShortTerm>
				<AgainstOrFollowTrend>
					<!-- Which does the agent trade ageinst the trend or follow? -->
					<!-- Please image behaviors of agent. If it buy when u-mart price -->
					<!-- is down, it can be said contrarian. -->
					Against Trend
				</AgainstOrFollowTrend> 
				<Learning>
					<!-- Does the agent use learning argorithms ? -->
					No
				</Learning>
				<OnlineLearning>
					<!-- Does the agent lean on line? -->
					No
				</OnlineLearning>			
			</Type>
			<OutlineOfAlgorithm>
				<!-- Please introduce feature of the agent. -->
				<!-- Note, please submit details of strategy on the attached slip. -->
				<!-- The slip should be printable pdf format. -->
				<!-- It can be written by free style with figure or flow chart according to -->
				<!-- need.  -->
				<!-- The name of the slip have to list in the following <attachment> field -->
				Getting last future price (U-Mart price) and spot price.
				If a spread between future and spot price is wider than spreadRatioThreshold,
				the agent send an order.
				If future price is higher (lower) than spot price, it buy (sell).
				Order price is given by Gaussian distribution 
				whose mean value is the latest futures price and standard deviation is widthOfPrice.
				Order Volume is obtained as an uniform random numbers between minQuote and maxQuote.
			</OutlineOfAlgorithm>
			<Program>
				<Class>
					<!-- Please introduce each class that you code. -->
					<ClassName>SPSpreadStrategy</ClassName>
					<SuperClass>
						<!-- Super Class (if it has) -->
						Strategy
					</SuperClass>
					<SummaryOfClass>
						Same as Summary of Agent
					</SummaryOfClass>
					<Fields>
						<Field>
							<FieldName>maxQuant</FieldName>
							<FieldType> int</FieldType>
							<RoleOfField>
								Maximam volume of one order
							</RoleOfField>
							<RangeOfField>
								<!-- expected range of the member constant -->
								(minQuant+1) ... (initial cash/300,000)
							</RangeOfField>
							<ValueOfField>
								<!-- adopt value for the experiment -->
								50
							</ValueOfField>
							<ReasonOfValue>
								<!-- Please write the reason why you adopt the value, -->
								<!-- or why you suppose the range. -->
							</ReasonOfValue>
						</Field>
						<Field>
							<FieldName>minQuant</FieldName>
							<FieldType> int</FieldType>
							<RoleOfField>
								Minimum volume of one order
							</RoleOfField>
							<RangeOfField>
								<!-- expected range of the member constant -->
								1 ... (maxQuant-1)
							</RangeOfField>
							<ValueOfField>
								<!-- adopt value for the experiment -->
								10
							</ValueOfField>
							<ReasonOfValue>
								<!-- Please write the reason why you adopt the value, -->
								<!-- or why you suppose the range. -->
							</ReasonOfValue>
						</Field>
						<Field>
							<FieldName>maxPosition</FieldName>
							<FieldType> int</FieldType>
							<RoleOfField>
								Upper bound of net position. For asset management.
							</RoleOfField>
							<RangeOfField>
								<!-- expected range of the member constant -->
								1 ... (initial cash/300,000)
							</RangeOfField>
							<ValueOfField>
								<!-- adopt value for the experiment -->
								300
							</ValueOfField>
							<ReasonOfValue>
								<!-- Please write the reason why you adopt the value, -->
								<!-- or why you suppose the range. -->
							</ReasonOfValue>
						</Field>
						<Field>
							<FieldName>spreadRatioThreshold</FieldName>
							<FieldType> double</FieldType>
							<RoleOfField>
								Threshold between spot and futures price to decide sendind other or not
							</RoleOfField>
							<RangeOfField>
								<!-- expected range of the member constant -->
								0 ... 1
							</RangeOfField>
							<ValueOfField>
								<!-- adopt value for the experiment -->
								300
							</ValueOfField>
							<ReasonOfValue>
								<!-- Please write the reason why you adopt the value, -->
								<!-- or why you suppose the range. -->
							</ReasonOfValue>
						</Field>


					</Fields>
					<Methods>
						<Method>
							<MethodName>getOrder</MethodName>
							<SummaryOfMethod>to dicide order</SummaryOfMethod>
							<ReturnedType>Order</ReturnedType>
							<MethodArguments>
								<MethodArgument>
									<MethodArgumentName>spotPrice</MethodArgumentName>
									<MethodArgumentType>int[]</MethodArgumentType>
									<RoleOfMethodArgument>Time Series of spot price</RoleOfMethodArgument>
									<RangeOfMethodArgument>
										<!-- expected range of the member constant -->
										1 ... 
									</RangeOfMethodArgument>
								</MethodArgument>
								<MethodArgument>
									<MethodArgumentName>futurePrice</MethodArgumentName>
									<MethodArgumentType>int[]</MethodArgumentType>
									<RoleOfMethodArgument>Time Series of futures price</RoleOfMethodArgument>
									<RangeOfMethodArgument>
										<!-- expected range of the member constant -->
										-1 : When trade is failure, positive value : contracted futures price
									</RangeOfMethodArgument>
								</MethodArgument>
								<MethodArgument>
									<MethodArgumentName>pos</MethodArgumentName>
									<MethodArgumentType>int</MethodArgumentType>
									<RoleOfMethodArgument>current position</RoleOfMethodArgument>
									<RangeOfMethodArgument>
										<!-- expected range of the member constant -->
										Positive is buying position. Nagative is selling position.
									</RangeOfMethodArgument>
								</MethodArgument>
								<MethodArgument>
									<MethodArgumentName>money</MethodArgumentName>
									<MethodArgumentType>long</MethodArgumentType>
									<RoleOfMethodArgument>amount of cash</RoleOfMethodArgument>
									<RangeOfMethodArgument>
										<!-- expected range of the member constant -->
										0 ... 
									</RangeOfMethodArgument>
								</MethodArgument>
								<MethodArgument>
									<MethodArgumentName>restDay</MethodArgumentName>
									<MethodArgumentType>int</MethodArgumentType>
									<RoleOfMethodArgument>
										Number of  to the closing of market
									</RoleOfMethodArgument>
									<RangeOfMethodArgument>
										<!-- expected range of the member constant -->
										0 ... 240
									</RangeOfMethodArgument>
								</MethodArgument>
							</MethodArguments>
						</Method>
					</Methods>
				</Class>
			</Program>
			<Attachment>
				<!-- In this field, please note file name 
					that all you make or modified for
					this agent. That is include source code of the agent and
					details of strategyes and so on. -->
				SFSpreadStrategy.doc, SFSpreadStrategy.java
			</Attachment>
			<Comment>
			</Comment>
		</Agent>
	</ApplicationForm>

