?? w_r.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: W_R.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 W_R extends IndicatorBase
{
private final int m_iParam[] = {
14, 6
};
public W_R(IndicatorPos pos, int Precision)
{
super(pos, Precision);
m_strIndicatorName = "W%R";
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[m_iParam.length];
for(int i = 0; i < m_iParam.length; i++)
m_strParamName[i] = "WR" + (i + 1);
m_iPrecision = 2;
}
public void Paint(Graphics g, Rectangle rc, KLineData data[])
{
super.Paint(g, rc, data);
Calculate();
m_max = -1E+038F;
m_min = 1E+038F;
for(int i = 0; i < m_iParam.length; i++)
GetValueMaxMin(m_data[i], m_iParam[i]);
DrawCoordinate(g, 2);
for(int i = 0; i < m_iParam.length; i++)
DrawLine(g, m_data[i], m_iParam[i], HQApplet.rhColor.clIndicator[i]);
}
public void Calculate()
{
m_data = new float[m_iParam.length][];
if(m_kData == null || m_kData.length <= 0)
return;
for(int i = 0; i < m_iParam.length; i++)
{
m_data[i] = new float[m_kData.length];
GetW_R(m_iParam[i], m_data[i]);
}
}
private void GetW_R(int n, float wms[])
{
if(n > m_kData.length || n < 1)
return;
for(int i = n - 1; i < m_kData.length; i++)
{
float maxhigh = m_kData[i].highPrice;
float minlow = m_kData[i].lowPrice;
for(int j = i - 1; j > i - n; j--)
{
maxhigh = Math.max(maxhigh, m_kData[j].highPrice);
minlow = Math.min(minlow, m_kData[j].lowPrice);
}
if(maxhigh - minlow == 0.0F)
{
if(i - 1 == 0)
wms[i] = -50F;
else
wms[i] = wms[i - 1];
} else
{
wms[i] = (-(maxhigh - m_kData[i].closePrice) / (maxhigh - minlow)) * 100F;
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -