TimeFrameGetPrice - usage

I am getting wrong values in exploration. It is getting Day Open Values instead of OI

PrevOI = TimeFrameGetPrice("OI", inDaily,-1);  // this also giving wrong values

Filter = 1;

AddColumn(OI,"Open Interest");
AddColumn(PrevOI,"Prev OI");

image

PrevOI = TimeFrameGetPrice("OI", inDaily,-1);
Filter = 1;

AddColumn(OI,"Open Interest");
AddColumn(PrevOI,"Prev OI");
AddColumn(Open,"Open");

image

Did you read the manual?
http://www.amibroker.com/f?timeframegetprice

It very clearly says this:

First parameter - pricefield - is one of the following: “O”, “H”, “L”, “C”, “V”,
“I” (open interest).

1 Like

@Tomasz. Sorry I missed it. Thank you very much. spent almost two hours. read that many times still missed it. I was under the impression that we can use regular names itself.

The same thing is for Foreign() and AddToComposite() functions. They all accept single-letter parameter describing the field and while OHLC are obvious, open interest field in those functions is "I".

1 Like