|
@@ -273,8 +273,7 @@ public class KChartFragment extends Fragment {
|
|
|
// 这里比较关键,某些事件OTCChartActivity.java需要监控到
|
|
// 这里比较关键,某些事件OTCChartActivity.java需要监控到
|
|
|
mtp_chart_target.addNotify(mtp_chart_k);
|
|
mtp_chart_target.addNotify(mtp_chart_k);
|
|
|
|
|
|
|
|
- String[] tem = null;
|
|
|
|
|
- if(getActivity() instanceof OTCChartActivity){
|
|
|
|
|
|
|
+// if(getActivity() instanceof OTCChartActivity){
|
|
|
// if (((OTCChartActivity) getActivity()).getTradeMode() == MTPEnums.TRADEMODE_BIDDING) {// 竞价
|
|
// if (((OTCChartActivity) getActivity()).getTradeMode() == MTPEnums.TRADEMODE_BIDDING) {// 竞价
|
|
|
// tem = getResources().getStringArray(R.array.chart_k_tab_bid);
|
|
// tem = getResources().getStringArray(R.array.chart_k_tab_bid);
|
|
|
// } else if (((OTCChartActivity) getActivity()).getTradeMode() == MTPEnums.TRADEMODE_MARKETMAKE) {// 做市--连续现货
|
|
// } else if (((OTCChartActivity) getActivity()).getTradeMode() == MTPEnums.TRADEMODE_MARKETMAKE) {// 做市--连续现货
|
|
@@ -284,8 +283,16 @@ public class KChartFragment extends Fragment {
|
|
|
// } else {
|
|
// } else {
|
|
|
// tem = getResources().getStringArray(R.array.chart_k_tab_market);
|
|
// tem = getResources().getStringArray(R.array.chart_k_tab_market);
|
|
|
// }
|
|
// }
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ String[] tem = new String[8];
|
|
|
|
|
+ tem[0] = "VOL";
|
|
|
|
|
+ tem[1] = "MACD";
|
|
|
|
|
+ tem[2] = "RSI";
|
|
|
|
|
+ tem[3] = "PSY";
|
|
|
|
|
+ tem[4] = "DMA";
|
|
|
|
|
+ tem[5] = "KDJ";
|
|
|
|
|
+ tem[6] = "BIAS";
|
|
|
|
|
+ tem[7] = "CCI";
|
|
|
|
|
+// }
|
|
|
mtp_chart_k_tab.show(tem, false);
|
|
mtp_chart_k_tab.show(tem, false);
|
|
|
mtp_chart_k_tab.selectTab(mtp_chart_k_tab.getCurrentIndxe());
|
|
mtp_chart_k_tab.selectTab(mtp_chart_k_tab.getCurrentIndxe());
|
|
|
}
|
|
}
|
|
@@ -449,90 +456,90 @@ public class KChartFragment extends Fragment {
|
|
|
minusstickchart.postInvalidate();
|
|
minusstickchart.postInvalidate();
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- ChartKDJDatas chartKDJDatas = new TargetControl().getKDJs(dataContainer);
|
|
|
|
|
- List<LineEntity> lines = new ArrayList<LineEntity>();
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * k
|
|
|
|
|
- */
|
|
|
|
|
- LineEntity k = new LineEntity();
|
|
|
|
|
- k.setLineData(chartKDJDatas.getK());
|
|
|
|
|
- if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
- k.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getKDJKColor());
|
|
|
|
|
- }
|
|
|
|
|
- k.setStartIndex(8);
|
|
|
|
|
- lines.add(k);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * d
|
|
|
|
|
- */
|
|
|
|
|
- LineEntity d = new LineEntity();
|
|
|
|
|
- d.setLineData(chartKDJDatas.getD());
|
|
|
|
|
- if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
- d.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getKDJDColor());
|
|
|
|
|
- }
|
|
|
|
|
- d.setStartIndex(8);
|
|
|
|
|
- lines.add(d);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * j
|
|
|
|
|
- */
|
|
|
|
|
- LineEntity j = new LineEntity();
|
|
|
|
|
- j.setLineData(chartKDJDatas.getJ());
|
|
|
|
|
- if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
- j.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getKDJJColor());
|
|
|
|
|
- }
|
|
|
|
|
- j.setStartIndex(8);
|
|
|
|
|
- lines.add(j);
|
|
|
|
|
-
|
|
|
|
|
- minusstickchart.setLineData(lines);
|
|
|
|
|
-
|
|
|
|
|
- minusstickchart.setShowStick(false);
|
|
|
|
|
- List<StickEntity> stickDataList = new ArrayList<StickEntity>();
|
|
|
|
|
- StickEntity stickEntity = null;
|
|
|
|
|
- /**
|
|
|
|
|
- * 计算出当前数据的最大最小值
|
|
|
|
|
- */
|
|
|
|
|
- for (int i = 0; i < chartKDJDatas.getK().size(); i++) {
|
|
|
|
|
- if (i >= stickDataList.size()) {
|
|
|
|
|
- stickEntity = new StickEntity();
|
|
|
|
|
- stickDataList.add(stickEntity);
|
|
|
|
|
- }
|
|
|
|
|
- if (stickDataList.get(i).getHigh() < chartKDJDatas.getK().get(i) || stickDataList.get(i).getHigh() == 0) {
|
|
|
|
|
- stickDataList.get(i).setHigh(chartKDJDatas.getK().get(i));
|
|
|
|
|
- }
|
|
|
|
|
- if (stickDataList.get(i).getLow() > chartKDJDatas.getK().get(i)) {
|
|
|
|
|
- stickDataList.get(i).setLow(chartKDJDatas.getK().get(i));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- for (int i = 0; i < chartKDJDatas.getD().size(); i++) {
|
|
|
|
|
- if (i >= stickDataList.size()) {
|
|
|
|
|
- stickEntity = new StickEntity();
|
|
|
|
|
- stickDataList.add(stickEntity);
|
|
|
|
|
- }
|
|
|
|
|
- if (stickDataList.get(i).getHigh() < chartKDJDatas.getD().get(i)) {
|
|
|
|
|
- stickDataList.get(i).setHigh(chartKDJDatas.getD().get(i));
|
|
|
|
|
- }
|
|
|
|
|
- if (stickDataList.get(i).getLow() > chartKDJDatas.getD().get(i)) {
|
|
|
|
|
- stickDataList.get(i).setLow(chartKDJDatas.getD().get(i));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- for (int i = 0; i < chartKDJDatas.getJ().size(); i++) {
|
|
|
|
|
- if (i >= stickDataList.size()) {
|
|
|
|
|
- stickEntity = new StickEntity();
|
|
|
|
|
- stickDataList.add(stickEntity);
|
|
|
|
|
- }
|
|
|
|
|
- if (stickDataList.get(i).getHigh() < chartKDJDatas.getJ().get(i)) {
|
|
|
|
|
- stickDataList.get(i).setHigh(chartKDJDatas.getJ().get(i));
|
|
|
|
|
- }
|
|
|
|
|
- if (stickDataList.get(i).getLow() > chartKDJDatas.getJ().get(i)) {
|
|
|
|
|
- stickDataList.get(i).setLow(chartKDJDatas.getJ().get(i));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- minusstickchart.setStickData(stickDataList);
|
|
|
|
|
-
|
|
|
|
|
- minusstickchart.setDecimalNum(mDecimalNum);
|
|
|
|
|
- minusstickchart.postInvalidate();
|
|
|
|
|
|
|
+// ChartKDJDatas chartKDJDatas = new TargetControl().getKDJs(dataContainer);
|
|
|
|
|
+// List<LineEntity> lines = new ArrayList<LineEntity>();
|
|
|
|
|
+//
|
|
|
|
|
+// /**
|
|
|
|
|
+// * k
|
|
|
|
|
+// */
|
|
|
|
|
+// LineEntity k = new LineEntity();
|
|
|
|
|
+// k.setLineData(chartKDJDatas.getK());
|
|
|
|
|
+// if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
+// k.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getKDJKColor());
|
|
|
|
|
+// }
|
|
|
|
|
+// k.setStartIndex(8);
|
|
|
|
|
+// lines.add(k);
|
|
|
|
|
+//
|
|
|
|
|
+// /**
|
|
|
|
|
+// * d
|
|
|
|
|
+// */
|
|
|
|
|
+// LineEntity d = new LineEntity();
|
|
|
|
|
+// d.setLineData(chartKDJDatas.getD());
|
|
|
|
|
+// if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
+// d.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getKDJDColor());
|
|
|
|
|
+// }
|
|
|
|
|
+// d.setStartIndex(8);
|
|
|
|
|
+// lines.add(d);
|
|
|
|
|
+//
|
|
|
|
|
+// /**
|
|
|
|
|
+// * j
|
|
|
|
|
+// */
|
|
|
|
|
+// LineEntity j = new LineEntity();
|
|
|
|
|
+// j.setLineData(chartKDJDatas.getJ());
|
|
|
|
|
+// if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
+// j.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getKDJJColor());
|
|
|
|
|
+// }
|
|
|
|
|
+// j.setStartIndex(8);
|
|
|
|
|
+// lines.add(j);
|
|
|
|
|
+//
|
|
|
|
|
+// minusstickchart.setLineData(lines);
|
|
|
|
|
+//
|
|
|
|
|
+// minusstickchart.setShowStick(false);
|
|
|
|
|
+// List<StickEntity> stickDataList = new ArrayList<StickEntity>();
|
|
|
|
|
+// StickEntity stickEntity = null;
|
|
|
|
|
+// /**
|
|
|
|
|
+// * 计算出当前数据的最大最小值
|
|
|
|
|
+// */
|
|
|
|
|
+// for (int i = 0; i < chartKDJDatas.getK().size(); i++) {
|
|
|
|
|
+// if (i >= stickDataList.size()) {
|
|
|
|
|
+// stickEntity = new StickEntity();
|
|
|
|
|
+// stickDataList.add(stickEntity);
|
|
|
|
|
+// }
|
|
|
|
|
+// if (stickDataList.get(i).getHigh() < chartKDJDatas.getK().get(i) || stickDataList.get(i).getHigh() == 0) {
|
|
|
|
|
+// stickDataList.get(i).setHigh(chartKDJDatas.getK().get(i));
|
|
|
|
|
+// }
|
|
|
|
|
+// if (stickDataList.get(i).getLow() > chartKDJDatas.getK().get(i)) {
|
|
|
|
|
+// stickDataList.get(i).setLow(chartKDJDatas.getK().get(i));
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+// for (int i = 0; i < chartKDJDatas.getD().size(); i++) {
|
|
|
|
|
+// if (i >= stickDataList.size()) {
|
|
|
|
|
+// stickEntity = new StickEntity();
|
|
|
|
|
+// stickDataList.add(stickEntity);
|
|
|
|
|
+// }
|
|
|
|
|
+// if (stickDataList.get(i).getHigh() < chartKDJDatas.getD().get(i)) {
|
|
|
|
|
+// stickDataList.get(i).setHigh(chartKDJDatas.getD().get(i));
|
|
|
|
|
+// }
|
|
|
|
|
+// if (stickDataList.get(i).getLow() > chartKDJDatas.getD().get(i)) {
|
|
|
|
|
+// stickDataList.get(i).setLow(chartKDJDatas.getD().get(i));
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+// for (int i = 0; i < chartKDJDatas.getJ().size(); i++) {
|
|
|
|
|
+// if (i >= stickDataList.size()) {
|
|
|
|
|
+// stickEntity = new StickEntity();
|
|
|
|
|
+// stickDataList.add(stickEntity);
|
|
|
|
|
+// }
|
|
|
|
|
+// if (stickDataList.get(i).getHigh() < chartKDJDatas.getJ().get(i)) {
|
|
|
|
|
+// stickDataList.get(i).setHigh(chartKDJDatas.getJ().get(i));
|
|
|
|
|
+// }
|
|
|
|
|
+// if (stickDataList.get(i).getLow() > chartKDJDatas.getJ().get(i)) {
|
|
|
|
|
+// stickDataList.get(i).setLow(chartKDJDatas.getJ().get(i));
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+// minusstickchart.setStickData(stickDataList);
|
|
|
|
|
+//
|
|
|
|
|
+// minusstickchart.setDecimalNum(mDecimalNum);
|
|
|
|
|
+// minusstickchart.postInvalidate();
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -546,48 +553,48 @@ public class KChartFragment extends Fragment {
|
|
|
if (dataContainer.mSize == 0) {
|
|
if (dataContainer.mSize == 0) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- BidChartTotalDatas bidChartTotalDatas = new TargetControl().getBidTotalData(dataContainer);
|
|
|
|
|
- List<LineEntity> lines = new ArrayList<LineEntity>();
|
|
|
|
|
-
|
|
|
|
|
- LineEntity total5 = new LineEntity();
|
|
|
|
|
- total5.setStartIndex(5);
|
|
|
|
|
- total5.setLineData(bidChartTotalDatas.getTotal5());
|
|
|
|
|
- if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
- total5.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getVOL5Color());
|
|
|
|
|
- }
|
|
|
|
|
- lines.add(total5);
|
|
|
|
|
-
|
|
|
|
|
- LineEntity total10 = new LineEntity();
|
|
|
|
|
- total10.setStartIndex(10);
|
|
|
|
|
- total10.setLineData(bidChartTotalDatas.getTotal10());
|
|
|
|
|
- if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
- total10.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getVOL10Color());
|
|
|
|
|
- }
|
|
|
|
|
- lines.add(total10);
|
|
|
|
|
-
|
|
|
|
|
- minusstickchart.setLineData(lines);
|
|
|
|
|
- minusstickchart.setShowStick(true);
|
|
|
|
|
- List<StickEntity> stickDataList = new ArrayList<StickEntity>();
|
|
|
|
|
- StickEntity tem = null;
|
|
|
|
|
- for (int i = 0; i < dataContainer.mOHLCList.size(); i++) {
|
|
|
|
|
- tem = new StickEntity();
|
|
|
|
|
- try {
|
|
|
|
|
- tem.setHigh(Double.parseDouble(((ChartData) dataContainer.mOHLCList.get(i)).getVolume()));
|
|
|
|
|
- if (dataContainer.mOHLCList.get(i).getClose() > dataContainer.mOHLCList.get(i).getOpen()) {
|
|
|
|
|
- tem.setColorFlag(1);
|
|
|
|
|
- } else if (dataContainer.mOHLCList.get(i).getClose() == dataContainer.mOHLCList.get(i).getOpen()) {
|
|
|
|
|
- tem.setColorFlag(0);
|
|
|
|
|
- } else {
|
|
|
|
|
- tem.setColorFlag(-1);
|
|
|
|
|
- }
|
|
|
|
|
- stickDataList.add(tem);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- minusstickchart.setStickData(stickDataList);
|
|
|
|
|
- minusstickchart.setDecimalNum(mDecimalNum);
|
|
|
|
|
- minusstickchart.postInvalidate();
|
|
|
|
|
|
|
+// BidChartTotalDatas bidChartTotalDatas = new TargetControl().getBidTotalData(dataContainer);
|
|
|
|
|
+// List<LineEntity> lines = new ArrayList<LineEntity>();
|
|
|
|
|
+//
|
|
|
|
|
+// LineEntity total5 = new LineEntity();
|
|
|
|
|
+// total5.setStartIndex(5);
|
|
|
|
|
+// total5.setLineData(bidChartTotalDatas.getTotal5());
|
|
|
|
|
+// if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
+// total5.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getVOL5Color());
|
|
|
|
|
+// }
|
|
|
|
|
+// lines.add(total5);
|
|
|
|
|
+//
|
|
|
|
|
+// LineEntity total10 = new LineEntity();
|
|
|
|
|
+// total10.setStartIndex(10);
|
|
|
|
|
+// total10.setLineData(bidChartTotalDatas.getTotal10());
|
|
|
|
|
+// if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
+// total10.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getVOL10Color());
|
|
|
|
|
+// }
|
|
|
|
|
+// lines.add(total10);
|
|
|
|
|
+//
|
|
|
|
|
+// minusstickchart.setLineData(lines);
|
|
|
|
|
+// minusstickchart.setShowStick(true);
|
|
|
|
|
+// List<StickEntity> stickDataList = new ArrayList<StickEntity>();
|
|
|
|
|
+// StickEntity tem = null;
|
|
|
|
|
+// for (int i = 0; i < dataContainer.mOHLCList.size(); i++) {
|
|
|
|
|
+// tem = new StickEntity();
|
|
|
|
|
+// try {
|
|
|
|
|
+// tem.setHigh(Double.parseDouble(((ChartData) dataContainer.mOHLCList.get(i)).getVolume()));
|
|
|
|
|
+// if (dataContainer.mOHLCList.get(i).getClose() > dataContainer.mOHLCList.get(i).getOpen()) {
|
|
|
|
|
+// tem.setColorFlag(1);
|
|
|
|
|
+// } else if (dataContainer.mOHLCList.get(i).getClose() == dataContainer.mOHLCList.get(i).getOpen()) {
|
|
|
|
|
+// tem.setColorFlag(0);
|
|
|
|
|
+// } else {
|
|
|
|
|
+// tem.setColorFlag(-1);
|
|
|
|
|
+// }
|
|
|
|
|
+// stickDataList.add(tem);
|
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
|
+// e.printStackTrace();
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+// minusstickchart.setStickData(stickDataList);
|
|
|
|
|
+// minusstickchart.setDecimalNum(mDecimalNum);
|
|
|
|
|
+// minusstickchart.postInvalidate();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void setBIASLine(MinusStickChart minusstickchart, ChartDataContainer dataContainer) {
|
|
private void setBIASLine(MinusStickChart minusstickchart, ChartDataContainer dataContainer) {
|
|
@@ -596,89 +603,89 @@ public class KChartFragment extends Fragment {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- ChartBIASDatas chartBIASDatas = new TargetControl().getBIASs(dataContainer);
|
|
|
|
|
- List<LineEntity> lines = new ArrayList<LineEntity>();
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * bias6
|
|
|
|
|
- */
|
|
|
|
|
- LineEntity bias6 = new LineEntity();
|
|
|
|
|
- bias6.setLineData(chartBIASDatas.getBias6());
|
|
|
|
|
- if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
- bias6.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getBIAS6Color());
|
|
|
|
|
- }
|
|
|
|
|
- bias6.setStartIndex(5);
|
|
|
|
|
- lines.add(bias6);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * bias12
|
|
|
|
|
- */
|
|
|
|
|
- LineEntity bias12 = new LineEntity();
|
|
|
|
|
- bias12.setLineData(chartBIASDatas.getBias12());
|
|
|
|
|
- if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
- bias12.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getBIAS12Color());
|
|
|
|
|
- }
|
|
|
|
|
- bias12.setStartIndex(11);
|
|
|
|
|
- lines.add(bias12);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * bias24
|
|
|
|
|
- */
|
|
|
|
|
- LineEntity bias24 = new LineEntity();
|
|
|
|
|
- bias24.setLineData(chartBIASDatas.getBias24());
|
|
|
|
|
- if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
- bias24.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getBIAS24Color());
|
|
|
|
|
- }
|
|
|
|
|
- bias24.setStartIndex(23);
|
|
|
|
|
- lines.add(bias24);
|
|
|
|
|
-
|
|
|
|
|
- minusstickchart.setLineData(lines);
|
|
|
|
|
-
|
|
|
|
|
- minusstickchart.setShowStick(false);
|
|
|
|
|
- List<StickEntity> stickDataList = new ArrayList<StickEntity>();
|
|
|
|
|
- StickEntity stickEntity = null;
|
|
|
|
|
-
|
|
|
|
|
- for (int i = 0; i < chartBIASDatas.getBias6().size(); i++) {
|
|
|
|
|
- if (i >= stickDataList.size()) {
|
|
|
|
|
- stickEntity = new StickEntity();
|
|
|
|
|
- stickDataList.add(stickEntity);
|
|
|
|
|
- }
|
|
|
|
|
- if (stickDataList.get(i).getHigh() < chartBIASDatas.getBias6().get(i)) {
|
|
|
|
|
- stickDataList.get(i).setHigh(chartBIASDatas.getBias6().get(i));
|
|
|
|
|
- }
|
|
|
|
|
- if (stickDataList.get(i).getLow() > chartBIASDatas.getBias6().get(i)) {
|
|
|
|
|
- stickDataList.get(i).setLow(chartBIASDatas.getBias6().get(i));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- for (int i = 0; i < chartBIASDatas.getBias12().size(); i++) {
|
|
|
|
|
- if (i >= stickDataList.size()) {
|
|
|
|
|
- stickEntity = new StickEntity();
|
|
|
|
|
- stickDataList.add(stickEntity);
|
|
|
|
|
- }
|
|
|
|
|
- if (stickDataList.get(i).getHigh() < chartBIASDatas.getBias12().get(i)) {
|
|
|
|
|
- stickDataList.get(i).setHigh(chartBIASDatas.getBias12().get(i));
|
|
|
|
|
- }
|
|
|
|
|
- if (stickDataList.get(i).getLow() > chartBIASDatas.getBias12().get(i)) {
|
|
|
|
|
- stickDataList.get(i).setLow(chartBIASDatas.getBias12().get(i));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- for (int i = 0; i < chartBIASDatas.getBias24().size(); i++) {
|
|
|
|
|
- if (i >= stickDataList.size()) {
|
|
|
|
|
- stickEntity = new StickEntity();
|
|
|
|
|
- stickDataList.add(stickEntity);
|
|
|
|
|
- }
|
|
|
|
|
- if (stickDataList.get(i).getHigh() < chartBIASDatas.getBias24().get(i)) {
|
|
|
|
|
- stickDataList.get(i).setHigh(chartBIASDatas.getBias24().get(i));
|
|
|
|
|
- }
|
|
|
|
|
- if (stickDataList.get(i).getLow() > chartBIASDatas.getBias24().get(i)) {
|
|
|
|
|
- stickDataList.get(i).setLow(chartBIASDatas.getBias24().get(i));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- minusstickchart.setStickData(stickDataList);
|
|
|
|
|
-
|
|
|
|
|
- minusstickchart.setDecimalNum(mDecimalNum);
|
|
|
|
|
- minusstickchart.postInvalidate();
|
|
|
|
|
|
|
+// ChartBIASDatas chartBIASDatas = new TargetControl().getBIASs(dataContainer);
|
|
|
|
|
+// List<LineEntity> lines = new ArrayList<LineEntity>();
|
|
|
|
|
+//
|
|
|
|
|
+// /**
|
|
|
|
|
+// * bias6
|
|
|
|
|
+// */
|
|
|
|
|
+// LineEntity bias6 = new LineEntity();
|
|
|
|
|
+// bias6.setLineData(chartBIASDatas.getBias6());
|
|
|
|
|
+// if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
+// bias6.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getBIAS6Color());
|
|
|
|
|
+// }
|
|
|
|
|
+// bias6.setStartIndex(5);
|
|
|
|
|
+// lines.add(bias6);
|
|
|
|
|
+//
|
|
|
|
|
+// /**
|
|
|
|
|
+// * bias12
|
|
|
|
|
+// */
|
|
|
|
|
+// LineEntity bias12 = new LineEntity();
|
|
|
|
|
+// bias12.setLineData(chartBIASDatas.getBias12());
|
|
|
|
|
+// if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
+// bias12.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getBIAS12Color());
|
|
|
|
|
+// }
|
|
|
|
|
+// bias12.setStartIndex(11);
|
|
|
|
|
+// lines.add(bias12);
|
|
|
|
|
+//
|
|
|
|
|
+// /**
|
|
|
|
|
+// * bias24
|
|
|
|
|
+// */
|
|
|
|
|
+// LineEntity bias24 = new LineEntity();
|
|
|
|
|
+// bias24.setLineData(chartBIASDatas.getBias24());
|
|
|
|
|
+// if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
+// bias24.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getBIAS24Color());
|
|
|
|
|
+// }
|
|
|
|
|
+// bias24.setStartIndex(23);
|
|
|
|
|
+// lines.add(bias24);
|
|
|
|
|
+//
|
|
|
|
|
+// minusstickchart.setLineData(lines);
|
|
|
|
|
+//
|
|
|
|
|
+// minusstickchart.setShowStick(false);
|
|
|
|
|
+// List<StickEntity> stickDataList = new ArrayList<StickEntity>();
|
|
|
|
|
+// StickEntity stickEntity = null;
|
|
|
|
|
+//
|
|
|
|
|
+// for (int i = 0; i < chartBIASDatas.getBias6().size(); i++) {
|
|
|
|
|
+// if (i >= stickDataList.size()) {
|
|
|
|
|
+// stickEntity = new StickEntity();
|
|
|
|
|
+// stickDataList.add(stickEntity);
|
|
|
|
|
+// }
|
|
|
|
|
+// if (stickDataList.get(i).getHigh() < chartBIASDatas.getBias6().get(i)) {
|
|
|
|
|
+// stickDataList.get(i).setHigh(chartBIASDatas.getBias6().get(i));
|
|
|
|
|
+// }
|
|
|
|
|
+// if (stickDataList.get(i).getLow() > chartBIASDatas.getBias6().get(i)) {
|
|
|
|
|
+// stickDataList.get(i).setLow(chartBIASDatas.getBias6().get(i));
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+// for (int i = 0; i < chartBIASDatas.getBias12().size(); i++) {
|
|
|
|
|
+// if (i >= stickDataList.size()) {
|
|
|
|
|
+// stickEntity = new StickEntity();
|
|
|
|
|
+// stickDataList.add(stickEntity);
|
|
|
|
|
+// }
|
|
|
|
|
+// if (stickDataList.get(i).getHigh() < chartBIASDatas.getBias12().get(i)) {
|
|
|
|
|
+// stickDataList.get(i).setHigh(chartBIASDatas.getBias12().get(i));
|
|
|
|
|
+// }
|
|
|
|
|
+// if (stickDataList.get(i).getLow() > chartBIASDatas.getBias12().get(i)) {
|
|
|
|
|
+// stickDataList.get(i).setLow(chartBIASDatas.getBias12().get(i));
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+// for (int i = 0; i < chartBIASDatas.getBias24().size(); i++) {
|
|
|
|
|
+// if (i >= stickDataList.size()) {
|
|
|
|
|
+// stickEntity = new StickEntity();
|
|
|
|
|
+// stickDataList.add(stickEntity);
|
|
|
|
|
+// }
|
|
|
|
|
+// if (stickDataList.get(i).getHigh() < chartBIASDatas.getBias24().get(i)) {
|
|
|
|
|
+// stickDataList.get(i).setHigh(chartBIASDatas.getBias24().get(i));
|
|
|
|
|
+// }
|
|
|
|
|
+// if (stickDataList.get(i).getLow() > chartBIASDatas.getBias24().get(i)) {
|
|
|
|
|
+// stickDataList.get(i).setLow(chartBIASDatas.getBias24().get(i));
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// minusstickchart.setStickData(stickDataList);
|
|
|
|
|
+//
|
|
|
|
|
+// minusstickchart.setDecimalNum(mDecimalNum);
|
|
|
|
|
+// minusstickchart.postInvalidate();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void setDMALine(MinusStickChart minusstickchart, ChartDataContainer dataContainer) {
|
|
private void setDMALine(MinusStickChart minusstickchart, ChartDataContainer dataContainer) {
|
|
@@ -686,38 +693,38 @@ public class KChartFragment extends Fragment {
|
|
|
minusstickchart.postInvalidate();
|
|
minusstickchart.postInvalidate();
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- ChartDMADatas chartDMADatas = new TargetControl().getDMAs(dataContainer);
|
|
|
|
|
- List<LineEntity> lines = new ArrayList<LineEntity>();
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * DMA
|
|
|
|
|
- */
|
|
|
|
|
- LineEntity dma = new LineEntity();
|
|
|
|
|
- dma.setLineData(chartDMADatas.getDMA());
|
|
|
|
|
- if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
- dma.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getDMAColor());
|
|
|
|
|
- }
|
|
|
|
|
- dma.setStartIndex(49);
|
|
|
|
|
- lines.add(dma);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * AMA
|
|
|
|
|
- */
|
|
|
|
|
- LineEntity ama = new LineEntity();
|
|
|
|
|
- ama.setLineData(chartDMADatas.getAMA());
|
|
|
|
|
- if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
- ama.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getDMAAMAColor());
|
|
|
|
|
- }
|
|
|
|
|
- ama.setStartIndex(5);
|
|
|
|
|
- lines.add(ama);
|
|
|
|
|
-
|
|
|
|
|
- minusstickchart.setLineData(lines);
|
|
|
|
|
-
|
|
|
|
|
- minusstickchart.setShowStick(false);
|
|
|
|
|
- minusstickchart.setStickData(dataContainer.mStickList.subList(0, dataContainer.mSize));
|
|
|
|
|
-
|
|
|
|
|
- minusstickchart.setDecimalNum(mDecimalNum);
|
|
|
|
|
- minusstickchart.postInvalidate();
|
|
|
|
|
|
|
+// ChartDMADatas chartDMADatas = new TargetControl().getDMAs(dataContainer);
|
|
|
|
|
+// List<LineEntity> lines = new ArrayList<LineEntity>();
|
|
|
|
|
+//
|
|
|
|
|
+// /**
|
|
|
|
|
+// * DMA
|
|
|
|
|
+// */
|
|
|
|
|
+// LineEntity dma = new LineEntity();
|
|
|
|
|
+// dma.setLineData(chartDMADatas.getDMA());
|
|
|
|
|
+// if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
+// dma.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getDMAColor());
|
|
|
|
|
+// }
|
|
|
|
|
+// dma.setStartIndex(49);
|
|
|
|
|
+// lines.add(dma);
|
|
|
|
|
+//
|
|
|
|
|
+// /**
|
|
|
|
|
+// * AMA
|
|
|
|
|
+// */
|
|
|
|
|
+// LineEntity ama = new LineEntity();
|
|
|
|
|
+// ama.setLineData(chartDMADatas.getAMA());
|
|
|
|
|
+// if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
+// ama.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getDMAAMAColor());
|
|
|
|
|
+// }
|
|
|
|
|
+// ama.setStartIndex(5);
|
|
|
|
|
+// lines.add(ama);
|
|
|
|
|
+//
|
|
|
|
|
+// minusstickchart.setLineData(lines);
|
|
|
|
|
+//
|
|
|
|
|
+// minusstickchart.setShowStick(false);
|
|
|
|
|
+// minusstickchart.setStickData(dataContainer.mStickList.subList(0, dataContainer.mSize));
|
|
|
|
|
+//
|
|
|
|
|
+// minusstickchart.setDecimalNum(mDecimalNum);
|
|
|
|
|
+// minusstickchart.postInvalidate();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -731,27 +738,27 @@ public class KChartFragment extends Fragment {
|
|
|
minusstickchart.postInvalidate();
|
|
minusstickchart.postInvalidate();
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- List<Double> cci = new TargetControl().getCCIs(dataContainer);
|
|
|
|
|
- List<LineEntity> lines = new ArrayList<LineEntity>();
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * cci
|
|
|
|
|
- */
|
|
|
|
|
- LineEntity cciLine = new LineEntity();
|
|
|
|
|
- cciLine.setLineData(cci);
|
|
|
|
|
- if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
- cciLine.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getCCIColor());
|
|
|
|
|
- }
|
|
|
|
|
- cciLine.setStartIndex(12);
|
|
|
|
|
- lines.add(cciLine);
|
|
|
|
|
-
|
|
|
|
|
- minusstickchart.setLineData(lines);
|
|
|
|
|
-
|
|
|
|
|
- minusstickchart.setShowStick(false);
|
|
|
|
|
- minusstickchart.setStickData(dataContainer.mStickList.subList(0, dataContainer.mSize));
|
|
|
|
|
-
|
|
|
|
|
- minusstickchart.setDecimalNum(mDecimalNum);
|
|
|
|
|
- minusstickchart.postInvalidate();
|
|
|
|
|
|
|
+// List<Double> cci = new TargetControl().getCCIs(dataContainer);
|
|
|
|
|
+// List<LineEntity> lines = new ArrayList<LineEntity>();
|
|
|
|
|
+//
|
|
|
|
|
+// /**
|
|
|
|
|
+// * cci
|
|
|
|
|
+// */
|
|
|
|
|
+// LineEntity cciLine = new LineEntity();
|
|
|
|
|
+// cciLine.setLineData(cci);
|
|
|
|
|
+// if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
+// cciLine.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getCCIColor());
|
|
|
|
|
+// }
|
|
|
|
|
+// cciLine.setStartIndex(12);
|
|
|
|
|
+// lines.add(cciLine);
|
|
|
|
|
+//
|
|
|
|
|
+// minusstickchart.setLineData(lines);
|
|
|
|
|
+//
|
|
|
|
|
+// minusstickchart.setShowStick(false);
|
|
|
|
|
+// minusstickchart.setStickData(dataContainer.mStickList.subList(0, dataContainer.mSize));
|
|
|
|
|
+//
|
|
|
|
|
+// minusstickchart.setDecimalNum(mDecimalNum);
|
|
|
|
|
+// minusstickchart.postInvalidate();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -815,52 +822,52 @@ public class KChartFragment extends Fragment {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * RSI 5
|
|
|
|
|
- */
|
|
|
|
|
- List<LineEntity> lines = new ArrayList<LineEntity>();
|
|
|
|
|
- ChartRSIDatas rsiData = new TargetControl().getRSI(dataContainer);
|
|
|
|
|
-
|
|
|
|
|
- LineEntity rsi = new LineEntity();
|
|
|
|
|
- rsi.setLineData(rsiData.getRsi6());
|
|
|
|
|
- if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
- rsi.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getRSI6Color());
|
|
|
|
|
- }
|
|
|
|
|
- rsi.setStartIndex(5);
|
|
|
|
|
- lines.add(rsi);
|
|
|
|
|
-
|
|
|
|
|
- LineEntity rsi12 = new LineEntity();
|
|
|
|
|
- rsi12.setLineData(rsiData.getRsi12());
|
|
|
|
|
- if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
- rsi12.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getRSI12Color());
|
|
|
|
|
- }
|
|
|
|
|
- rsi12.setStartIndex(11);
|
|
|
|
|
- lines.add(rsi12);
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- LineEntity rsi24 = new LineEntity();
|
|
|
|
|
- rsi24.setLineData(rsiData.getRsi24());
|
|
|
|
|
- if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
- rsi24.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getRSI24Color());
|
|
|
|
|
- }
|
|
|
|
|
- rsi24.setStartIndex(23);
|
|
|
|
|
- lines.add(rsi24);
|
|
|
|
|
-
|
|
|
|
|
- minusstickchart.setLineData(lines);
|
|
|
|
|
-
|
|
|
|
|
- List<StickEntity> entities = new ArrayList<StickEntity>();
|
|
|
|
|
- StickEntity entity = null;
|
|
|
|
|
- for (int i = 0; i < dataContainer.mStickList.subList(0, dataContainer.mSize).size(); i++) {
|
|
|
|
|
- entity = new StickEntity();
|
|
|
|
|
- entity.setHigh(100.0);
|
|
|
|
|
- entity.setLow(0.0);
|
|
|
|
|
- entities.add(entity);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- minusstickchart.setShowStick(false);
|
|
|
|
|
- minusstickchart.setStickData(entities);
|
|
|
|
|
- minusstickchart.setDecimalNum(mDecimalNum);
|
|
|
|
|
- minusstickchart.postInvalidate();
|
|
|
|
|
|
|
+// /**
|
|
|
|
|
+// * RSI 5
|
|
|
|
|
+// */
|
|
|
|
|
+// List<LineEntity> lines = new ArrayList<LineEntity>();
|
|
|
|
|
+// ChartRSIDatas rsiData = new TargetControl().getRSI(dataContainer);
|
|
|
|
|
+//
|
|
|
|
|
+// LineEntity rsi = new LineEntity();
|
|
|
|
|
+// rsi.setLineData(rsiData.getRsi6());
|
|
|
|
|
+// if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
+// rsi.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getRSI6Color());
|
|
|
|
|
+// }
|
|
|
|
|
+// rsi.setStartIndex(5);
|
|
|
|
|
+// lines.add(rsi);
|
|
|
|
|
+//
|
|
|
|
|
+// LineEntity rsi12 = new LineEntity();
|
|
|
|
|
+// rsi12.setLineData(rsiData.getRsi12());
|
|
|
|
|
+// if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
+// rsi12.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getRSI12Color());
|
|
|
|
|
+// }
|
|
|
|
|
+// rsi12.setStartIndex(11);
|
|
|
|
|
+// lines.add(rsi12);
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+// LineEntity rsi24 = new LineEntity();
|
|
|
|
|
+// rsi24.setLineData(rsiData.getRsi24());
|
|
|
|
|
+// if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
+// rsi24.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getRSI24Color());
|
|
|
|
|
+// }
|
|
|
|
|
+// rsi24.setStartIndex(23);
|
|
|
|
|
+// lines.add(rsi24);
|
|
|
|
|
+//
|
|
|
|
|
+// minusstickchart.setLineData(lines);
|
|
|
|
|
+//
|
|
|
|
|
+// List<StickEntity> entities = new ArrayList<StickEntity>();
|
|
|
|
|
+// StickEntity entity = null;
|
|
|
|
|
+// for (int i = 0; i < dataContainer.mStickList.subList(0, dataContainer.mSize).size(); i++) {
|
|
|
|
|
+// entity = new StickEntity();
|
|
|
|
|
+// entity.setHigh(100.0);
|
|
|
|
|
+// entity.setLow(0.0);
|
|
|
|
|
+// entities.add(entity);
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// minusstickchart.setShowStick(false);
|
|
|
|
|
+// minusstickchart.setStickData(entities);
|
|
|
|
|
+// minusstickchart.setDecimalNum(mDecimalNum);
|
|
|
|
|
+// minusstickchart.postInvalidate();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -873,38 +880,7 @@ public class KChartFragment extends Fragment {
|
|
|
if (dataContainer.mSize == 0) {
|
|
if (dataContainer.mSize == 0) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- ChartPSYDatas chartPSYDatas = new TargetControl().getPSYs(dataContainer);
|
|
|
|
|
- List<LineEntity> lines = new ArrayList<LineEntity>();
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * psy
|
|
|
|
|
- */
|
|
|
|
|
- LineEntity psy = new LineEntity();
|
|
|
|
|
- psy.setLineData(chartPSYDatas.getPsy());
|
|
|
|
|
- if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
- psy.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getPSYColor());
|
|
|
|
|
- }
|
|
|
|
|
- psy.setStartIndex(25);
|
|
|
|
|
- lines.add(psy);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * psyMa
|
|
|
|
|
- */
|
|
|
|
|
- LineEntity psyMa = new LineEntity();
|
|
|
|
|
- psyMa.setLineData(chartPSYDatas.getPsyMa());
|
|
|
|
|
- if(getActivity() instanceof OTCChartActivity) {
|
|
|
|
|
- psyMa.setLineColor(((OTCChartActivity) getActivity()).getMtpChartControl().getPSYMAColor());
|
|
|
|
|
- }
|
|
|
|
|
- psyMa.setStartIndex(25);
|
|
|
|
|
- lines.add(psyMa);
|
|
|
|
|
-
|
|
|
|
|
- minusstickchart.setLineData(lines);
|
|
|
|
|
-
|
|
|
|
|
- minusstickchart.setShowStick(false);
|
|
|
|
|
- minusstickchart.setStickData(dataContainer.mStickList.subList(0, dataContainer.mSize));
|
|
|
|
|
-
|
|
|
|
|
- minusstickchart.setDecimalNum(mDecimalNum);
|
|
|
|
|
- minusstickchart.postInvalidate();
|
|
|
|
|
|
|
+// setCCILine
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private int getNowPriceColor() {
|
|
private int getNowPriceColor() {
|