Adding execution parameters

This commit is contained in:
Matias committed 2019-03-22 11:00:12 +01:00
1 parent 3bc2031d90
commit 53cd6d609e
9 files changed
+97 -34

No files matched your search

+4 -2
View File
@@ -13,6 +13,8 @@ const availableMonths = [
'December'
]
const availableTimePeriods = ["24-hs", "12-hs", "08-hs", "06-hs", "04-hs", "03-hs", "02-hs", "01-hs", "45-min", "40-min", "30-min", "20-min", "15-min", "10-min", "05-min", "04-min", "03-min", "02-min", "01-min"]
const tradingStartModes = {
live: 'Live',
backtest: 'Backtest'
@@ -35,7 +37,7 @@ const processNames = {
Market: 'Multi-Period-Market',
Min: "One-Min-Daily-Candles-Volumes",
Live: "Poloniex-Live-Trades",
HoleFixing:"Poloniex-Hole-Fixing"
HoleFixing: "Poloniex-Hole-Fixing"
}
const exchanges = [
@@ -45,4 +47,4 @@ const exchanges = [
}
]
export { tradingStartModes, tradingStartModesList, exchanges, indicatorStartModes, availableMonths, processNames }
export { tradingStartModes, tradingStartModesList, exchanges, indicatorStartModes, availableMonths, processNames, availableTimePeriods }
+26 -14
View File
@@ -6,7 +6,7 @@ import TopBar from '../../BannerTopBar'
import { withStyles } from '@material-ui/core/styles'
import classNames from 'classnames'
import styles from './styles'
import { tradingStartModes, indicatorStartModes, availableMonths, processNames } from '../../../GraphQL/models'
import { tradingStartModes, indicatorStartModes, availableMonths, processNames, availableTimePeriods } from '../../../GraphQL/models'
import { isDefined, getIndicatorYears } from '../../../utils'
import {
MenuItem, Button, TextField, FormControl, InputLabel, Input, Typography,
@@ -43,6 +43,9 @@ class AddClone extends Component {
month: 1,
processName: '',
//TraderBot
timePeriod: '01-hs',
//Error handlers
nameError: false,
teamError: false,
@@ -215,19 +218,6 @@ class AddClone extends Component {
className={classNames(classes.form, classes.textField)}
fullWidth
/>
<Typography className={classes.typography} variant='subtitle1' align='justify'>
The Wait Time represent the number of miliseconds the bot will wait between executions.
</Typography>
<TextField
id="waitTime"
label="Wait Time"
className={classNames(classes.form, classes.textField)}
value={this.state.waitTime}
onChange={(e)=>this.setState({waitTime:e.target.value})}
fullWidth
/>
</React.Fragment>
}
@@ -290,6 +280,27 @@ class AddClone extends Component {
</React.Fragment>
}
<Typography className={classes.typography} variant='subtitle1' align='justify'>
The Time Period in which the bot will operate.
</Typography>
<TextField
select
label="Time Period"
className={classNames(classes.margin, classes.textField, classes.form)}
value={this.state.timePeriod}
onChange={(e)=> this.setState({timePeriod:e.target.value})}
fullWidth
>
{availableTimePeriods.map((option, index) => (
<MenuItem key={index} value={option}>
{option}
</MenuItem>
))}
</TextField>
{ false &&
<React.Fragment>
<Typography className={classes.typography} variant='subtitle1' align='justify'>
@@ -514,6 +525,7 @@ class AddClone extends Component {
if(this.state.selectedBot.kind === "TRADER"){
variables.clone.runAsTeam = this.state.runAsTeam
variables.clone.processName = 'Trading-Process'
variables.clone.timePeriod = this.state.timePeriod
if(this.state.mode === "backtest"){
variables.clone.beginDatetime = this.state.beginDatetime.valueOf() / 1000|0
variables.clone.endDatetime = this.state.endDatetime.valueOf() / 1000|0