Skip to content

Commit

Permalink
Merge branch 'develop' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfariakof committed Feb 2, 2024
2 parents 3e70c28 + a6f2d83 commit aadf1b5
Showing 1 changed file with 37 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class MacdChartComponent {
public chartMacdOptions: ChartOptions | any;
public magazineLuizaHistoryPrices: IMagazineLuizaHistoryPrice[] = [];

constructor( public chartService:ChartService, public obsStartDate: PeriodStartDateObservable, public obsEndDate: PeriodEndDateObservable) { }
constructor(public chartService: ChartService, public obsStartDate: PeriodStartDateObservable, public obsEndDate: PeriodEndDateObservable) { }

async ngOnInit(): Promise<void> {
if (CustomValidators.IsValidPeriod(this.obsStartDate.startDate.toString(), this.obsEndDate.endDate.toString())) {
Expand All @@ -27,13 +27,13 @@ export class MacdChartComponent {
}
}

public initializeComponent = async ():Promise<void> =>{
public initializeComponent = async (): Promise<void> => {
this.magazineLuizaHistoryPrices = await this.chartService.get(this.obsStartDate.startDate, this.obsEndDate.endDate);
const macd = await this.chartService.getMACD(this.obsStartDate.startDate, this.obsEndDate.endDate);
const data = [
{ name: "Histograma", type: "bar", data: macd.histogram },
{ name: "MACD Line", type: "line", data: macd.macdLine },
{ name: "Signal", type: "line", data: macd.signal },
{ name: "MACD Line", type: "line", color: "#000", data: macd.macdLine },
{ name: "Signal", type: "line", color: "#FFA500", data: macd.signal },
];

const labelXAxis: any[] = [];
Expand All @@ -42,7 +42,7 @@ export class MacdChartComponent {
});
this.chartMacdOptions = {
chart: {
height: (document.body.clientHeight/2)-16,
height: (document.body.clientHeight / 2) - 16,
type: "line",
selection: {
enabled: true,
Expand All @@ -55,7 +55,8 @@ export class MacdChartComponent {
opacity: 0.4
},
stroke: {
width: [4, 2, 4]
width: [4, 2, 4],

}
}
},
Expand All @@ -65,27 +66,46 @@ export class MacdChartComponent {
},
plotOptions: {
bar: {
//distributed: true,
columnWidth: "80%",
borderRadius: 3,
colors: {
ranges: [
{
from: -1000,
from: -Number.MAX_VALUE,
to: 0,
color: "#F15B46"
color: '#FF0000',
},
{
from: 1,
to: 100,
color: "#FEB019"
}
]
}
}
from: 0,
to: Number.MAX_VALUE,
color: '#229A00',
},
],
},
},
},
stroke: {
width: [12, 2, 2],
curve: "straight"

curve: "straight",
colors: [
{
ranges: [
{
from: -Number.MAX_VALUE,
to: 0,
color: '#FF0000',
},
{
from: 0,
to: Number.MAX_VALUE,
color: '#229A00',
},
],
},
'#000',
'#FFA500'
],
},
grid: {
row: {
Expand Down

0 comments on commit aadf1b5

Please sign in to comment.