?? asi.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: ASI.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 ASI extends IndicatorBase
{
public ASI(IndicatorPos pos, int Precision)
{
super(pos, Precision);
m_strIndicatorName = "ASI";
m_strParamName = (new String[] {
""
});
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;
GetValueMaxMin(m_data[0], 1);
DrawCoordinate(g, 2);
DrawLine(g, m_data[0], 0, HQApplet.rhColor.clIndicator[0]);
}
public void Calculate()
{
m_data = new float[1][];
if(m_kData == null || m_kData.length <= 0)
return;
m_data[0] = new float[m_kData.length];
float asi[] = m_data[0];
asi[0] = 0.0F;
float si = 0.0F;
for(int i = 1; i < m_kData.length; i++)
{
float a = Math.abs(m_kData[i].highPrice - m_kData[i - 1].closePrice);
float b = Math.abs(m_kData[i].lowPrice - m_kData[i - 1].closePrice);
float c = Math.abs(m_kData[i].highPrice - m_kData[i - 1].lowPrice);
float d = Math.abs(m_kData[i - 1].closePrice - m_kData[i - 1].openPrice);
float e = m_kData[i].closePrice - m_kData[i - 1].closePrice;
float f = m_kData[i].closePrice - m_kData[i].openPrice;
float g = m_kData[i - 1].closePrice - m_kData[i - 1].openPrice;
float x = e + f / 2.0F + g;
float r = 0.0F;
if(a >= b && a >= c)
r = a + b / 2.0F + d / 4F;
if(b >= a && b >= c)
r = b + a / 2.0F + d / 4F;
if(c >= a && c >= b)
r = c + d / 4F;
float k = Math.max(a, b);
if(k != 0.0F)
si = (((50F * x) / r) * k) / 3F;
asi[i] = asi[i - 1] + si;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -