exp moving average, renaming moving average to simple moving average.
This commit is contained in:
parent
9ad15b3288
commit
8bd5cdfe17
5 changed files with 158 additions and 19 deletions
|
|
@ -60,7 +60,7 @@ func chartHandler(rc *web.RequestContext) web.ControllerResult {
|
|||
},
|
||||
}
|
||||
|
||||
s1ma := &chart.BollingerBandsSeries{
|
||||
s1bb := &chart.BollingerBandsSeries{
|
||||
Name: "BBS",
|
||||
Style: chart.Style{
|
||||
Show: true,
|
||||
|
|
@ -72,6 +72,24 @@ func chartHandler(rc *web.RequestContext) web.ControllerResult {
|
|||
InnerSeries: s1,
|
||||
}
|
||||
|
||||
s1sma := &chart.SimpleMovingAverageSeries{
|
||||
Style: chart.Style{
|
||||
Show: true,
|
||||
StrokeColor: drawing.ColorRed,
|
||||
StrokeDashArray: []float64{5.0, 5.0},
|
||||
},
|
||||
InnerSeries: s1,
|
||||
}
|
||||
|
||||
s1ema := &chart.ExponentialMovingAverageSeries{
|
||||
Style: chart.Style{
|
||||
Show: true,
|
||||
StrokeColor: drawing.ColorBlue,
|
||||
StrokeDashArray: []float64{5.0, 5.0},
|
||||
},
|
||||
InnerSeries: s1,
|
||||
}
|
||||
|
||||
c := chart.Chart{
|
||||
Title: "A Test Chart",
|
||||
TitleStyle: chart.Style{
|
||||
|
|
@ -102,9 +120,11 @@ func chartHandler(rc *web.RequestContext) web.ControllerResult {
|
|||
},
|
||||
},
|
||||
Series: []chart.Series{
|
||||
s1bb,
|
||||
s1,
|
||||
s1ma,
|
||||
s1lv,
|
||||
s1sma,
|
||||
s1ema,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue