Back to project page SpunkyCharts.
The source code is released under:
GNU General Public License
If you think the Android project SpunkyCharts listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.jogden.spunkycharts.misc; /* w ww .ja v a 2 s. c om*/ public class OHLC { public float open, high, low, close; public OHLC(float open, float high, float low, float close){ this.open = open; this.high = high; this.low = low; this.close = close; } public OHLC(OHLC ohlc) /* copy constructor */ { this.open = ohlc.open; this.high = ohlc.high; this.low = ohlc.low; this.close = ohlc.close; } public OHLC(float close) { this.high = this.low = this.open = this.close = close; } public String toString() { return "O-" + String.valueOf(open) + " H-" + String.valueOf(high) + " L-" + String.valueOf(low) + " C-" + String.valueOf(close); } public float pivot(){ return (open+high+low+close)/4f; } public float mid(){ return (high+low)/2f; } }