Optuma Forums › Optuma Scripting › Bardate
Tagged: Bardate
- This topic has 2 replies, 2 voices, and was last updated 1 month ago by
James.
Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorPosts
-
April 8, 2022 at 2:02 am #67901
James
- Topics: 16
- Replies: 11
- Posts: 27
12345678910111213141516171819202122V1 = GETDATA(CODE=SPY:US);V2 = GETDATA(CODE=RSP:US);V3 = GETDATA(CODE=IJH:US);V4 = GETDATA(CODE=IJR:US);V5 = GETDATA(CODE=QQQ:US);V6 = MA(V1, STYLE=Exponential, CALC=Close, BARS=5) > MA(V1, BARS=200, STYLE=Exponential, CALC=Close);V7= MA(V2, STYLE=Exponential, CALC=Close, BARS=5) > MA(V2, BARS=200, STYLE=Exponential, CALC=Close);V8 = MA(V3, STYLE=Exponential, CALC=Close, BARS=5) > MA(V3, BARS=200, STYLE=Exponential, CALC=Close);V9 = MA(V4, STYLE=Exponential, CALC=Close, BARS=5) > MA(V4, BARS=200, STYLE=Exponential, CALC=Close);V10 = MA(V5, STYLE=Exponential, CALC=Close, BARS=5) > MA(V5, BARS=200, STYLE=Exponential, CALC=Close);V11 = (V6+V7+V8+V9+V10);V12 = V11 CrossesAbove 2;V13 = V11 CrossesBelow 3;V14 = V11 > 2;V15 = V11 < 3;IF(V14,BARDATE(V12),BARDATE(V13))It is picking up 1/21/22 for date of last change. What am I doing incorrectly in script? I want to pick up lastchange in a script in the header.Thanks, Jamie123April 8, 2022 at 8:12 am #67906Matthew
- Topics: 5
- Replies: 609
- Posts: 614
Hi,
When i open your workbook the chart header shows the date as March 21st, 2022.
When I check the chart that date seems correct (the date the rank last crossed above 2)…
This appears to match your script’s last line (If the rank is above 2 show the date the rank crossed above 2, otherwise show the last date the rank crossed below 3)
April 8, 2022 at 9:31 am #67909James
- Topics: 16
- Replies: 11
- Posts: 27
Hi Matthew, That is the script that is not giving the most recent 5D/200D cross?The data is thru 4/6/21 on the charts below on my computer. I did change the formula to 2.01 instead of 2 and 2.99 instead of 3 to get it to work.
1234567[crayon-62907bef18499309441825 ]V12 = V11 CrossesAbove 2.01;V13 = V11 CrossesBelow 2.99;V14 = V11 > 2;V15 = V11 < 3;IF(V14,BARDATE(V12),BARDATE(V13))thanks, Jamie
-
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.