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

[amibroker] Re: When AFL just stops updating the chart now and then...



PureBytes Links

Trading Reference Links

Hello Sidhartha,
My issue is that incoming quotes are normal (up to the second) until 
certain periods in the afternoon when they gradually start falling 
behind... by a few seconds every minute.  This is worst in the last 
half hour of trading when they go from normal to being behind by 5-9 
MINUTES by the last minute of the session.  It is not my internet 
connection (second computer on network gets up to the second quotes) 
and it is not my data vendor (if I quit AB and restart, the quotes 
are on time - or I can click the plugin icon and refresh symbol to 
get on time quotes for that one symbol but others stay behind and 
that one symbol will not continue to update unless I keep clicking 
the icon).  RequestTimedRefresh did not seem to help the problem, but 
last I tried it was 1-2 months ago.

I drifted off to speed of updating indicators for all symbols in the 
db because I was thinking maybe AB was being kept busy doing that and 
was falling behind when markets typically have increased numbers of 
trades therefore there could be increased recalulations going on.  My 
indicators include several loops (but total time for afl calcs on all 
open windows is only 0.4-0.5 sec).  At no time does AB itself seem to 
slow down - chart scrolling is brisk, changing symbols is fast [it is 
just using delayed quotes in all its displays - charts, realtime 
quote window, time&sales, AAexploration --at these times NOT during 
the rest of the day].  

As an initial theory one would suspect the data vendor or internet as 
the cause of the delay - BUT I think the first paragraph above 
debunks that theory.  I think the problem could be in the plugin [it 
is choking on the volume of incoming data] or problem transferring 
data to AB or some internal AB problem related to the high volume of 
trades during these times - but I really don't know nor do I have the 
expertise to evaluate this.  I can tell you task mngr sees no problem 
[cpu use 50%+/-, memory use 35% or so, I do wonder about the page 
faults up around 24 million by the end of market session].  Details 
of my setup are in my prior posts on this matter. 

Thanks for any ideas from you or anyone else,
Dan


