Merge pull request #52 from AAVikings/master
Adding Begin Date to indicators
This commit is contained in:
3 files changed
+69
-26
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@superalgos/operations-client",
|
||||
"version": "0.0.23",
|
||||
"version": "0.0.24",
|
||||
"description": "Superalgos Operations client-side web app",
|
||||
"main": "src/index.js",
|
||||
"dependencies": {
|
||||
|
||||
@@ -25,7 +25,7 @@ class AddClone extends Component {
|
||||
user: JSON.parse(user),
|
||||
selectedBot: {'id':''},
|
||||
mode: '',
|
||||
resumeExecution: false,
|
||||
resumeExecution: true,
|
||||
beginDatetime: DateTime.local().minus({ days: 8 }).startOf('day'),
|
||||
endDatetime: DateTime.local(),
|
||||
waitTime: 1,
|
||||
@@ -436,6 +436,44 @@ class AddClone extends Component {
|
||||
</TextField>
|
||||
</React.Fragment>
|
||||
}
|
||||
|
||||
{ this.state.mode === "noTime" &&
|
||||
<React.Fragment>
|
||||
<Typography className={classes.typography} variant='subtitle1' align='justify'>
|
||||
The Resume Execution option let's you pick up the context of
|
||||
the last execution and continue from there.
|
||||
</Typography>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={this.state.resumeExecution}
|
||||
onChange={(e)=>this.setState({resumeExecution:e.target.checked })}
|
||||
value="resumeExecution"
|
||||
color="primary"
|
||||
/>
|
||||
}
|
||||
label="Resume Execution"
|
||||
className={classNames(classes.form, classes.textField)}
|
||||
/>
|
||||
{ !this.state.resumeExecution &&
|
||||
<DateTimePicker
|
||||
autoOk
|
||||
disableFuture
|
||||
format="DD' at 'HH:mm"
|
||||
ampm={false}
|
||||
showTabs={false}
|
||||
leftArrowIcon={<ChevronLeft />}
|
||||
rightArrowIcon={<ChevronRight />}
|
||||
value={this.state.beginDatetime}
|
||||
label='Start Date'
|
||||
onChange={newVal => this.setState({ beginDatetime: newVal })}
|
||||
className={classNames(classes.form, classes.textField)}
|
||||
fullWidth
|
||||
/>
|
||||
}
|
||||
|
||||
</React.Fragment>
|
||||
}
|
||||
</React.Fragment>
|
||||
}
|
||||
|
||||
@@ -539,6 +577,7 @@ class AddClone extends Component {
|
||||
variables.clone.endYear = this.state.endYear
|
||||
variables.clone.month = this.state.month
|
||||
variables.clone.runAsTeam = true
|
||||
variables.clone.beginDatetime = this.state.beginDatetime.valueOf() / 1000|0
|
||||
}
|
||||
|
||||
return this.props.addCloneMutation({
|
||||
@@ -568,7 +607,7 @@ class AddClone extends Component {
|
||||
this.setState({
|
||||
selectedBot: {'id':''},
|
||||
mode: '',
|
||||
resumeExecution: false,
|
||||
resumeExecution: true,
|
||||
beginDatetime: DateTime.local().minus({ days: 8 }).startOf('day'),
|
||||
endDatetime: DateTime.local(),
|
||||
waitTime: 1,
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Trading, Indicator, Sensor } from '../enums/BotTypes'
|
||||
const createClone = async (clone) => {
|
||||
try {
|
||||
logger.debug('createClone %s', clone.id)
|
||||
const client = new Client({config: config.fromKubeconfig(), version: '1.9'})
|
||||
const client = new Client({ config: config.fromKubeconfig(), version: '1.9' })
|
||||
deploymentManifest.metadata.name = clone.id
|
||||
|
||||
logger.debug('createClone Environment and Auth Configuration.')
|
||||
@@ -131,7 +131,12 @@ const createClone = async (clone) => {
|
||||
})
|
||||
}
|
||||
} else if (clone.botType === Indicator || clone.botType === Sensor) {
|
||||
if (clone.mode !== NO_TIME) {
|
||||
if (clone.mode === NO_TIME) {
|
||||
env.push({
|
||||
'name': 'BEGIN_DATE_TIME',
|
||||
'value': isDefined(clone.startYear) ? clone.startYear.toString() : ''
|
||||
})
|
||||
} else {
|
||||
env.push({
|
||||
'name': 'MIN_YEAR',
|
||||
'value': isDefined(clone.startYear) ? clone.startYear.toString() : ''
|
||||
@@ -152,7 +157,6 @@ const createClone = async (clone) => {
|
||||
}
|
||||
|
||||
deploymentManifest.spec.template.spec.containers[0].env = env
|
||||
logger.debug('createClone env: %s', JSON.stringify(env))
|
||||
|
||||
await client.apis.batch.v1.namespaces('default').jobs.post(
|
||||
{ body: deploymentManifest })
|
||||
@@ -163,27 +167,27 @@ const createClone = async (clone) => {
|
||||
}
|
||||
}
|
||||
|
||||
function datasetNames(){
|
||||
function datasetNames() {
|
||||
let dataSetMap = new Map()
|
||||
dataSetMap.set("24-hs","Multi-Period-Market")
|
||||
dataSetMap.set("12-hs","Multi-Period-Market")
|
||||
dataSetMap.set("08-hs","Multi-Period-Market")
|
||||
dataSetMap.set("06-hs","Multi-Period-Market")
|
||||
dataSetMap.set("04-hs","Multi-Period-Market")
|
||||
dataSetMap.set("03-hs","Multi-Period-Market")
|
||||
dataSetMap.set("02-hs","Multi-Period-Market")
|
||||
dataSetMap.set("01-hs","Multi-Period-Market")
|
||||
dataSetMap.set("45-min","Multi-Period-Daily")
|
||||
dataSetMap.set("40-min","Multi-Period-Daily")
|
||||
dataSetMap.set("30-min","Multi-Period-Daily")
|
||||
dataSetMap.set("20-min","Multi-Period-Daily")
|
||||
dataSetMap.set("15-min","Multi-Period-Daily")
|
||||
dataSetMap.set("10-min","Multi-Period-Daily")
|
||||
dataSetMap.set("05-min","Multi-Period-Daily")
|
||||
dataSetMap.set("04-min","Multi-Period-Daily")
|
||||
dataSetMap.set("03-min","Multi-Period-Daily")
|
||||
dataSetMap.set("02-min","Multi-Period-Daily")
|
||||
dataSetMap.set("01-min","Multi-Period-Daily")
|
||||
dataSetMap.set("24-hs", "Multi-Period-Market")
|
||||
dataSetMap.set("12-hs", "Multi-Period-Market")
|
||||
dataSetMap.set("08-hs", "Multi-Period-Market")
|
||||
dataSetMap.set("06-hs", "Multi-Period-Market")
|
||||
dataSetMap.set("04-hs", "Multi-Period-Market")
|
||||
dataSetMap.set("03-hs", "Multi-Period-Market")
|
||||
dataSetMap.set("02-hs", "Multi-Period-Market")
|
||||
dataSetMap.set("01-hs", "Multi-Period-Market")
|
||||
dataSetMap.set("45-min", "Multi-Period-Daily")
|
||||
dataSetMap.set("40-min", "Multi-Period-Daily")
|
||||
dataSetMap.set("30-min", "Multi-Period-Daily")
|
||||
dataSetMap.set("20-min", "Multi-Period-Daily")
|
||||
dataSetMap.set("15-min", "Multi-Period-Daily")
|
||||
dataSetMap.set("10-min", "Multi-Period-Daily")
|
||||
dataSetMap.set("05-min", "Multi-Period-Daily")
|
||||
dataSetMap.set("04-min", "Multi-Period-Daily")
|
||||
dataSetMap.set("03-min", "Multi-Period-Daily")
|
||||
dataSetMap.set("02-min", "Multi-Period-Daily")
|
||||
dataSetMap.set("01-min", "Multi-Period-Daily")
|
||||
return dataSetMap
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user