<?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>
				MovingAverageStrategy
			</AgentName>
			<Summary>
				The agent sends an order when the short term moving average line of futures price crosses over the medium term moving average line.
				If trend of short term moving average line is up, the agent sends buying order and when it is down, he sends selling order.
			</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 -->
					Strategy.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? -->
					long
				</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. -->
				following the 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 -->
				The agent calculates short term moving average of futures price and medium term moving average. If these two lines cross over each other, the agent send order. If trend of short term moving average line is up, the agent sends buying order and when it is down, he sends selling order.
Limited price is given by following function. 
Dp represent absolute value of difference between the latest futures price and the second futures spot price. 
Limited Price=the latest spot prcei + Dp + (Dp/4)*Gaussian.Order volume is obtained as an uniform random numbers between minQuote and maxQuote. 

			</OutlineOfAlgorithm>
			<Program>
				<Class>
				<!-- Please introduce each class that you code. -->
				<ClassName>MovingAverageStrategy</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 -->
								15
							</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 -->
								30
							</ValueOfField>
							<ReasonOfValue>
								<!-- Please write the reason why you adopt the value, -->
								<!-- or why you suppose the range. -->
							</ReasonOfValue>
						</Field>

						<Field>
							<FieldName>shortReferenceTerm</FieldName>
							<FieldType> int</FieldType>
							<RoleOfField>
								Time window for which short term moving average is taken.
							</RoleOfField>
							<RangeOfField>
								<!-- expected range of the member constant -->
								1  ... 40
							</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. -->
								empirical rule.
							</ReasonOfValue>
						</Field>

						<Field>
							<FieldName>mediumReferenceTerm</FieldName>
							<FieldType> int</FieldType>
							<RoleOfField>
								Time window for which medium term moving average is taken.
							</RoleOfField>
							<RangeOfField>
								<!-- expected range of the member constant -->
								shortReferenceTerm  ... 100
							</RangeOfField>
							<ValueOfField>
								<!-- adopt value for the experiment -->
								20
							</ValueOfField>
							<ReasonOfValue>
								<!-- Please write the reason why you adopt the value, -->
								<!-- or why you suppose the range. -->
								empirical rule.
							</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. -->
				MovingAverageStrategy.doc, MovingAverageStrategy.java
			</Attachment>
			<Comment>
			</Comment>
		</Agent>
	</ApplicationForm>

