brighter-trading/static/data.js

23 lines
911 B
JavaScript

class Data {
constructor() {
// Set the id's of the HTML elements that contain each section of the user interface.
this.chart1_id = 'chart';
this.chart2_id = 'chart2';
this.chart3_id = 'chart3';
// Get and set into memory configuration and historical data from the server.
this.trading_pair = bt_data.trading_pair;
this.interval = bt_data.interval;
this.price_history = fetch('http://localhost:5000/history').then((r) => r.json()).then( (data) => { return data; } );
this.indicators = bt_data.indicators;
// Request initialization data for the indicators.
this.indicator_data = fetch('http://localhost:5000/indicator_init').then((r) => r.json()).then( (data) => { return data; } );
}
candle_update(){
console.log('candle update');
}
candle_close(){
console.log('candle close');
}
}