PureBytes Links
Trading Reference Links
|
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 amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxx> 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 <loveyourenemynow@xxx> 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
>
------------------------------------
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:amibroker-digest@xxxxxxxxxxxxxxx
mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|