Skip to content

Commit

Permalink
More fine-grained modules to avoid dependency conflicts and allow sma…
Browse files Browse the repository at this point in the history
…ller artefacts.
  • Loading branch information
jbaron committed Aug 10, 2023
1 parent b259cdb commit e88a4b2
Show file tree
Hide file tree
Showing 37 changed files with 254 additions and 119 deletions.
7 changes: 5 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@
<module>roboquant</module>
<module>roboquant-ta</module>
<module>roboquant-jupyter</module>
<module>roboquant-extra</module>
<module>roboquant-crypto</module>
<module>roboquant-alphavantage</module>
<module>roboquant-alpaca</module>
<module>roboquant-polygon</module>
<module>roboquant-xchange</module>
<module>roboquant-binance</module>
<module>roboquant-perf</module>
<!-- module roboquant-ibkr is part of ibkr profile since it relies on a locally installed library -->
</modules>
Expand Down
66 changes: 66 additions & 0 deletions roboquant-alpaca/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2020-2023 Neural Layer
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>roboquant-parent</artifactId>
<groupId>org.roboquant</groupId>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>roboquant-alpaca</artifactId>
<packaging>jar</packaging>
<name>roboquant alpaca</name>
<description>Alpaca broker and market data for roboquant</description>

<build>
<plugins>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.roboquant</groupId>
<artifactId>roboquant</artifactId>
</dependency>
<dependency>
<groupId>net.jacobpeterson</groupId>
<artifactId>alpaca-java</artifactId>
<version>9.1.4</version>
</dependency>

<!-- Fix issues -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.15</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
12 changes: 1 addition & 11 deletions roboquant-extra/pom.xml → roboquant-alphavantage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>roboquant-extra</artifactId>
<artifactId>roboquant-alphavantage</artifactId>
<packaging>jar</packaging>
<name>roboquant extra</name>
<description>3rd party integration with brokers and market data providers for roboquant</description>
Expand All @@ -49,16 +49,6 @@
<artifactId>alphavantage-java</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>net.jacobpeterson</groupId>
<artifactId>alpaca-java</artifactId>
<version>9.1.4</version>
</dependency>
<dependency>
<groupId>com.github.polygon-io</groupId>
<artifactId>client-jvm</artifactId>
<version>4.2.1</version>
</dependency>

<!-- Fix issues -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import com.crazzyghost.alphavantage.AlphaVantage
import com.crazzyghost.alphavantage.Config
import com.crazzyghost.alphavantage.parameters.OutputSize
import com.crazzyghost.alphavantage.timeseries.response.TimeSeriesResponse
import org.roboquant.alpaca.AlpacaHistoricFeed
import org.roboquant.common.*
import org.roboquant.feeds.HistoricPriceFeed
import org.roboquant.feeds.PriceBar
Expand Down Expand Up @@ -64,7 +63,7 @@ class AlphaVantageHistoricFeed(
) : HistoricPriceFeed() {

private val subscriptions = mutableMapOf<String, Asset>()
private val logger = Logging.getLogger(AlpacaHistoricFeed::class)
private val logger = Logging.getLogger(AlphaVantageHistoricFeed::class)
private val config = AlphaVantageConfig()

init {
Expand Down
55 changes: 55 additions & 0 deletions roboquant-binance/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2020-2023 Neural Layer
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>roboquant-parent</artifactId>
<groupId>org.roboquant</groupId>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>roboquant-binance</artifactId>
<packaging>jar</packaging>
<name>roboquant binance</name>
<description>Binance support for roboquant algorithmic trading platform</description>

<build>
<plugins>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<artifactId>roboquant</artifactId>
<groupId>org.roboquant</groupId>
</dependency>
<dependency>
<groupId>org.roboquant</groupId>
<artifactId>binance-api-client</artifactId>
<version>1.0.5</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@

package org.roboquant.samples

import org.knowm.xchange.ExchangeFactory
import org.knowm.xchange.bitstamp.BitstampExchange

import org.roboquant.Roboquant
import org.roboquant.binance.BinanceHistoricFeed
import org.roboquant.binance.BinanceLiveFeed
Expand All @@ -38,7 +37,6 @@ import org.roboquant.metrics.AccountMetric
import org.roboquant.metrics.ScorecardMetric
import org.roboquant.policies.FlexPolicy
import org.roboquant.strategies.EMAStrategy
import org.roboquant.xchange.XChangePollingLiveFeed
import kotlin.test.assertEquals

fun recordBinanceFeed() {
Expand Down Expand Up @@ -136,28 +134,12 @@ fun binanceBackTest() {
}


fun xchangeFeed() {
val exchange = ExchangeFactory.INSTANCE.createExchange(BitstampExchange::class.java)
val feed = XChangePollingLiveFeed(exchange)
println(feed.availableAssets.summary())

feed.subscribeTrade("BTC_USD", pollingDelayMillis = 30_000)
println("Subscribed")
assertEquals("BTC_USD", feed.assets.first().symbol)

/// Run it for 2 minutes
val timeframe = Timeframe.next(2.minutes)
val result = feed.filter<PriceAction>(timeframe = timeframe)
feed.close()
assertEquals(AssetType.CRYPTO, result.first().second.asset.type)
}

suspend fun main() {

when ("WEB") {
"RECORD" -> recordBinanceFeed()
"USE" -> useBinanceFeed()
"XCHANGE" -> xchangeFeed()
"LIVE" -> binanceLiveFeed()
"HISTORIC" -> binanceBackTest()
"FORWARD" -> binanceForwardTest()
Expand Down
67 changes: 0 additions & 67 deletions roboquant-extra/src/test/kotlin/org/roboquant/samples/main.kt

This file was deleted.

54 changes: 54 additions & 0 deletions roboquant-polygon/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2020-2023 Neural Layer
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>roboquant-parent</artifactId>
<groupId>org.roboquant</groupId>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>roboquant-polygon</artifactId>
<packaging>jar</packaging>
<name>roboquant polygon</name>
<description>Polygon data provider for roboquant</description>

<build>
<plugins>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.roboquant</groupId>
<artifactId>roboquant</artifactId>
</dependency>
<dependency>
<groupId>com.github.polygon-io</groupId>
<artifactId>client-jvm</artifactId>
<version>4.2.1</version>
</dependency>
</dependencies>

</project>
Loading

0 comments on commit e88a4b2

Please sign in to comment.