[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

More complex task for BASIC DLL



PureBytes Links

Trading Reference Links


Regarding my previous PowerBasic DLL code messages.  My next project is to
design a DLL with a bunch of 13000 bar arrays.  an EOD closing price series
will be loaded to one of those DLL arrays while EL is stepping forward bar
by bar.  At the same time, a standard exponential MA will be calculated and
result will be put in another DLL array.  At last bar (LastBarOnChart), the
DLL will calculate still another exponential MA from the DLL's price array,
but in the opposite direction (from last to first bar).  The two MA arrays
will be added to produce a zero time lag MA.

But, this MA is not available until EL has already stepped through all its
bars.  How do I get EL to automatically read in and plot this MA at the
last bar on chart?  I asked this question a few months ago and got only one
answer which was to click on Format Analysis, click Status off then on
again and click back to the chart.  This should force EL to re-scan bar by
bar and read in the DLL MA array.  Of coarse the DLL would set a switch on
the very first pass that would freeze the MA array for any future passes.

Is there a better, more automatic way to make EL re-read and plot
calculated data when it reaches the last bar?

OR, is the following worth pursuing?  TS_KIT.DLL has function
FindAddress_Close.  Omega doc for the DLL says that the .H and .LIB files
are to be linked with my DLL - Perhaps for C but not with BASIC, but my
BASIC DLL can call a function that is in another DLL.  TS_KIT.DLL is very
poorly documented so I will guess at what it can do.  I am probably dead
wrong so please correct me.

Is IpClose the TS data series, like 1 for DATA1, 2 for DATA2, etc?

Maybe I could call my DLL function when CurrentBar = 1, and it would loop
forward through the data series via FindAddress_Close in TS_KIT.DLL, to the
most current data date while loading my DLL's price array?  My DLL could
then calculate the reverse direction exponential MA while CurrentBar was
still 1.  That is, if FindAddress_Close can look forward in the price
series before that series has been loaded to the chart.

Lastly, as nOfs is decremented (minus # is looking forward in date), how do
we know when out of range (going beyond the most recent date in the
series)?  Does the data go to 0, go negative, etc.?