(function(){

	JenScript.VolumeBarGeometry = function(config) {
		this.__init(config);
	};
	JenScript.Model.inheritPrototype(JenScript.VolumeBarGeometry, JenScript.StockItemGeometry);

	JenScript.Model.addMethods(JenScript.VolumeBarGeometry, {
		__init : function(config){
			config = config || {};
			this.lowHighColor = 'darkgray';
			this.deviceVolumeGap;
		},
		
		solveItemGeometry : function(){
			var deviceFixingStart = this.deviceFixingStart;
			var deviceFixingDuration = this.deviceFixingDuration;
			var deviceVolume = this.deviceVolume;
			var deviceVolumeBase = this.deviceVolumeBase;
			
			this.deviceVolumeGap = new JenScript.SVGRect().origin(deviceFixingStart, deviceVolume.y).size(deviceFixingDuration, Math.abs(deviceVolume.y - deviceVolumeBase.y));
		},
	});
	
	JenScript.VolumeBarLayer = function(config) {
		this._init(config);
	};
	JenScript.Model.inheritPrototype(JenScript.VolumeBarLayer, JenScript.StockLayer);
	JenScript.Model.addMethods(JenScript.VolumeBarLayer, {
		_init : function(config){
			config = config || {};
			this.volumeColor = (config.volumeColor !== undefined)?config.volumeColor:'cyan';
			JenScript.StockLayer.call(this,{ name : "VolumeBarLayer"});
		},
		
		solveLayer : function() {
			this.geometries = [];
			for (var i = 0; i < this.plugin.getBoundedStocks().length; i++) {
				var stock = this.plugin.getBoundedStocks()[i];
				var geom = new JenScript.VolumeBarGeometry();
				geom.setLayer(this);
				geom.setStock(stock);
				geom.solveGeometry();
				this.addGeometry(geom);
			}
		},

		paintLayer : function(g2d,part) {
			if (part === 'Device') {
				var svgLayer = new JenScript.SVGGroup().Id(this.Id);
				for (var i = 0; i < this.getGeometries().length; i++) {
					var geom = this.getGeometries()[i];
					svgLayer.child(geom.deviceVolumeGap.fill(this.volumeColor).strokeNone().toSVG());
				}
				g2d.deleteGraphicsElement(this.Id);
				g2d.insertSVG(svgLayer.toSVG());
			}
		},
	});
})();
@@ -1125,16 +1125,104 @@
 'cyan';%0A
+%09%09%09this.bearishColor = config.bearishColor;%0A%09%09%09this.bullishColor = config.bullishColor;%0A
 %09%09%09JenSc
@@ -1841,24 +1841,289 @@
 tries()%5Bi%5D;%0A
+%09%09%09%09%09var bearc = (this.bearishColor !== undefined)?this.bearishColor:this.plugin.getBearishColor();%0A%09%09%09%09%09var bullc = (this.bullishColor !== undefined)?this.bullishColor:this.plugin.getBullishColor();%0A%09%09%09%09%09var fillColor = (geom.getStock().isBearish())? bearc:bullc;%0A
 %09%09%09%09%09svgLaye
@@ -2156,27 +2156,20 @@
 ap.fill(
-this.volume
+fill
 Color).s

add stock volume inner colors