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

[amibroker] Re: barcount



PureBytes Links

Trading Reference Links

It took a while Sidharta.:)

Depends how fast you mean by realtime? The chart in the picture takes around 70ms on my p4 3.2ghz.
The only real bottleneck is the GDI drawing so performance is almost entirely dependent on how much is being rendered. 
If you turn "Display chart timing on" in Preferences->Miscellaneous, the following code should give you an idea of the cost of rendering. You'll see it's highly variable.


GfxSelectFont("", 8, 400);
GfxSetBkMode(1);

rows = Param("Rows", 50, 0, 500);
Cols = Param("Cols", 50, 0, 500);
showText = ParamToggle("Show Text", "No|Yes");
fastText = ParamToggle("Fast Text", "No|Yes");
switchColors = ParamToggle("Switch Colors", "No|Yes");
bswitch = True;

cellHeight = Status("pxchartheight") / rows;
cellWidth = Status("pxchartwidth") / Cols;

for (row=0; row<rows; row++){
	y = row * cellHeight;
	for (Col=0; Col<Cols; Col++){
		x = Col*CellWidth;
	
		if (switchColors){
			bswitch = !bswitch;
			if (bswitch)
				GfxSelectSolidBrush(colorLightBlue);
			else
				GfxSelectSolidBrush(colorLightOrange);
		}

		GfxRectangle(x, y, x+CellWidth, y+CellHeight);
		if (showText){
			if (fastText)
				GfxTextOut("blah", x, y);
			else
				GfxDrawText("blah", x, y, x+CellWidth, y+CellHeight);
		}
	}
}




--- In amibroker@xxxxxxxxxxxxxxx, "sidhartha70" <sidhartha70@xxx> wrote:
>
> Jules, out of interest 2 questions if I can...
> 
> 1. How long did it take you to write...?
> 2. Does it run fast enough to be fully operational in real time trading...?
> 
> Thanks
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "jooleanlogic" <juliangoodsell@> wrote:
> >
> > Thanks. Yes I'm aware of Market Delta and yes, c++ and gfx.
> >
>




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

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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/