Plotting Weekly RSI on Daily Chart

I am plotting Weekly RSI on a Daily Chart using following code:

_SECTION_BEGIN("RSI");

Title = "";

TimeFrameSet( inWeekly );
RSI_weekly = RSI();
TimeFrameRestore();

SetGradientFill( ColorRGB(76, 175, 80), ColorRGB(255, 82, 82), 50, GetChartBkColor() );

Plot( TimeFrameExpand( RSI_weekly, inWeekly), "RSI", colorBlue, styleLine|styleGradient|styleClipMinMax,30,70 );
       
// Plot overbought, oversold and centerline levels
Plot( 50, "Centerline", colorLightGrey , styleDashed );
Plot( 70, "Overbought", colorGrey50 , styleDashed );
Plot( 30, "Oversold", colorGrey50 , styleDashed );

// Background fill with light blue color between 30 and 70 RSI levels (tradingview style)
PlotOHLC( 70, 30, 70, 30, "", ColorRGB(241,238,249),styleCloud );

_SECTION_END();

The code doesn't display the latest RSI value correct however. I attached two screenshots: First containing my Amibroker chart and the second is TradingView chart which is displaying proper value.

Moderator comment: No, TradingView displays MASSIVE FUTURE LEAK (weekly RSI is known on FRIDAY, not on Monday, because on Monday the week hasn't ended).


One can see that Amibroker chart is not updating the latest RSI value properly.

Moderator comment: AmiBroker displays PROPERLY, TV is not.

Did you read how parameter mode affects timeframeExpand ?

https://www.amibroker.com/guide/h_timeframe.html

Thanks, I had to use expandFirst mode which solved my problem. Sorry that I had overlooked that.

For what it is worth, AmiBroker is displaying it PROPERLY. But TradingView is NOT.

TradingView is really bad and not any kind of "reference".

The point is that weekly RSI is NOT known until Friday. What TV is displaying by default is MASSIVE FUTURE LEAK.

@patelgopesh be very careful with what you are using. Future leak is major problem and shows how incompetent people at TV are. When used in trading system, future leaks will produce great results in backtest that are completely FALSE and not reproducible in real trading.

1 Like

Thank you Tomasz for the explanation. I am no longer a paid subscriber of TradingView after actively using Amibroker. Just I am currently copying all my previous TV chart settings to Amibroker (also very visually aesthetic). Thanks for producing the great software !

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.