The resource loading... loading...

Is there a problem with the accuracy of the ATR calculation in the inventor's quantified TA indicator database?

Author: Sadhu is down there., Created: 2023-02-28 16:22:30, Updated: 2023-02-28 16:28:27

def ma_case(self):
    exchange.SetContractType("swap")
    r = exchange.GetRecords(PERIOD_M1)
    ma = TA.MA(r, 20)
    Log(f'ma =>   {ma[-1]},  {ma[-2]}')
        
def atr_case(self):
    exchange.SetContractType("swap")
    r = exchange.GetRecords(PERIOD_M1)
    atr = TA.ATR(r, 14)
    Log(f'atr => {atr[-1]}, {atr[-2]}')

This is a list of all the different ways Atr => 12.161116665558945 is credited in the database. This is a list of all the different ways ma => 23246.1, 23244.699999999997 is credited in the database.

Binance data from the same time: ATR 14 => 17.78 MA 20 => 23247

You can see that the data for ma is more accurate, but why is the data for at so much worse?


More

Sadhu is down there.After several attempts, the data for ma has been fairly accurate, and atr is actually a bit worse.

Inventors quantify - small dreamsGenerally, it is necessary to first determine that the data of the K-line is completely consistent, then check whether the indicator parameters are consistent, and finally, if there are differences, check whether the indicator algorithm is consistent.