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

Re: elkit.dll and Powerbasic



PureBytes Links

Trading Reference Links

Mike,

thanks for information; based on your feedback I will by
PB/DLL V6.0 (32-bit). I agree with your reasons for PB,
and proof that it can be used for TS2ki.

I have several other questions that might be of interest to
omega-list. First some facts:

In TS 4.0, I have about 10 workspaces, each having about
10 charts. Each Chart have a system using one DLL built with
MS VC V1.52. When I select "execute workspaces from previous
session", about 100 charts are automatically executed, one after
another, in a precise order.

A dedicated array in DLL is accumulating a summary report for
100 chart portfolio, each chart adds on piece of information.
The same DLL  with the same dedicated array stays open during
the whole 100 charts execution.

Questions;

1. Can I expect the same behavior in PB/DLL?

2. Can I control when DLL (and associated array) is opened
   and when is closed? For example, open access to DLL array
   when "AD" chart is executed and close the array when
   last currency chart "SF" is completed?

Different topic but still about DLLs:

3. I am dreaming about loading all my parameters for
   TS2ki trading from an external file. Have you figure out
   how to do it in PB/DLL?

Thanks again for your help.

DC

----- Original Message -----
From: Mike <pooltreatments@xxxxxxxxxxxx>
To: <omega-list@xxxxxxxxxx>
Sent: Tuesday, June 26, 2001 12:54 PM
Subject: RE: elkit.dll and Powerbasic


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