Hi Graham ,
this is the problem ...
Restorepricearrays(1);
has to be used instead of just Restorepricearrays(), to match
setforeign("",1,1);
the funny thing is that I used correctly in some old code and now I
spent 2 days trying to figure out the mistake .. till i read the old code.
I ended up creating a static variable lot+"symbol" initialized 1 time
from the properties, but using the above (1) argument it would work
directly.
Thanks
Ly
--- In [email protected], Graham <[EMAIL PROTECTED]> wrote:
>
> Would it be easier to write these values to a text file, then look up
> the text file for what you want. (Eg Use notepad to store the
> roundlotsize) for use with foreign
>
> --
> Cheers
> Graham Kav
> AFL Writing Service
> http://www.aflwriting.com
>
>
> On 15/04/2008, loveyourenemynow <[EMAIL PROTECTED]> wrote:
> > The below code should print the lot size for obtained as property of
> > the stock object, and setforeign with the trade price option, but the
> > results are different, and LotF (the one obtained from setforeign) is
> > just equal to the current symbol lotsize.
> > Why?
> >
> > AB = CreateObject("Broker.Application");
> > sts = AB.Stocks();
> > Qty = sts.Count;
> > for( i = 0; i < Qty-1; i ++ )
> > {
> > st = sts.Item( i );
> > Ticker = st.Ticker;
> > Fil=1;
> > if (fil)
> > {
> > LotP=st.roundlotsize;
> > SetForeign(ticker,true,true);
> > LotF=RoundLotSize;
> > printf("\nTicker "+ticker+" LotF "+LotF+" LotP "+LotP+" C
> > "+LastValue(C)+" C "+LastValue(C));
> > RestorePriceArrays();
> > }
> >
> > }
> >
> > Thanks
> >
> > Ly
>