?? roc.java
字號:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi
// Source File Name: ROC.java
package gnnt.MEBS.HQApplet.Indicator;
import gnnt.MEBS.HQApplet.*;
import java.awt.Graphics;
import java.awt.Rectangle;
// Referenced classes of package gnnt.MEBS.HQApplet.Indicator:
// IndicatorBase, IndicatorPos
public class ROC extends IndicatorBase
{
private final int m_iParam[] = {
12, 6
};
public ROC(IndicatorPos pos, int Precision)
{
super(pos, Precision);
m_strIndicatorName = "ROC";
m_strIndicatorName += "(";
for(int i = 0; i < m_iParam.length; i++)
{
if(i > 0)
m_strIndicatorName += ",";
m_strIndicatorName += m_iParam[i];
}
m_strIndicatorName += ")";
m_strParamName = (new String[] {
"", "ROCMA"
});
m_iPrecision = 2;
}
public void Paint(Graphics g, Rectangle rc, KLineData data[])
{
super.Paint(g, rc, data);
Calculate();
m_max = -10000F;
m_min = 10000F;
GetValueMaxMin(m_data[0], m_iParam[0] + 1);
DrawCoordinate(g, 2);
DrawLine(g, m_data[0], m_iParam[1] + 1, HQApplet.rhColor.clIndicator[0]);
DrawLine(g, m_data[1], m_iParam[0] + m_iParam[1], HQApplet.rhColor.clIndicator[1]);
}
public void Calculate()
{
m_data = new float[2][];
if(m_kData == null || m_kData.length <= 0)
return;
int n = m_iParam[0];
int m = m_iParam[1];
if(m_kData.length < n || n < 1)
return;
m_data[0] = new float[m_kData.length];
m_data[1] = new float[m_kData.length];
float roc[] = m_data[0];
roc[n - 1] = 0.0F;
for(int i = n; i < m_kData.length; i++)
if(m_kData[i - n].closePrice == 0.0F)
roc[i] = roc[i - 1];
else
roc[i] = (m_kData[i].closePrice / m_kData[i - n].closePrice - 1.0F) * 100F;
IndicatorBase.Average(1, m_kData.length, m, roc, m_data[1]);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -