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 [email protected], kris45mar <[EMAIL PROTECTED]> 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. >
