Do you have this rrg.afl? thank you

I'm only responding because you uploaded one of my posts....

That one of the picture you posted was just a quick basic plot test.

It looks different now (similar to stockcharts one).

And both of those examples are on my HDD only.

The indicators of x,y axis are not the same ones as the ones at Stockcharts as those ones are proprietary. But many indicators are similar and being calculated on price data. There is no magic voodoo indicator.

thank you for your response. yes i know there is no holy grail or voodoo magic in financial marketâŚ

but can you share this afl @fxshrat ?

@adiwijaya - Fxshrat has been sharing his vast knowledge of AFL programming for years on many different forums - including yahoo mailing list and this great forum. Lots of users have had a chance to learn a lot from him (including me) - I really appreciate that.

Donât you think that expecting from Fxshrat, that he will be giving away all of his advanced and proprietary codes to anybody is little too much? Especially taking into account, that your only effort was uploading a screenshot from another forum (which was by the way brought to life thanks to Fxshratâs efforts). On this screenshot anybody can clearly see, that Fxshrat is the author of that post (and the AFL code), but you didnât find it appropriate to ask @fxshrat directly, instead you asked who knows whom - I quote: " *Do you have this rrg.afl?* " **In this way you have disrespected the author.**

Creating your post took you < 1m and in exchange you expect (1) AFL which is the result of putting a lot of effort into coding it and ideally (2) detailed guidance how to set up and use this AFLâŚ

Instead you should take advantage of **AmiBroker documentation** and this great forum - which is growing fast - and where shortly every user will be able to find answers to almost any question related to AB. Do your best to be able to create similar codes in the future on your ownâŚ

Am with @Milosz hereâŚ

Now that most registered amibroker users have stopped *âfeedingâ* the â*freeloaders*â in sundry forums in order to *gently persuade* the notion of being a registered user for expectation of support, this place has increasingly become the next recourse for these *free riders* (Tomaszâs words), of late, to pop up and kinda *demand* answers without much (if any, at all) inclination to learn or to even read the reference manual!

Most such find even perusing Forum Guidelines/ Post formatting as well as âSearchâ to be too much of a bother!

Itâd be best to ignore such *âqueriesâ* IMO

@fxshrat Can you help me to plot the chart?

I tried a lot but didn't find the exact formula to calculate values.

If possible do help me on formula part.

As fxshrat noted in a previous post, the RRG formula is proprietary, so copyright and trademark restrictions would limit discussion of any attempts trying to decipher the formula. It is suggested you try to develop your own approach.

I would note that de Kempenaer had an extended discussion of his thought process in developing RRG in chapter 2 of the book "New Frontiers in Technical Analysis" which may provide some insight.

@tip001 Thank you for suggesting book which describe brief for the graph.

But my question is still on as I am not able to get the data which I was searching.

Once again Thank You for your kind suggestion.

If possible do suggest some other stuff related to this so that I can develop this one further.

I doubt anyone in this forum is going to supply the underlying formula. I know I cannot, since I donât know it. That is, you will have to develop your own methodology.

That said, I would encourage you to keep trying. I know it may be frustrating but you can learn a great deal from the exercise. People like fxshrat are experienced developers, I am not and was able to find my own solution.

I donât know your experience level, but there is underlying complexity to this particular task. For the inexperienced programmer such as myself, it took me a number of months.

This was my first attempt using the gfx tools in Amibroker so I began by finding examples of gfx plotting in the forum. I then tried adding the colored backgrounds, which took me a while to get to act properly. As for the formula, you need to think a great deal about the scaling of any result on both the x and y axes. This is not trivial but is where I found my solution.

This is not an easy task so I would say good luck.

For what it is worth, mathematical formula is NOT patent-able therefore indicator in the meaning of mathematical expression can't be "proprietary". Anyone is free to implement ANY mathematical formula in ANY language of their choice.

The program or formula (specific written expression of algorithm in given programming language) itself is a subject of copyright, but underlying mathematical formula isn't.

For this reason, anyone is free to write original formula by him/herself to implement anything using mathematical expressions in given programming language.

@DeAmit, Welcome to the forum.

You really need to get your "Verified Badge". That shows that you have purchased AmiBroker. Just search for "Verified Badge" and follow the instructions. Only Verified owners are supposed to post questions in the forum.

Also, search for "How to use this site". It will cover many additional aspects of how to get helpful responses to your query. Things like Posting your code (using Code Blocks </>).

When starting out with AmiBroker AFL, it can take a while to get a handle on the programming using Arrays. If you are not a programmer it can take even longer. Once you do "get it", it is extremely powerful.

So, Get Verified and then Post your Code. Then you should get more activity on your question.

Can you please post your script?

@ danielkhanhnguyen

Can you share about your experiences and results?

Thanks advance!

