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

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



PureBytes Links

Trading Reference Links

Hi,
I ran your code as is, except for changing the symbol names to IB's
format. Then I enabled AB's timing analysis via:
Tools->Pref->Misc->DisplayChartTiming and yep its not the fastest bit
of code ;-} On my box it took almost 0.014 secs (14-MilliSecs) using a 
a worse case 1 minute time frame. Longer time frames improve matters.
So, it show that this bit of code is hardly an AB killer, in fact it
shows just how quick AB actually is. Now if only TJ would create an
AFL compiler. Anyway, if you enable your timer your probably see a
time similar to mine. So, may I suggest you look elsewhere for the
problem, perhaps the MT3 plugin or maybe you have a really slow
computer :-)

Also, thanks for the idea of using relative currency pair strength. 

Mac

--- In amibroker@xxxxxxxxxxxxxxx, kris45mar <kris45mar@xxx> wrote:
>
> 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 outnew 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
 
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/