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 [email protected], "sidhartha70" <sidharth...@...> 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 [email protected], "jooleanlogic" <juliangoodsell@> wrote:
> >
> > Thanks. Yes I'm aware of Market Delta and yes, c++ and gfx.
> >
>


Reply via email to