Hiii,
I'm trying to find cumulative open interest for previous day and add that in title. below is my code but somehow i'm getting COI of sameday.
Anyhelp will be highly appreciated.
_SECTION_BEGIN("COI");
Sym_F1 = Name();
Sym_F2 = StrReplace(Name(), "-I.NFO", "-II.NFO");
Sym_F3 = StrReplace(Name(), "-I.NFO", "-III.NFO");
SetForeign( Sym_F2 );
NR_O = O; NR_H = H; NR_L = L; NR_C = C; NR_OI = OI; NR_V = V;
RestorePriceArrays();
SetForeign( Sym_F3 );
FR_O = O; FR_H = H; FR_L = L; FR_C = C; FR_OI = OI; FR_V = V;
RestorePriceArrays();
COI = OI + NR_OI + FR_OI;
y_COI = TimeFrameGetPrice("C",inDaily,-1);
P_day = Ref(Day(),-1);
P_COI = ValueWhen(P_DAY,COI,1);