1. Clone, configure, and run a ReferenceDataStarter to Bitfinex to update the security and security_family tables in MySQL
2. Find the security ID for BTCUSD in the security table and update the EMAService.java code as below:
private final long accountId = 202; // Bitfinex adapter ID from account table in MySQL
private final long securityId = 1628; // The value from step 2
private final BigDecimal orderQuantity = new BigDecimal("1");
private final int emaPeriodShort = 10;
private final int emaPeriodLong = 20;
private final String defaultFeedType = "BFX";
3. To paper trade this strategy, where live market data will be used to generate signals but orders executed within the exchange simulator, you can use the below VM arguments in the EmbeddedStrategy-ema run configuration:
-Dsimulation=false
-DstrategyName=EMA
-Dmisc.embedded=true
-Dstatement.adapterTickGap=true
-Dstatement.persistMarketData=true
-Dstatement.aggregateBars=true
-DhistoricalData.barSize=SEC_10
-Dspring.profiles.active=simulation,live,pooledDataSource,bFXMarketData,embeddedBroker,html5,influxDB
-Dbfx.apiKey=YOUR_API_KEY
-Dbfx.apiSecret=YOUR_API_SECRET
-Dmisc.portfolioBaseCurrency=USD
-Dmisc.portfolioDigits=2
4. To back-test this strategy using 10 second bars for highlighted date range (in red below)
a. First run the historical data starter to pull the data from CoinAPI
b. Use the below VM arguments in the SimulationStarter-simulation-ema and run
-Dsimulation=true
-DstrategyName=EMA
-DdataSource.barSize=SEC_30
-DdataSource.feedCSV=false
-DdataSource.feedDB=true
-DdataSource.dataSetType=BAR
-DdataSource.loadSampleData=true
-DdataSource.feedMinDate=2019-02-01
-DdataSource.feedMaxDate=2019-03-01
-Dmisc.portfolioBaseCurrency=USD
-Dmisc.portfolioDigits=2
-Dspring.profiles.active=simulation,embeddedDataSource,singleDataSource,influxDB
Comments
0 comments
Please sign in to leave a comment.