Skip to content

Commit 8b87a89

Browse files
authored
Merge pull request #21 from Artimatic/feature/29-Backtesting-and-ml
Feature/29 backtesting and ml
2 parents 8f48bd2 + 2c989c8 commit 8b87a89

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

src/app/chart-dialog/chart-dialog.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ export class ChartDialogComponent implements OnInit {
2222
smaForm: FormGroup;
2323
algorithms: AlgorithmSelection[] = [
2424
{ value: 'mfi', viewValue: 'Money Flow Index' },
25+
{ value: 'mfiLow', viewValue: 'Money Flow Index Low' },
2526
{ value: 'sma', viewValue: 'Moving Average' },
2627
{ value: 'bollingerband', viewValue: 'Bollinger Band' },
2728
{ value: 'bollingerbandmfi', viewValue: 'Bollinger Band and MFI' },
2829
{ value: 'macrossover', viewValue: 'Moving Average Crossover' },
2930
{ value: 'daily-roc', viewValue: 'Rate of Change/MFI Divergence' },
3031
{ value: 'findresistance', viewValue: 'Moving Average Resistance' },
31-
{ value: 'all', viewValue: 'All Indicators' }
32+
{ value: 'all', viewValue: 'All Algorithms' }
3233
];
3334

3435
selectedAlgo = 'bollingerbandmfi';

src/app/product-view/product-view.component.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ <h3 class="first">Results</h3>
2222
</ng-template>
2323
<ng-template pTemplate="body" let-result>
2424
<tr>
25-
<td>{{result.algo}}</td>
26-
<td>{{result.invested | currency}}</td>
27-
<td>{{result.lastPrice | currency}}</td>
28-
<td>{{result.lastVolume | number}}</td>
29-
<td>{{result.recommendation}}</td>
30-
<td>{{result.totalTrades | number}}</td>
31-
<td>{{result.returns | percent}}</td>
25+
<td class="table-cell">{{result.algo}}</td>
26+
<td class="table-cell">{{result.invested | currency}}</td>
27+
<td class="table-cell">{{result.lastPrice | currency}}</td>
28+
<td class="table-cell">{{result.lastVolume | number}}</td>
29+
<td class="table-cell">{{result.recommendation}}</td>
30+
<td class="table-cell">{{result.totalTrades | number}}</td>
31+
<td class="table-cell">{{result.returns | percent}}</td>
3232
</tr>
3333
</ng-template>
3434
</p-table>

src/app/product-view/product-view.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class ProductViewComponent implements OnInit {
5454
break;
5555
}
5656
default: {
57-
this.loadChart(chart);
57+
this.loadDefaultChart(chart, chart.algorithm);
5858
break;
5959
}
6060
}
@@ -195,7 +195,7 @@ export class ProductViewComponent implements OnInit {
195195
let action = day.action;
196196
if (indicator) {
197197
const recommendation = day.recommendation[indicator].toUpperCase();
198-
switch(recommendation) {
198+
switch (recommendation) {
199199
case 'BEARISH': {
200200
action = 'STRONGSELL';
201201
break;
@@ -228,7 +228,7 @@ export class ProductViewComponent implements OnInit {
228228
this.algo.getBacktestEvaluation(data.symbol, pastDate, currentDate, data.algorithm)
229229
.map(result => {
230230
if (result.signals > defaultPeriod) {
231-
result.signals = result.signals.slice(result.signals.length - defaultPeriod, result.signals.length)
231+
result.signals = result.signals.slice(result.signals.length - defaultPeriod, result.signals.length);
232232
}
233233
this.initDefaultResults(data.symbol, result, result.signals, indicator);
234234
})

0 commit comments

Comments
 (0)