Gfx functions in a loop

I need to create a plot using gfx functions (gfxcircle()) inside a loop to plot fundumental data of a group if equities .. code below. It seems that gfx functions do not work inside a loop ???

Any alternatives?

for( i = 0; ( sym = StrExtract( GICS_TargetList, i ) ) != ""; i++ )
{
    SetForeign( sym );
    PEratio				= LastValue( Close / GetFnData( "EPS" ) ) ;
    RestorePriceArrays();
    //
    display_scale		= PEratio / Max_PE;
    x_pixel				= x1_start + ( x1_end - x1_start ) * 150;                       // x scale
    y_pixel				= y_start + ( Y_end - y_start ) * ( 1 - display_scale );   // y scale
    GfxCircle( x_pixel, y_pixel, 15 );
    GfxCircle(500,500,15);                                                                                      // test code
    GfxTextout("Test",600,600);                                                                              // test code
}

I'm sorry @ara1 but this is very far from being true :slight_smile: Gfx functions (if used properly) work equally well inside and outside of a loop.

1 Like

Of course they do work.


For example, at some cases one would need to initialize Gfx plot being dependent on price data of OHLC... array fields via Plot function.

Plot( C, "", colorDefault, styleNoDraw );
3 Likes