Rank: Member
Groups: Registered Users, Subscribers Joined: 8/8/2016(UTC) Posts: 11
Was thanked: 3 time(s) in 3 post(s)
|
Hello,
It seems to be very Simple question!
What date function i can Get the date on the lowest close price within 360 day,
LLV(close,360)
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Hi
The question might be simple but the answer is not quite so simple. I've constructed an indicator that plots line values across an inner window. You'll probably need the Data Window open so as to read off Day/Month/Year results.
If you wish to adapt this code to an exploration it would work best if you assigned each of Day, Month and Year to a separate column for each rather than try to pack all elements of the date into one column result. Creating a single result column in the Explorer tool (DDMM.YYYY in column A for example) would most likely lead to fractional errors from time to time if you were to divide the year by 10,000 to get 0000.2015 (for example). Manipulating 2-digit whole numbers should not cause any problems, but reducing a 4-digit whole number to a 4-digit fraction probably will. Combining all 8 digits to form a whole-number-only date is also likely to cause problems. Hope this helps.
{Lowest C Date Range}
{Date of Lowest C within set Range}
Range:=Input("Date Range Bars",5,999,360);
LowC:=C=LastValue(LLV(C,Range));
D:=LastValue(ValueWhen(1,LowC,DayOfMonth()));
M:=LastValue(ValueWhen(1,LowC,Month()));
Y:=LastValue(ValueWhen(1,LowC,Year()));
D; M; Y;
Roy Edited by user Wednesday, September 7, 2016 12:01:52 AM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Member
Groups: Registered Users, Subscribers Joined: 8/8/2016(UTC) Posts: 11
Was thanked: 3 time(s) in 3 post(s)
|
Yes, I would like to explore the date of the Lowest stock price within 360 days.
I will also separate three columns day, month ,year respectively.
How i should write their codes?
THX
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Copy column code into a new exploration, set the number of bars to load at something higher than the range number, then load the required securities and you're home laughing (except for any obvious steps that I might have left out). I'm assuming you know how to create an exploration?
{col A: Day}
Range:=360;
LowC:=C=LastValue(LLV(C,Range));
LastValue(ValueWhen(1,LowC,DayOfMonth()));
{col B: Month}
Range:=360;
LowC:=C=LastValue(LLV(C,Range));
LastValue(ValueWhen(1,LowC,Month()));
{col C: Year}
Range:=360;
LowC:=C=LastValue(LLV(C,Range));
LastValue(ValueWhen(1,LowC,Year()));
Roy
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.