your code in post #1 is just awful.
It is much simpler.
You just have to loop visible chart area and compare peak and through with rsi variable. That's it.
So here is correction.
so it will look properly then.
It is much simpler.
You just have to loop visible chart area and compare peak and through with rsi variable. That's it.
So here is correction.
Code:
_section_begin( "rsi styleclipminmax" );
// modified by trash
version( 5.90 );
periods = param( "periods", 12, 1, 200, 1 );
maxclip = param( "maxclip", 80, 1, 100, 1 );
minclip = param( "minclip", 20, 1, 100, 1 );
r = rsia( c, periods );
graphxspace = 8;
setchartoptions( 1, chartshowdates, 0, 0, 0, 0 );
plot( r, "rsi",
paramcolor( "color", colorcycle ),
paramstyle( "style" ),
null, null, 0, 0, width = -20 );
//
plotohlc( r, r, 50, r, "",
iif( r > 50, colorred, colorbrightgreen ),
stylecloud | stylenolabel | styleclipminmax,
minclip, maxclip );
//
plotgrid( overbought = 80, colorred, 1, 2, true );
plotgrid( oversold = 20, colorgreen, 1, 2, true );
plotgrid( center = 50, colorblack, 3, 2, true );
_n( title = strformat( "{{name}} - {{interval}} - {{date}} {{values}}" ) );
_section_end();
_section_begin("show values at h&&l");
// by trash
version( 5.90 );
change = param( "%change", 5, 1, 100, 0.1 );
pk = peak( r, change, 1 );
th = trough( r, change, 1 );
offset = param( "y-offset", 10, 0, 50, 1 );
if ( paramtoggle( "display text", "off|on", 1 ) ) {
font = "arial";
fontsize = 8;
bi = barindex();
start = firstvisiblevalue( bi );
end = lastvisiblevalue( bi );
for ( i = start; i <= end; i++ ) {
if ( r[i] == pk[i] )
plottextsetfont( strformat( "%1.1f", pk[ i ] ),
font, fontsize,
i, pk[ i ],
colorgreen, colordefault, offset );
//
if ( r[i] == th[i] )
plottextsetfont( strformat( "%1.1f", th[ i ] ),
font, fontsize,
i, th[ i ],
colorred, colordefault, -(offset+fontsize) );
}
}
_section_end();
but i need (the close price no.) on pk. And th. Of rsi
if u can help me with it