CaĚm ĆĄn baĚc trĆ°ĆĄĚc

Please share your experiences and results of the RRG.

Hi @amisur, @TraderLang

The first, you need understand about 'normal distribution', refer on wiki at Normal distribution - Wikipedia

The second, read carefully about RRG Charts in order to gain knowledge about calculate: RS Ratio and RS Momentum at link Relative Rotation Graphs (RRG Charts) [ChartSchool]

Moreover, using the gfx* functions on Amibroker, other functions: CategoryGetSymbols, AddToComposite

hi, may i ask how to make the center point of the rrgd chart dynamic ?

Discovered online version at some website, got AFL to finally work. I then added some GFX text and parameters for adjusting watchlist and time periods. Everything is good for a couple days and then it does not work/display. Appears to have ticker symbols stacking members of watchlist at the upper left part of the chart. Maybe it still work but is printing 3 letter symbols in an approximate pixel area of 15 x 30 pixels. Not sure if I should post AFL code since others are not, suggestions for assitance?

RS11= Param("period 1 short", 8,2,50,1);

RS22= Param("period 2 long",21,3,180,1);

tbar = Param( "Trailing Bar", 5, 1, 100, 1 );

_N( base = ParamStr( "Base Symbol", "SPY" ) );

_SECTION_BEGIN("Watch List");

//////////////////////////////////////////////

// Params -

// first is Select Watch List

// House keeping first

// Build String containing

// Watchlist Names

///////////////////////////////////////////////

String = "" ;

x = 0; //count WatchList

//pRemoveListNames = ParamToggle("Remove List xx - WL Names","No|Yes",0);

do{

WList = CategoryGetName( categoryWatchlist, x );

if (WList != "" ){

// if (!((pRemoveListNames) & (StrFind(WList,"List")==1))){

String = String + WList +",";

// }

}

x++;

} while(WList !="");

_N(pWatchList = ParamList ( "Watch List", String ));

_SECTION_END();

_SECTION_BEGIN( "RRG rev 4" );

color1 = ParamColor("Symbol 1:", colorRed);

color2 = ParamColor("Symbol 2:", colorOrange);

color3 = ParamColor("Symbol 3:", colorBrightGreen);

color4 = ParamColor("Symbol 4:", colorDarkGreen);

color5 = ParamColor("Symbol 5:", colorBlue);

color6 = ParamColor("Symbol 6:", colorCustom10);

color7 = ParamColor("Symbol 7:", colorPlum);

color8 = ParamColor("Symbol 8:", colorBrown);

color9 = ParamColor("Symbol 9:", colorViolet);

color10 = ParamColor("Symbol 10:", colorCustom12);

color11 = ParamColor("Symbol 11:", colorPink);

color12 = ParamColor("Symbol 12:", colorIndigo);

color13 = ParamColor("Symbol 13:", colorDarkGrey);

color14 = ParamColor("Symbol 14:", colorTeal);

color15 = ParamColor("Symbol 15:", colorTan);

color16 = ParamColor("Symbol 16:", colorCustom16);

color17 = ParamColor("Symbol 17:", colorBrightGreen);

color18 = ParamColor("Symbol 18:", colorDarkBlue);

color19 = ParamColor("Symbol 19:", colorDarkOliveGreen);

color20 = ParamColor("Symbol 20:", colorYellow);

list = Name()+","+pWatchList;

EnableTextOutput( False );

GfxSetOverlayMode( 2 );

pxl = Status( "pxchartleft" );

pxr = Status( "pxchartright" );

pxt = Status( "pxcharttop" );

pxb = Status( "pxchartbottom" );

pxw = ( pxr - pxl ) / 2;

pxh = ( pxb - pxt ) / 2;

xm = pxl + pxw;

ym = pxt + pxh;

GfxMoveTo( pxl, ym );

GfxLineTo( pxr, ym );

GfxMoveTo( xm, pxt );

GfxLineTo( xm, pxb );

GfxSelectSolidBrush(ColorRGB(102,255,102));

GfxRectangle( xm, ym, pxr, pxt );

GfxSelectSolidBrush(ColorRGB(255,101,102));

GfxRectangle( xm, ym, pxl, pxb );

GfxSelectSolidBrush(ColorRGB(255,255,204));

GfxRectangle( xm, ym, pxr, pxb );

GfxSelectSolidBrush(ColorRGB(135,206,235));

GfxRectangle( xm, ym, pxl, pxt );

/////// Hash Marks Horizontal and then Vertical

GfxSelectPen(colorBlack,1);

hashHzCount = 34;

widthHzHash = pxw/17;

for(j=0; (j <hashHzCount);j++)

{

GfxMoveTo(pxl+(widthHzHash*j), pxh-5);
GfxLineTo(pxl+(widthHzHash*j), pxh+15);

}

hashVCount = 22;

