♥ 0 |
Hi Pete, just wonder how to define a price for a previous date. Thanks!
Marked as spam
|
Private answer
Pete, I think I got it :-). Here’s it. Could you polish it a little bit :-)? I want a script for prices changes in May in the last 5 years. Thanks a lot! rec priceAtDate = if GetYYYYMMDD() == 20170103 then close else priceAtDate[1]; Marked as spam
|
|||||
Private answer
Marked as spam
|
|||||
Private answer
Thank you Pete! Yes it works perfectly on the chart. But the price on the quote still shows NaN :-). I need the price of 2017-01-03 shown on the quotes so I can use it for some scans. By the way can you write it further if I want the prices for May 1 from 2007 to 2017 (every year) :-)? Many thanks! Marked as spam
|
|||||
Private answer
Very simple. However it’s very important to keep in mind the date you input must be a day of open trade for the instrument being plotted. For example, your date of 20170101 returns N/A because markets were closed on that date. So I had to change the date to 20170103. Here is the code. Screenshot shows how this appears on the chart.
Marked as spam
|
|||||
Private answer
Not close[1] :-). I want a code for a specific date saying 20170101. Thanks! Marked as spam
|
Please log in to post questions.
The scan will only go back 2 calendar years. You cannot get the price for years 3-5.