diff --git a/client/package-lock.json b/client/package-lock.json index a73a5e1d5..b3bdfc11c 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -1,6 +1,6 @@ { "name": "@superalgos/operations-client", - "version": "0.0.38", + "version": "0.0.41", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/client/src/GraphQL/models.js b/client/src/GraphQL/models.js index ce2da851d..a45c7db0a 100644 --- a/client/src/GraphQL/models.js +++ b/client/src/GraphQL/models.js @@ -1,18 +1,3 @@ -const availableMonths = [ - 'January', - 'February', - 'March', - 'April', - 'May', - 'June', - 'July', - 'August', - 'September', - 'October', - 'November', - '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 = { @@ -42,9 +27,6 @@ const indicatorProcessNames = { Market: 'Multi-Period-Market' } -const tradingProcessNames = { - TradingProcess: "Trading-Process" -} const botTypes = { Trading: "Trading", @@ -57,7 +39,15 @@ const exchanges = { Poloniex: "Poloniex" } +const markets = { + USDT_BTC: "USDT_BTC" +} + +const baseAssets = { + assetA: "USDT", + assetB: "BTC" +} + export { - tradingStartModes, tradingStartModesList, exchanges, indicatorStartModes, availableMonths, - availableTimePeriods, sensorProcessNames, indicatorProcessNames, tradingProcessNames, botTypes + tradingStartModes, tradingStartModesList, exchanges, indicatorStartModes, availableTimePeriods, sensorProcessNames, indicatorProcessNames, botTypes, markets, baseAssets } diff --git a/client/src/utils/index.js b/client/src/utils/index.js index a12aa4fa9..72c6b92e5 100644 --- a/client/src/utils/index.js +++ b/client/src/utils/index.js @@ -73,11 +73,3 @@ export function slugify (string) { .replace(/-+$/, '') // Trim - from end of text } -export function getIndicatorYears () { - const localDate = new Date() - let availableYears = [] - for (var i = 2015; i <= localDate.getUTCFullYear(); i++) { - availableYears[i - 2015] = i - } - return availableYears -} diff --git a/client/src/views/Clone/Add/index.js b/client/src/views/Clone/Add/index.js index d8c8ca2cf..8ab5803de 100644 --- a/client/src/views/Clone/Add/index.js +++ b/client/src/views/Clone/Add/index.js @@ -6,10 +6,10 @@ import TopBar from '../../BannerTopBar' import { withStyles } from '@material-ui/core/styles' import classNames from 'classnames' import styles from './styles' -import { isDefined, getIndicatorYears } from '../../../utils' +import { isDefined } from '../../../utils' import { - tradingStartModes, indicatorStartModes, availableMonths, availableTimePeriods, - sensorProcessNames, indicatorProcessNames, tradingProcessNames, botTypes, exchanges + tradingStartModes, availableTimePeriods, + sensorProcessNames, indicatorProcessNames, botTypes, exchanges, markets, baseAssets } from '../../../GraphQL/models' import { @@ -28,10 +28,10 @@ class AddClone extends Component { this.state = { user: JSON.parse(user), selectedBot: { 'id': '' }, - mode: "noTime", + mode: tradingStartModes.backtest, resumeExecution: false, - beginDatetime: DateTime.local().minus({ days: 8 }).startOf('day'), - endDatetime: DateTime.local(), + beginDatetime: DateTime.utc().minus({ days: 8 }).startOf('day'), + endDatetime: DateTime.utc(), waitTime: 1, state: '', stateDatetime: 0, @@ -43,7 +43,9 @@ class AddClone extends Component { processName: indicatorProcessNames.Daily, accessCodeOption: false, accessCode: '', - balanceAssetB: 0.001, + baseAssetBalance: 0, + market: markets.USDT_BTC, + baseAsset: baseAssets.assetA, // Indicator Bot startYear: 2019, @@ -51,7 +53,7 @@ class AddClone extends Component { month: 1, //TradingBot - timePeriod: '01-hs', + timePeriod: '', //Error handlers botError: false, @@ -62,7 +64,7 @@ class AddClone extends Component { processNameError: false, keyIdError: false, accessCodeError: false, - balanceAssetBError: false + baseAssetBalanceError: false } } @@ -176,8 +178,51 @@ class AddClone extends Component { ))} + this.setState({ timePeriod: e.target.value })} + fullWidth + > + {availableTimePeriods.map((option, index) => ( + + {option} + + ))} + + {this.state.selectedBot.kind === botTypes.Trading && + + this.setState({ market: e.target.value })} + fullWidth + > + {Object.keys(markets).map((option, index) => ( + + {option} + + ))} + + + this.setState({ baseAsset: e.target.value })} + fullWidth + > + {Object.keys(baseAssets).map((option, index) => ( + + {baseAssets[option]} + + ))} + + Available Running Modes are Backtest and Live.