pradeep
pradeep

Reputation: 13

How to put end date in Amibroker column

I am running a simple exploration in Amibroker wherein I put a 21 day range in the date range window in Analysis window; like 01-01-2023 to 21-01-2023. I then run the exploration to find "Buy" stocks. In the afl I have this code to pull the closing price of 45 days after the end date of the range; (21 Jan + 45 days which is 6th March 2023) for each result row. I want this date "6th March 2023" in one of the columns. I am using this exploration on back dates to see how it performed after 45 days. Can anybody help?

ToDate = "21-01-2023";
x1=StrToDateTime( todate);
x2=DateTimeAdd(x1,45,inDaily);
x3=DateTimeToStr(x2);


Price= Lookup(C, (_DT(x3)), -1);

Upvotes: 0

Views: 243

Answers (1)

pradeep
pradeep

Reputation: 13

AddColumn( x2, "Date / Time", formatDateTime );

Upvotes: 0

Related Questions