widthVHash = pxh/11;

for(k=0; (k <hashVCount);k++)

{

GfxMoveTo(pxw-5, pxt + widthVHash*k);
GfxLineTo(pxw +15, pxt + widthVHash*k);

}

/////////////////////////////////////////////////////////////

GfxSelectFont("Arial", Status("pxheight")/60 );

GfxSetTextColor( ParamColor( "Text Color", colorBlack ) );

GfxSetBkMode(0); // transparent

//GfxTextOut("O B" ,pxw-12,pxt+55);

//GfxTextOut("O S" ,pxw-12,pxb-55);

// On screen descriptions

//GfxTextOut("Periods selected ='s "+tbar +" for "+pWatchlist +" WL vs " + base ,pxl+850,pxb-65);

//GfxTextOut( "Hz hash ='s price/base ratio" + " Vertical hash ='s 1pd /9pd momo of $ ratio",pxl+850,pxb-25);

//////////////////

GfxSetBkColor(colorPaleGreen);

GfxTextOut( "LEADER", pxr-120 , pxt +50 ); // Leading

GfxSetBkColor(colorPink);

GfxTextOut( "DOG", pxl+15, pxb-55 ); // Lagging

GfxSetBkColor(colorLightYellow);

GfxTextOut( "FADING ", pxr-100, pxb-65); // Weakening

GfxSetBkColor(colorLightBlue);

GfxTextOut( "Improving", pxl+15, pxt+60 ); // Improving

GfxSelectFont("", Status("pxheight")/90 );

//create data for arrays

function getrs ( sc, t )

{

bc = Foreign( base, "C" );

sbr = sc / bc;

```
rs1 = EMA( sbr, RS11 );
rs2 = EMA( sbr, RS22 );
rs = 100 * ( ( rs1 - rs2 ) / rs2 + 1 );
rm1 = MA( rs, 1 );
rm2 = MA( rs, 9 );
rm = 100 * ( ( rm1 - rm2 ) / rm2 + 1 );
return IIf( t, rs , rm ) - 100;
```

}

// drawing function for arrays

function drawpos ( x, y, sym, text )

{

rsl = VarGet( "rsl" );

rsh = VarGet( "rsh" );

rml = VarGet( "rml" );

rmh = VarGet( "rmh" );

```
xx = pxl + pxw + x * ( pxw / ( Max( rsh, -rsl ) * 1.10 ) );
yy = pxb - pxh - y * ( pxh / ( Max( rmh, -rml ) * 1.10 ) );
xp = Nz( VarGet( "xp" + sym ), xx );
yp = Nz( VarGet( "yp" + sym ), yy );
VarSet( "xp" + sym, xx );
VarSet( "yp" + sym, yy );
GfxMoveTo( xp, yp );
GfxLineTo( xx, yy );
GfxCircle( xx, yy, IIf( text == "", 2, 4 ) );
if ( text != "" ) GfxTextOut( sym, xx + 6 , yy - 3 );
```

}

// get UnSorted Watch list

_N(UnSortlist = CategoryGetSymbols( categoryWatchlist, CategoryFind(pWatchList, categoryWatchlist )));

//establish "tbar param" arrays of RS and RM

for ( i = 0; ( sym = StrExtract( UnSortlist, i ) ) != ""; i++ )

{

SetForeign( sym );

```
rs = getrs( C, 1 );
rm = getrs( C, 0 );
for ( ii = BarCount - tbar; ii < BarCount; ii++ )
{
rs_ = rs[ ii ];
rm_ = rm[ ii ];
rsh = Nz( VarGet( "rsh" ), rs_ );
if ( rs_ >= rsh )
VarSet( "rsh", rs_ );
rsl = Nz( VarGet( "rsl" ), rs_ );
if ( rs_ <= rsl )
VarSet( "rsl", rs_ );
rmh = Nz( VarGet( "rmh" ), rm_ );
if ( rm_ >= rmh )
VarSet( "rmh", rm_ );
rml = Nz( VarGet( "rml" ), rm_ );
if ( rm_ <= rml )
VarSet( "rml", rm_ );
}
RestorePriceArrays( True );
```

}

for ( i = 0; ( sym = StrExtract( UnSortlist, i ) ) != ""; i++ )

{

SetForeign( sym );

```
rs = getrs( C, 1 );
rm = getrs( C, 0 );
```

// make a new color for each symbol iterated

GfxSelectPen(color1+i,1,1);

GfxSelectSolidBrush(color1+i);

////////////////////////////////////

// Drawing function employed with arrays

```
for ( ii = BarCount - tbar; ii < BarCount; ii++ )
{
drawpos( rs[ ii ], rm[ ii ], sym, WriteIf( ii == BarCount - 1, sym, "" ) );
}
RestorePriceArrays( True );
```

}

_SECTION_END();