get data from a specific trading day in the past

#1
Hi,
I do a backtest so need some data in the past. Please kindly help me about the formula to get data from a specific trading day in the past (for example: get closing data in 05/30/2010)

Many many thanks
 

Romeo1998

Well-Known Member
#2
Hi,
I do a backtest so need some data in the past. Please kindly help me about the formula to get data from a specific trading day in the past (for example: get closing data in 05/30/2010)

Many many thanks
30th may,2010 was a sunday, so no data for it, can use date as string(a1) or number(a2), good luck :)
Code:
a1 = ValueWhen(DateTime()==StrToDateTime("2010-05-31"),c);
a2 = ValueWhen(DateNum()==1100531,C);
a3 = DateTimeFormat( "%A", StrToDateTime("2010-05-31") );

Title+="\n"+ LastValue(a1) + "\n"+ LastValue(a2) + "\n"+ a3;
 
Last edited:

Similar threads