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

Re: [amibroker] Slow FX Indice code: can this be improved?



PureBytes Links

Trading Reference Links

TJ

Thanks, good points.

Using Foreign does seem a bit faster.

I will look at how to combine this with ATC over the weekend.

ChrisB

Tomasz Janeczko <groups@xxxxxxxxxxxxx> wrote:
Instead of SetForeign use Foreign since you really need only CLOSE price (not OHLC).
Better yet - use AddToComposite to calculate composite once only.

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: kris45mar
Sent: Thursday, April 19, 2007 2:56 PM
Subject: [amibroker] Slow FX Indice code: can this be improved?

Hi Group

I run the MT3 plugin to get FX data in local database with local data storage enabled.

This code runs slowly on all time frames, slowing down AB.

Not being a programmer I wondered if there was a better way to code this to speed it up a bit.

Code is a proxy to see which currencies are currently strong or weak:

********
********

//FX indexes

// ozzie

SetForeign("AUDJPY"); AJ = C;
SetForeign("AUDUSD"); AU = C;
SetForeign("AUDCAD"); AC = C;

// EZ
SetForeign("EURUSD"); EU = C;
SetForeign("EURJPY"); EJ = C;
SetForeign("EURCAD"); ECA = C;
SetForeign("EURCHF"); ECH = C;
SetForeign("EURGBP"); EG = C;

// GBP
SetForeign("GBPUSD"); GU =C;
SetForeign("GBPJPY"); GJ = C;
SetForeign("GBPCHF"); GC =C;
SetForeign("EURGBP"); EG = C;

// YEN

SetForeign("USDJPY"); UJ = C;
SetForeign("EURJPY"); EJ =C;
SetForeign("CHFJPY"); CJ =C;
SetForeign("GBPJPY"); GJ = C;
SetForeign("AUDJPY"); AJ =C;

RestorePriceArrays();

Pound_Index = GU * GJ * GC * (1/EG);
OZZIE = AJ * AU * AC;
EZ_Index = EU* EJ * ECA * ECH * EG;
Yen_Index = -( UJ + EJ + CJ + AJ + GJ);

Plot(OZZIE, "Oz_Index", colorGreen, 1);
Plot( EZ_Index, "EZ_Index", colorBlue,1 | styleOwnScale);
Plot( Pound_Index,"GBP Index",colorBlack, 1 | styleOwnScale);
Plot( Yen_Index, "JPY Index", colorRed, 1 | styleOwnScale);


*********
*********


While this computes, AB is pretty much non responsive.

Any ideas?

ChrisB

Ahhh...imagining that irresistible "new car" smell?
Check out new cars at Yahoo! Autos.


Ahhh...imagining that irresistible "new car" smell?
Check out new cars at Yahoo! Autos. __._,_.___

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





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___