PureBytes Links
Trading Reference Links
|
DC,
I use PB with TS2ki. C is another language to write Dlls in but you
cannot use VB because of the activex stuff in its dlls.
Unless you have alot of programming experience and know the windows API,
i strongly suggest a friendly language like PB. It has all the power and
speed of C and none of the bloat of VB. I write Dlls for TS2k with it
(and stand alone apps) for clients and friends and to trade. Dlla speed
up indicators, do complicated file work, create windows with
information, get data from other apps etc etc. It is fast and easy.
Omega has provided a Dll called ELKIT32.dll that allows you acess to the
data array in TS2ki (the Date Time OHLC for the chart). You have to
access this from a (PB) Dll. It took me a while to figure out how, but I
can now access the values for any bar on the chart, at any stage of the
indicators calculation (it steps through the bars one at a time)
Here is a simple PB Dll example (no EL32KIT stuff):
'**********************************************************************************************************
'Description : Generic DLL Called By tradeStation
'Written By : Mike (c) Copyright 2001
'**********************************************************************************************************
#COMPILE DLL "Test.dll" ' Compile DLL to Omega Program folder
#INCLUDE "WIN32API.INC" ' Windows API definitions (needed for
LibMain etc)
'**********************************************************************************************************
FUNCTION LibMain(BYVAL hInstance AS LONG, _
BYVAL fwdReason AS LONG, _
BYVAL lpvReserved AS LONG) EXPORT AS LONG
SELECT CASE fwdReason
CASE %DLL_PROCESS_ATTACH ' TradeStation loads a Study
LibMain = 1 ' Tell TS DLL Attached successfully
END SELECT
END FUNCTION
'**********************************************************************************************************
FUNCTION MyFunc ALIAS "MyFunc" (BYVAL ELCurrentBar AS SINGLE,_ '
Float from EL
ELStrPtr AS ASCIIZ PTR _ '
Pointer to an ASCIIZ string
) EXPORT AS SINGLE '
Return a float
IF ELCurrentBar = 1 THEN MSGBOX "Bar "+STR$(ELCurrentBar)+"
"+@xxxxxxxx ' bar 1, Display the string
FUNCTION = 1 ' return a value to EL
END FUNCTION
'**********************************************************************************************************
{ Defined in Easy Language with:}
Vars: MyString("Testing a String of characters");
DefineDLLFunc: "Test.DLL", Float, "MyFunc", Float, lpStr;
{Define Dll}
Value1 = MyFunc(CurrentBar, MyString); {Call DLL FUNCTION MyFunc}
Not too tough right?
Regards
Mike
|