⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basicstockchartingv1-0_bugfixes_9-3-02.txt

📁 这是个VB写的股票分析软件,含有部分指标及画线工具
💻 TXT
字号:
Basic Stock Charting V1.0 Bug Fixes as of 09-03-2002.
These are the only ones found so far.... might be a few more...

*********************************************************
	Indicator draw bug when plotting histogram. 

Indicator data for the most current bar was not being drawn when histogram is specified.

Module: MIndicators   
Function: PlotIndicator

Find the "'plot data" section.
Original Line#: 268

In the Do Loop, this If-Then is the problem:

	If X2 <> 0 Then
             If iPlotColors(i, 1) = 0 Then 'line plot
                  frmMain.ChartBox.Line (X2, Y2)-(x, Y1), iPlotColors(i, 0)
             ElseIf iPlotColors(i, 1) = 1 Then 'histogram
                  frmMain.ChartBox.Line (x, iZeroPosition)-(x, Y1), iPlotColors(i, 0)
             End If
        End If

X2 is 0 only on the right most bar. A line plot starts on the next bar when X2= prev X
so the histogram plot needs to moved out of the If-Then, re-arranging code so we
test for plot type first, then test X2 only when a line plot:

	If iPlotColors(i, 1) = 0 Then 'line plot
             If X2 <> 0 Then frmMain.ChartBox.Line (X2, Y2)-(x, Y1), iPlotColors(i, 0)
        ElseIf iPlotColors(i, 1) = 1 Then 'histogram
             frmMain.ChartBox.Line (x, iZeroPosition)-(x, Y1), iPlotColors(i, 0)
        End If

*********************************************************
	No plot the first time the program is run.

This was reported via comment. I was able to reproduce it by deleting the INI file
and then starting program. When the "Open Data File" dialogbox pops, hit cancel. 
Now if we go to the toolbar and open a file, nothing will plot. Repeated attempts
result in no plotting. A program restart will then plot the data. If a file is 
picked at the first start-up the problem is avoided.

In the form_load sub a flag, "fGotData" is set to true if the "LoadData" function
returns true. The "LoadData" function checks for the existance of the data file.
On first run the data file is nothing. The flag never gets set, the ChartBoxDraw sub
checks that flag, hence it will never plot. The OpenFile menu calls a sub which didn't
set the flag....

Module: frmMain
Function: GetDataFile

Original Code:

    Private Sub GetDataFile()
    	Static fIn As Boolean
    	If fIn Then Exit Sub  'stop DblClk on the toolbar from bring up the open dlg twice
    	fIn = True
    	sSymbol$ = sEmpty
    	If Not OpenDataFile Then fIn = False: Exit Sub
    	Call LoadData 
    	Call SetMargins
    	Call ChartBoxDraw
    	fKillSplash = True  'flag to unload splash/progress
    	fIn = False  'ok to run again
    End Sub

"fGotData" flag never gets set after loading data nor do we check for a return
of true from the function so we change to this:

    Private Sub GetDataFile()
    	Static fIn As Boolean
    	If fIn Then Exit Sub  'stop DblClk on the toolbar from bring up the open dlg twice
    	fIn = True
    	sSymbol$ = sEmpty
    	If Not OpenDataFile Then fIn = False: Exit Sub
	fGotData = False
    	If LoadData Then
            fGotData = True
            Call SetMargins
            Call ChartBoxDraw
    	Else
	    MsgBox "Error loading data file", vbCritical + vbOKOnly, "Data Load Error"
        End If
    	fKillSplash = True  'flag to unload splash/progress
    	fIn = False  'ok to run again
    End Sub

All better <S>...

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -