コード例 #1
0
ファイル: financesymbols.py プロジェクト: shym98/MovieSearch
# Add sell signal symbols to the main chart, using purple (0x9900cc) downward pointing arrows as
# symbols
sellLayer = mainChart.addScatterLayer(None, sellSignal, "Sell",
                                      ArrowShape(180, 1, 0.4, 0.4), 11,
                                      0x9900cc)
# Shift the symbol higher by 20 pixels
sellLayer.getDataSet(0).setSymbolOffset(0, -20)

# Add a 5 period simple moving average to the main chart, using brown color
c.addSimpleMovingAvg(5, 0x663300)

# Add a 20 period simple moving average to the main chart, using purple color
c.addSimpleMovingAvg(20, 0x9900ff)

# Add candlestick symbols to the main chart, using green/red for up/down days
c.addCandleStick(0x66ff66, 0xff6666)

# Add a volume indicator chart (75 pixels high) after the main chart, using green/red/grey for
# up/down/flat days
c.addVolIndicator(75, 0x99ff99, 0xff9999, 0x808080)

# Append a 14-days RSI indicator chart (75 pixels high) after the main chart. The main RSI line is
# purple (800080). Set threshold region to +/- 20 (that is, RSI = 50 +/- 25). The upper/lower
# threshold regions will be filled with red (ff0000)/blue (0000ff).
c.addRSI(75, 14, 0x800080, 20, 0xff0000, 0x0000ff)

# Output the chart
print("Content-type: image/png\n")
binaryPrint(c.makeChart2(PNG))