# Add the main chart with 240 pixels in height c.addMainChart(240) # 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 HLOC symbols to the main chart, using green/red for up/down days c.addHLOC(0x008000, 0xcc0000) # Add 20 days bollinger band to the main chart, using light blue (9999ff) as the border and # semi-transparent blue (c06666ff) as the fill color c.addBollingerBand(20, 2, 0x9999ff, 0xc06666ff) # Add a 75 pixels volume bars sub-chart to the bottom of the main chart, using green/red/grey for # up/down/flat days c.addVolBars(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) # Append a 12-days momentum indicator chart (75 pixels high) using blue (0000ff) color. c.addMomentum(75, 12, 0x0000ff) # Output the chart c.makeChart("finance.png")
# 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 HLOC symbols to the main chart, using green/red for up/down days c.addHLOC(0x008000, 0xcc0000) # Add 20 days bollinger band to the main chart, using light blue (9999ff) as the # border and semi-transparent blue (c06666ff) as the fill color c.addBollingerBand(20, 2, 0x9999ff, 0xc06666ff) # Add a 75 pixels volume bars sub-chart to the bottom of the main chart, using # green/red/grey for up/down/flat days c.addVolBars(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) # Append a 12-days momentum indicator chart (75 pixels high) using blue (0000ff) # color. c.addMomentum(75, 12, 0x0000ff) # Output the chart c.makeChart("finance.png")
c.addSimpleMovingAvg(5, '0x663300') # Add a 20 period simple moving average to the main chart, using purple color c.addSimpleMovingAvg(20, '0x9900ff') # Add HLOC symbols to the main chart, using green/red for up/down days c.addHLOC('0x008000', '0xcc0000') # Add 20 days bollinger band to the main chart, using light blue (9999ff) as the # border and semi-transparent blue (c06666ff) as the fill color c.addBollingerBand(20, 2, '0x9999ff', '0xc06666ff') # Add a 75 pixels volume bars sub-chart to the bottom of the main chart, using # green/red/grey for up/down/flat days c.addVolBars(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') # Append a 12-days momentum indicator chart (75 pixels high) using blue (0000ff) # color. c.addMomentum(75, 12, '0x0000ff') # Output the chart print("Content-type: image/png\n") binaryPrint(c.makeChart2(PNG))