anandanand84 / technicalindicators

A javascript technical indicators written in typescript with pattern recognition right in the browser
MIT License
2.13k stars 550 forks source link

diffrence with tradingview and this RSI calculation #248

Open masoudnfd opened 2 years ago

masoudnfd commented 2 years ago

Hi I read https://github.com/anandanand84/technicalindicators/issues/216 but my problem was not solved .

closePrice = [ 46183.55, 46116.61, 46412.41, 45974.08, 46307.49, 45713.94, 45721.52, 46092.6, 45882.54, 45839.4, 46283.24, 46429.19, 46557.32, 46433.18, 46967.48, 46687.22, 46731.84, 46619.56, 46880.83, 46681.23, 47296.66, 46730.35, 46776.39, 46673.93, 47121.57, 47141.22, 47162.04, 47239.8, 47393.2, 47629.95, 47256.64, 47152.72, 47125.01, 47102.02, 47473.06, 47515.09, 47484.32, 47600, 47892.73, 47712.38, 47150.01, 46579.22, 46664.34, 46834.48, 46773.84, 46948.38, 46864.56, 46643.68, 46726.37, 46665.13, 46799.94, 46858.55, 47009.02, 46639.22, 47035.5, 47070.44, 47309.57, 46841.63, 46335.69, 46364.08, 46332.38, 46592.29, 46395.9, 46283.05, 45696.23, 45661.11, 46314.87, 46131.2, 46555.42, 46852.91, 46183.92, 46765.66, 46989.28, 46761.71, 47077.3, 46528.83, 45971.01, 46950.03, 47039.43, 47112.43, 46954.96, 47228.94, 47136.35, 47007.25, 47419.95, 47702.81, 47913.02, 47766.07, 47810.01, 47848.33, 47789.74, 47632.38, 47821.27, 48089.61, 47929.53, 47866.01, 47983.5, 48084.14, 48506.58, 48585.81 ]

rsiCalcualte = [ 60.2, 55.72, 56.28, 54.42, 57.9, 54.48, 61.95, 53.28, 53.85, 52.33, 57.91, 58.14, 58.4, 59.42, 61.43, 64.36, 57.01, 55.12, 54.6, 54.14, 59.95, 60.56, 59.84, 61.68, 65.94, 61.41, 49.92, 41.44, 42.99, 46.08, 45.14, 48.39, 46.95, 43.3, 45.02, 43.96, 46.94, 48.23, 51.49, 44.13, 52.04, 52.67, 56.89, 47.9, 40.46, 41.01, 40.56, 45.85, 42.75, 41.04, 33.51, 33.12, 45.81, 43.32, 50.07, 54.18, 45.17, 52.56, 55.07, 52.05, 55.68, 48.77, 42.94, 53.46, 54.29, 54.99, 53.09, 55.95, 54.73, 53.01, 57.61, 60.46, 62.48, 60.17, 60.64, 61.07, 59.99, 57.06, 59.61, 62.97, 59.77, 58.5, 60.19, 61.62, 67, 67.91, 66.68, 71.91, 64.55, 69.96, 68.65, 64.36, 60.6, 59.52, 62.03, 54.44, 57.79, 58.87, 61.52, 61.77 ],

but TradingView and MetaTrader data is = [46.16 , 45.23 , 49.18 , 42.25 , 46.75 , ....]

How can I get results equivalent to TradingView or MetaTrader?

rishikesh2003 commented 2 years ago

Have you checked that you are using the same periods?

masoudnfd commented 2 years ago

yes the RSI formula is wrong in this package

rishikesh2003 commented 2 years ago

Can you share your code?

denernun commented 2 years ago

Sorry for my english.

try to use an array with 90 elements for calculation. In my case, the RSI of 14 periods is exactly the same as the trading view. I tried using trading-signals lib, but they are very, very, very slow, but the result is the same.

On Sun, Dec 26, 2021 at 8:33 AM Rishikesh S @.***> wrote:

Can you share your code?

— Reply to this email directly, view it on GitHub https://github.com/anandanand84/technicalindicators/issues/248#issuecomment-1001160656, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA3Q3NBUXBEVSYSDGRYJZ6TUS34O3ANCNFSM5KOKW2GQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ikulichkov commented 2 years ago

RSI calculate true, im using this packages without errors