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

Re: DLL Programming in PowerBasic - Simple Example Request - such as SMA



PureBytes Links

Trading Reference Links

Hi Saul!

On Sun, 07 Jul 2002, Saul wrote:

> Hi all,
> 
> I have spent a lot of frustrated time trying to get functions written in
> PowerBasic to work with Tradestation - the problem lies for me in
> passing price series to a function - I realise its done thru pointers
> etc - however I have become quite proficient at crashing tradestation
> and thought it was time to ask for some help.
> 
> I have gone thru the email archive and any other tradestation dll
> programming examples I could find on the net - still got problems.
> 
> The few examples I have found rely on two datastreams one which passes
> the price series to the dll stored in globals, with another function
> being called on a separate data series which passes back the complete
> calculated dataseries for plotting etc.
> 
> I would like some help with a function that is evaluated on a bar by
> basis such as EL does, whereby data is sent to function as required and
> evaluated to be returned. 
> 
> The type of prototype I would like to see is something such as a Simple
> Moving Average.
> 
> Whereby a price dataseries is passed bar by bar, with a length
> parameter, returning a single value for each bar.
> 
> 
> 
> Thanks in advance
> Saul
> 
> 

What I found for the vc dlls is that I don't need to pass pointers at
all, but rather pass the price as a float out of EL and into the
dll.

DefineDLLFunc: "c:\temp\some.dll", VOID, "MyFunc", INT, FLOAT;

MyFunc(1, close);

-----

int __stdcall MYFUNC(int i, float price)
{
}