Skip to content

Commit

Permalink
add configurable paper trader to backtester
Browse files Browse the repository at this point in the history
  • Loading branch information
askmike committed Mar 17, 2017
1 parent da6e1df commit 746a80f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 25 deletions.
2 changes: 0 additions & 2 deletions config/plugins/profitSimulator.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
enabled = true

fee = 0.25
slippage = 0.05

Expand Down
17 changes: 0 additions & 17 deletions web/routes/baseConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,6 @@ config.tradingAdvisor = {
}
}

// do you want Gekko to calculate the profit of its own advice?
config.profitSimulator = {
enabled: true,
// report the profit in the currency or the asset?
reportInCurrency: true,
// start balance, on what the current balance is compared with
simulationBalance: {
// these are in the unit types configured in the watcher.
asset: 1,
currency: 100,
},
// how much fee in % does each trade cost?
fee: 0.25,
// how much slippage/spread should Gekko assume per trade?
slippage: 0.05
}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CONFIGURING ADAPTER
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
20 changes: 15 additions & 5 deletions web/vue/src/components/backtester/backtestConfigBuilder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,30 @@
dataset-picker.contain.my2(v-on:dataset='updateDataset')
.hr
strat-picker.contain.my2(v-on:stratConfig='updateStrat')
.hr
paper-trader(v-on:settings='updatePaperTrader')
.hr
</template>

<script>
import datasetPicker from '../global/configbuilder/datasetpicker.vue'
import stratPicker from '../global/configbuilder/stratpicker.vue'
import paperTrader from '../global/configbuilder/papertrader.vue'
import _ from 'lodash'
export default {
data: () => {
return {
dataset: {},
strat: {},
paperTrader: {}
}
},
components: {
stratPicker,
datasetPicker
datasetPicker,
paperTrader
},
computed: {
market: function() {
Expand All @@ -46,9 +52,8 @@ export default {
let config = {};
Object.assign(
config,
{
watch: this.market
},
{ watch: this.market },
{ profitSimulator: this.paperTrader },
this.strat,
{
backtest: {
Expand Down Expand Up @@ -100,7 +105,12 @@ export default {
updateStrat: function(sc) {
this.strat = sc;
this.$emit('config', this.config);
}
},
updatePaperTrader: function(pt) {
this.paperTrader = pt;
this.paperTrader.enabled = true;
this.$emit('config', this.config);
},
}
}
</script>
Expand Down
1 change: 0 additions & 1 deletion web/vue/src/components/backtester/backtester.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
.hr.contain
config-builder(v-on:config='check')
div(v-if='backtestable')
.hr.contain
.txt--center
a.w100--s.my1.btn--blue(href='#', v-if='backtestState !== "fetching"', v-on:click.prevent='run') Backtest
div(v-if='backtestState === "fetching"').scan-btn
Expand Down
1 change: 1 addition & 0 deletions web/vue/src/components/gekko/gekkoConfigBuilder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export default {
},
updatePaperTrader: function(pt) {
this.paperTrader = pt;
this.paperTrader.enabled = true;
this.emitConfig();
},
Expand Down

0 comments on commit 746a80f

Please sign in to comment.