--- In amibroker@xxxxxxxxxxxxxxx, "sidhartha70" <sidhartha70@xxx> 
wrote:
>
> Monitorit,
> 
> I still trying to work out exactly what your issue is...? Is it 
speed
> ultimately...? If so, I can tell you from my own experience 'symbol
> linking' degrades performance of AB very significantly. I had to 
turn
> symbol linking off...
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "monitorit" <monitorit@> wrote:
> >
> > Dennis,
> > Thanks.  I hope I've not set AB up wrong - don't think so. AB is 
in 1 
> > window.  The 5 symbol linked charts (each created from 
file>new>blank 
> > chart are all visible simultaneously) - each with a different 
time 
> > interval - the MDI option is off.  The charts are 1min, 2min, 
5min, 
> > 15min & daily.  If I run an explore in 5min periodicity, AB will 
run 
> > through 100 symbols in ~ 3 seconds total... usually generating 10-
30 
> > hits.  The output includes most of the indicators on the 5 min 
> > chart.  The chart itself takes 3-4 sec to draw when I move from 1 
sym 
> > to another.  So... all those 100 sym MUST have been calculated in 
the 
> > background because many/most of those symbols were not charted 
that 
> > day.  I keep hitting my head on this - how often are these 
symbols 
> > being recalculated... is it everytime a new price comes in?  is 
it 
> > controlled by the preference>intraday>chart refresh?  is it just 
when 
> > a new bar appears (ie, a bar is completed).  If it is the first 
> > choice, can you think of any code that would decrease the 
frequency 
> > or limit it to just when the bar is completed?
> > 
> > If I want to continue w AB in RT mode, I have to solve this 
problem.  
> > I will just run a single window of price/vol and just 1 short 
MovAvg 
> > for the coming week to see if my data problem goes away - or not.
> > 
> > BTW- for clarity my db is 7400 bars/symbol (740000 total bars=23 
Meg).
> > I have not used setbarsrequired as each chart calls for bar0---
last 
> > in 3 loops of the afl (& no arrays in loops).  When I change 
chart 
> > sym, the charts are finished drawing in 1-2 sec (it takes another 
2 
> > sec or so to finish writing some plottext statement - and that 
might 
> > be d/t my refresh rate).
> > 
> > Dan
> > 
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, Dennis Brown <see3d@> wrote:
> > >
> > > Dan, my comments are embedded:
> > > 
> > > On Jun 27, 2008, at 10:23 PM, monitorit wrote:
> > > 
> > > > Hi Dennis,
> > > > Perhaps you can help me - you'd be the first on this problem :
(
> > > > The problem I described is ~daily.
> > > 
> > > I will do my best..
> > > 
> > > > MY AB workspace displays the quotes window, 1-2 t&s windows + 
5
> > > > symbol-linked chart windows (1 min, 2 min, 5 min, 15 min and 
> > daily).
> > > > Each chart window has 8 sheets - but all these are empty 
except 
> > the
> > > > first sheet with 1-3 panes each and 1 window has a study on 
the
> > > > second sheet.  Total time (sum) for the 5 charts via 'display 
> > chart
> > > > timing' is ~400 msec. Running through these charts afterhours 
is 
> > no
> > > > problem (local db is enabled).. I see all charts windows 
> > completed in
> > > > about 4 seconds after changing symbols.
> > > 
> > > My charts are as simple as I can make them.  Just one Main 
chart 
> > which  
> > > run everything.  Can run as fast as 200ms to as slow as 10s 
> > depending  
> > > on the trading parameters I am using and the amount of history 
and  
> > > especially the number of bars I am displaying.  I might have 
> > another  
> > > simple chart running in another tab just to keep another 
symbol  
> > > database up to date.
> > > 
> > > > What do you think are the best settings for the pref>data
> > > > tab 'default db settings' in-memory  cache size (max 
symbols), 
> > (max
> > > > megabytes) and number of bars to load... for a 7400 bar, 100 
> > symbol
> > > > db (and perhaps for a longer db with more symbols).  What do 
these
> > > > fields actually mean/do?
> > > 
> > > Good questions, wish I knew all those answers.  My settings:
> > > 
> > > I only run about a dozen symbols.
> > > I keep 300,000 5 second bar database
> > > Cache max 82 MB.
> > > I load up to 100,000 bars, but only about 3,000 1 minule bars 
when  
> > > trading.
> > > 
> > > > I have 4GB (3 GB available in vista32) and
> > > > no other programs running... so is it best to use >1000 
megabytes?
> > > 
> > > I have a 2GB virtual XP32 running only AB.  I use all default 
> > settings.
> > > 
> > > > What is number of bars to load (does db setting overwrite 
this?)?
> > > 
> > > I override this in my AFL with SetBarsRequired()
> > > 
> > > > DB settings has a 'flush cache' button.  Doesn't seem to do 
> > anything
> > > > for me.  Does it work for you?
> > > 
> > > It would just reload it again if it were flushed.
> > > 
> > > > Refresh and refresh all has no
> > > > effect.  If I do a refresh current sym, I get new data for 
that 
> > sym
> > > > but then no further updates for any symbol.
> > > 
> > > Refresh just forces AFL to run one cycle on the chart.
> > > 
> > > I use RequestTimedRefresh() to make my chart refresh all the 
time 
> > even  
> > > if not quotes are coming in.
> > > 
> > > > My db is 7400 1min bars*100 sym... are you working with a 
similar
> > > > size?
> > > 
> > > Like I said, 300,000 5 second bars for just a few symbols.
> > > 
> > > > BTW, I know what you mean about getting hypnotized so I get 
> > alerted
> > > > to the quote delay with the following in the 1min chart - you 
can
> > > > probably get it to work with shorter periods or make it say 
> > something:
> > > >
> > > > delayedcolor=IIf(TimeNum()<Now(4)-120 OR DateNum()<Now
(3),32,16);
> > > > 	//for time at bar start-- 32=colorred, 
16=colorblack , red if
> > > > last bar start-time is earlier than 1min20 sec of system time
> > > > //my bar times are at start of interval so min# could be 101
> > > >
> > > > Plot( C, "Close", delayedcolor, styleNoTitle | ParamStyle
> > ("Style") |
> > > > GetPriceStyle() );
> > > 
> > > Assuming that it is not the AFL that is stalled, I could write  
> > > something that would monitor how long since the last quote came 
> > in.   
> > > However, in my case, I suspect that the AFL may not be running 
any  
> > > passes when my charts freeze.
> > > 
> > > OTOH, I could have another chart running in another tab which 
just  
> > > pings messages to the main chart through a static variable to 
make  
> > > sure it is alive, and alert me if it has stalled.  Thanks for 
> > jogging  
> > > that Idea.
> > > 
> > > Best regards,
> > > Dennis
> > > 
> > > 
> > > > Thanks, Dan
> > > >
> > > > --- In amibroker@xxxxxxxxxxxxxxx, Dennis Brown <see3d@> wrote:
> > > >>
> > > >> Hello,
> > > >>
> > > >> I have something that happens once every few days with my RT 
> > charts.
> > > >>
> > > >> At some point in the day, the chart stops updating.  I also 
have
> > > >> getRTData() functions in my AFL that also stop.
> > > >>
> > > >> I don't know if it is the data feed that stops handing the 
quotes
> > > > to
> > > >> AB, or if XP is not giving the data, or if the AFL loop stops
> > > >> running.  Everything looks normal, but I notice that my 
broker's
> > > >> charts have moved ahead and my AB charts have stalled (My 
> > broker's
> > > >> charts are prone to stalling in fast markets and my AB 
charts 
> > keep
> > > > on
> > > >> ticking).  This can be disconcerting when you are in a fast 
trade
> > > > and
> > > >> you go blind without realizing it.
> > > >>
> > > >> I am using DTN IQFeed, but the same thing happened with 
eSignal 
> > in
> > > >> previous years.  The data feed plug-in indicates everything 
is
> > > > green
> > > >> and working.
> > > >>
> > > >> Clicking on the chart refresh button starts the chart 
running 
> > again.
> > > >>
> > > >> I am usually in a panic when this happens, so I have not 
been 
> > able
> > > > to
> > > >> properly go through debug steps to isolate the problem area.
> > > >>
> > > >> So my questions are:
> > > >>
> > > >> 1.  Does anyone know the root cause of this?
> > > >> 2.  Is there a way to detect that the chart has stopped 
updating
> > > >> (other than by eye)?
> > > >> 3.  Is there a way to automatically jump start the updating 
again
> > > > when
> > > >> it happens?
> > > >>
> > > >> Thanks for any insights.
> > > >>
> > > >> If nobody can help, I will ask support.
> > > >>
> > > >> Best regards,
> > > >> Dennis
> > > >>
> > > >
> > > >
> > > >
> > > > ------------------------------------
> > > >
> > > > 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
> > > >
> > > >
> > > >
> > >
> >
>



------------------------------------

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/