can't run ActiveQuant example

View: New views
2 Messages — Rating Filter:   Alert me  

can't run ActiveQuant example

by czyjava :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Anybody has been running ActiveQuant example ? Based on this url,
http://www.activequant.org/wiki/aqt-env-docs, I can't run it.

Firstly it will complain it doesn't carry derby, then I modify its
database properties as this,

database.driver=com.mysql.jdbc.Driver
database.url=jdbc:mysql://localhost:3306/activequant_dao_test?password=root&user=root&create=true

database.dialect=org.hibernate.dialect.MySQL5Dialect
database.showSql=true

then I found it will create tables, but NO any records in the table,
looks like it didn't populate testing data.

Any clues ?

Thanks.
Edward

_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi

Re: can't run ActiveQuant example

by Pierrick Hascoet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Here is a patch to help you to start with the examples.

At first you will be able to run the historydownloader example to fetch
a stock quotation from yahoo and to save the downloaded data to the
database.

Then, you can try to re run the Analysis example.

Regards,
Pierrick.

czy11421 wrote:

> Anybody has been running ActiveQuant example ? Based on this url,
> http://www.activequant.org/wiki/aqt-env-docs, I can't run it.
>
> Firstly it will complain it doesn't carry derby, then I modify its
> database properties as this,
>
> database.driver=com.mysql.jdbc.Driver
> database.url=jdbc:mysql://localhost:3306/activequant_dao_test?password=root&user=root&create=true
>
> database.dialect=org.hibernate.dialect.MySQL5Dialect
> database.showSql=true
>
> then I found it will create tables, but NO any records in the table,
> looks like it didn't populate testing data.
>
> Any clues ?
>
> Thanks.
> Edward
>
> _______________________________________________
> ccapi mailing list
> ccapi@...
> http://activestocks.de/cgi-bin/mailman/listinfo/ccapi

diff --git a/pom.xml b/pom.xml
index 721699d..877be8a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -248,13 +248,19 @@
  <!-- JDBC driver (runtime dependency) -->
 
  <!-- Uncomment following lines if using Derby -->
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.1.3.1</version>
+ <scope>runtime</scope>
+ </dependency>
 
  <!-- Uncomment following lines if using PostgreSQL
  <dependency>
-   <groupId>postgresql</groupId>
-   <artifactId>postgresql</artifactId>  
-   <version>8.3-603.jdbc4</version>
-   <scope>runtime</scope>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>8.3-603.jdbc4</version>
+ <scope>runtime</scope>
  </dependency>
  -->
 
diff --git a/src/main/java/org/activequant/examples/data/analysis/AnalysisKit1.java b/src/main/java/org/activequant/examples/data/analysis/AnalysisKit1.java
index f9f9a7d..d452c8a 100644
--- a/src/main/java/org/activequant/examples/data/analysis/AnalysisKit1.java
+++ b/src/main/java/org/activequant/examples/data/analysis/AnalysisKit1.java
@@ -32,6 +32,7 @@ import org.activequant.core.domainmodel.Symbol;
 import org.activequant.core.domainmodel.data.Candle;
 import org.activequant.core.domainmodel.data.CandleSeries;
 import org.activequant.core.types.Currency;
+import org.activequant.core.types.Exchange;
 import org.activequant.core.types.SecurityType;
 import org.activequant.core.types.TimeFrame;
 import org.activequant.core.types.TimeStamp;
@@ -140,13 +141,13 @@ public class AnalysisKit1 {
 
  // fetch the underlying dax future.
  final SeriesSpecification daxSpec = new SeriesSpecification(
- TimeFrame.TIMEFRAME_1_MINUTE,
+ TimeFrame.TIMEFRAME_1_DAY,
  new InstrumentSpecification(
- new Symbol("EUR"), // symbol
- "IDEALPRO",        // exchange
- "IB",              // vendor
- Currency.USD,             // currency
- SecurityType.CASH             // securityType
+ new Symbol("GOOG"), // symbol
+ "XNAS",             // exchange
+ "YAHOO",            // vendor
+ Currency.USD,       // currency
+ SecurityType.STOCK  // securityType
  )
  );
 
diff --git a/src/main/resources/examples/data/downloader/historydownloader/configuration.xml b/src/main/resources/examples/data/downloader/historydownloader/configuration.xml
index 195b63f..0db4138 100644
--- a/src/main/resources/examples/data/downloader/historydownloader/configuration.xml
+++ b/src/main/resources/examples/data/downloader/historydownloader/configuration.xml
@@ -4,9 +4,9 @@
 
  <!-- import -->
  <import resource="classpath:core/converters.xml"/>
- <import resource="classpath:data/opentick/configuration.xml"/>
- <import resource="classpath:examples/data/downloader/historydownloader/instruments-opentick.xml"/>
-
+ <import resource="classpath:examples/data/downloader/historydownloader/yahoo/configuration.xml"/>
+ <import resource="classpath:examples/data/downloader/historydownloader/instruments-yahoo.xml"/>
+
  <!-- dao configuration -->
 
  <!-- database: property file -->
@@ -28,4 +28,4 @@
  </property>
  <property name="candleSeriesSpecifications" ref="seriesSpecs" />
  </bean>
-</beans>
\ No newline at end of file
+</beans>
diff --git a/src/main/resources/examples/data/downloader/historydownloader/instruments-yahoo.xml b/src/main/resources/examples/data/downloader/historydownloader/instruments-yahoo.xml
new file mode 100644
index 0000000..2459ba3
--- /dev/null
+++ b/src/main/resources/examples/data/downloader/historydownloader/instruments-yahoo.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
+<beans>
+
+ <bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
+    <property name="customEditors">
+        <map>
+            <entry key="org.activequant.core.types.TimeStamp">
+                <bean class="org.activequant.util.spring.TimeStampPropertyEditor">
+                    <property name="format" value="yyyyMMdd"/>
+ </bean>
+            </entry>
+        </map>
+    </property>
+ </bean>
+
+ <!-- this file contains contract specifications. -->
+ <bean id="seriesSpecs" class="java.util.ArrayList">
+ <constructor-arg>
+ <list>
+ <ref bean="series1" />
+ </list>
+ </constructor-arg>
+ </bean>
+
+ <bean id="series1" class="org.activequant.core.domainmodel.SeriesSpecification">
+ <constructor-arg value="1d" />
+ <constructor-arg ref="contract1" />
+ <property name="startTimeStamp" value="20070101"/>
+ <!--
+ <property name="endTimeStamp" value="20090701"/>
+ -->
+ </bean>
+
+
+ <bean id="contract1" class="org.activequant.core.domainmodel.InstrumentSpecification">
+ <constructor-arg value="GOOG" />
+ <constructor-arg value="XNAS" />
+ <constructor-arg value="YAHOO" />
+ <constructor-arg value="USD" />
+ <constructor-arg value="STOCK" />
+ </bean>
+
+</beans>
\ No newline at end of file
diff --git a/src/main/resources/examples/data/downloader/historydownloader/yahoo/configuration.xml b/src/main/resources/examples/data/downloader/historydownloader/yahoo/configuration.xml
new file mode 100644
index 0000000..8facc26
--- /dev/null
+++ b/src/main/resources/examples/data/downloader/historydownloader/yahoo/configuration.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
+<beans>
+    <bean id="candleSeriesSource" class="org.activequant.data.retrieval.series.YahooCandleSeriesSource"/>
+</beans>
\ No newline at end of file

_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi