brighter-trading/static/general.js

104 lines
2.5 KiB
JavaScript

//
//class Backtesting {
// constructor() {
// this.height = height;
// }
//}
//
//class Trade {
// constructor() {
// this.height = height;
// }
//}
//
//class Controls {
// constructor() {
// this.height = height;
// }
//}
//
//class Strategies {
// constructor() {
// this.height = height;
// }
//}
//
//class Signals {
// constructor() {
// this.height = height;
// }
//}
//
//class Exchange_Info {
// constructor() {
// this.height = height;
// }
//}
//
//class Alerts {
// constructor() {
// this.height = height;
// }
//}
//
//class Header {
// constructor() {
// this.height = height;
// }
//}
//
//class Statistics {
// constructor() {
// this.height = height;
// }
//}
//
//class Indicator_Output {
// constructor() {
// this.height = height;
// }
//}
class User_Interface{
/* This contains the entire User interface.*/
constructor() {
/* Create the objects that contain all the
data and scripts required for each section of
the User interface. */
/* Data object is responsible for fetching and maintaining
up-to-date configurable and variable data for the UI */
this.data = new Data();
/* Charts object is responsible for maintaining the
data visualisation area in the UI. */
let chart_init_data = {
chart1_id : this.data.chart1_id,
chart2_id : this.data.chart2_id,
chart3_id : this.data.chart3_id,
trading_pair : this.data.trading_pair,
price_history : this.data.price_history
}
this.charts = new Charts(chart_init_data);
/* The Indicators object is responsible for maintaining and
interacting with the indicator section. As well as
updating the display on the charts.*/
let ind_init_data = {
indicators: this.data.indicators,
indicator_data: this.data.indicator_data
}
/* Pass the initialization for the indicators and a reference to
the charts object so the indicators can update it directly.*/
this.indicators = new Indicators(this.charts, ind_init_data);
this.communicate = new Communication(
this.data.interval,
this.data.candle_update,
this.data.candle_close,
this.indicators.update);
}
}
UI = new User_Interface();