Hello, i have this formula in Excel:
=@TR("CHRH.CO,.OMXC25CAP,.OMXCCAPGI","GRAVG(TR.PriceClose,universe=""univ"",SDate=2018-08-17 EDate=2021-08-17 Frq=WD Curn=DKK);TR.PriceClose","SDate=2018-08-17 EDate=2021-08-17 Frq=WD CH=IN RH=calcdate SORTA=calcdate NULL=blank Curn=DKK",A1)
However, i cannot implement this in Python. See below what I have tried.
Trying with SDate and EDate inside GRAVG:
I thought I would just get it with get_data. If I have EDate and SDate inside the GRAVG:
get_data("CHRH.CO,.OMXC25CAP,.OMXCCAPGI","GRAVG(TR.PriceClose,universe=""univ"",""SDate=2018-08-17 EDate=2021-08-17 Frq=WD Curn=DKK"");TR.PriceClose", {"SDate": "2018-08-17", "EDate": "2021-08-17", "Frq": "WD", "RH": "calculate", "SORTA": "calculate", "NULL": "blank", "Curn": "DKK"}))
It provides the error in the message section:
"The 'EDATE' is unexpected in formula. A delimiter is probably missing before the lexeme."
Trying without SDate and EDate inside of GRAVG:
Below is an example of when I put it outside, but here I only get one entry for the value of the group average but all of the TR.PriceClose values:
get_data("CHRH.CO,.OMXC25CAP,.OMXCCAPGI","GRAVG(TR.PriceClose,universe=""univ"",""Curn=DKK"");TR.PriceClose", {"SDate": "2018-08-17", "EDate": "2021-08-17", "Frq": "WD", "RH": "calculate", "SORTA": "calculate", "NULL": "blank", "Curn": "DKK"})
I'm stuck on this issue and any help is greatly appreciated.