Optuma Forums › Optuma General Discussion › Twitter Charts 2
- This topic has 31 replies, 5 voices, and was last updated 4 months ago by
Darren.
-
AuthorPosts
-
December 16, 2021 at 7:34 pm #66955
Darren
- Topics: 73
- Replies: 923
- Posts: 996
Following on from this thread here are details for charts posted on our Twitter account. Comment in the Tweet and we’ll post the details here.
For example, to calculate the average drawdown for the members of an index, as per this Tweet: https://twitter.com/Optuma/status/1471137257969135621?s=20
This was calculated using the Drawdown Percent function DDP() in the custom Market Breadth module, with the Breadth Action set to Average.
By default, the DDP() function will calculate distance from the 1 year high.
Once calculated, the data can be viewed in the Breadth Data tool below the price chart:
2 users thanked author for this post.
December 17, 2021 at 2:54 am #66957Deepak
- Topics: 91
- Replies: 76
- Posts: 167
Hii Sir,
It seems ismember is not working on this any reason.
Regards,
DeepakDecember 17, 2021 at 6:34 pm #66961Darren
- Topics: 73
- Replies: 923
- Posts: 996
Hi Deepak,
The ISMEMBER() function only works with true/false conditions, not when calculating averages.
3 users thanked author for this post.
January 25, 2022 at 11:03 pm #67357Darren
- Topics: 73
- Replies: 923
- Posts: 996
Breakout scan: https://twitter.com/Optuma/status/1482727843171868672?t=JzBy3BTgpMf_3_i2Z3lAzw&s=19
123456789101112131415//Define pivots;#$Bars=10;H1=PIVOT(MIN=$Bars, TYPE=High, IGNOREUNCONFIRMED=True);L1=PIVOT(MIN=$Bars, TYPE=Low, IGNOREUNCONFIRMED=True);//Get pivot values;H2=VALUEWHEN(HIGH(), H1);L2=VALUEWHEN(LOW(),L1);//When did the pivots occur?;$TH1=TIMESINCESIGNAL(H1, UNIT=Bars);$TL1=TIMESINCESIGNAL(L1, UNIT=Bars);//Close crosses previous pivot level with a new high/low since the pivot;(CLOSE() CrossesAbove H2 and CLOSE() > HIGHESTHIGH(BARS=$TL1)) or(CLOSE() CrossesBelow L2 and CLOSE() < LOWESTLOW(BARS=$TL1))1 user thanked author for this post.
February 23, 2022 at 4:46 pm #67583Tim
- Topics: 30
- Replies: 29
- Posts: 59
Can you post the script for the slope of the linear regression.
March 14, 2022 at 9:09 pm #67691Darren
- Topics: 73
- Replies: 923
- Posts: 996
If you type ‘linear’ in the script editor window then all suggestions will pop up, including LRSLOPE():
March 15, 2022 at 9:10 pm #67697Darren
- Topics: 73
- Replies: 923
- Posts: 996
VIX curve chart: https://twitter.com/Optuma/status/1503686929652408322?s=20&t=1bCnrW9A03LrLGX9BhgMig
Save workbook attached (requires access to the CBOE Indices data).
Attachments:
You must be logged in to access attached files.
May 4, 2022 at 9:08 pm #68097Darren
- Topics: 73
- Replies: 923
- Posts: 996
Day of the Week formulas: https://twitter.com/Optuma/status/1520384472356560896
The DAYOFWEEK() function assigns a value to each week day, with Sundays assigned a 1, Mondays = 2, etc. As such, to mark all Fridays on a chart use DAYOFWEEK()==6 in a Show Bar. This will show all Fridays with a fall greater than 3%:
1234DAYOFWEEK()==6 andCHANGE()<-31 user thanked author for this post.
May 11, 2022 at 6:50 pm #68207Darren
- Topics: 73
- Replies: 923
- Posts: 996
5 Consecutive Down Weeks: https://twitter.com/Optuma/status/1523622055534419968
The Days Down DD() function counts the consecutive bars a value (the close by default) has been lower (Days Up DU() does the opposite).
On a weekly timeframe DD()==5 will signal when there have been 5 consecutive weekly lower closes, which was used in the signal test.
For 5 consecutive lower highs use DD(HIGH())==5
The Days Down tool can be used on a chart (currently 6 weeks for the SPX):
June 17, 2022 at 10:15 pm #68583Darren
- Topics: 73
- Replies: 923
- Posts: 996
To calculate how long ago the close was at the latest low (or high) – and the dates they occured: https://twitter.com/Optuma/status/1537704403205079040
Worst Change Since:
1234567//Display as Date in Watchlist;//Get the last 1D ROC change %;D1=LAST(ROC(BARS=1));//Get the BarDate when the 1D ROC was less than D1;BARDATE(ROC(BARS=1)<D1, UNIT=Days)Lowest Close Since:
1234567//Display as Date in Watchlist;//Get the last close price;D1=LAST(CLOSE());//Get the BarDate when the Close was less than D1;BARDATE(CLOSE()<D1)Weeks Since Low
123456//Get the last close price;D1=LAST(CLOSE());//Get the time since the Close was less than D1;TIMESINCESIGNAL(CLOSE()<D1, Unit=Weeks)To find the high dates instead, change the < to >. Sample weekly watchlist attached that can be saved as a layout and applied to any other lists.
Attachments:
You must be logged in to access attached files.
2 users thanked author for this post.
June 23, 2022 at 3:47 pm #68647Thomas
- Topics: 131
- Replies: 183
- Posts: 314
Hi Optuma team,
can you publish the script for the Twitter chart “ATH Drawdown” (https://twitter.com/Optuma/status/1539727679586443265)?
As always many thanks for your excellent support.
Best wishes,
ThomasJune 23, 2022 at 5:03 pm #68649Darren
- Topics: 73
- Replies: 923
- Posts: 996
Hi Thomas – use the Drawdown tool set to 100 year lookback (the all-time high calculation is wrong and is being fixed).
https://help.optuma.com/kb/faq.php?id=1237
1 user thanked author for this post.
June 30, 2022 at 4:33 pm #68669Thomas
- Topics: 131
- Replies: 183
- Posts: 314
Hi Darren,
The story goes on. Can you publish the scripts for your two interesting Twitter charts here?
$XLRE, $XLU. & $XLC are currently below their pre-Covid high in early 2020. $XLF, $XLI, & $XLY have all found support at those levels… will they hold? pic.twitter.com/Wj96xBDbwf
— Optuma (@Optuma) June 29, 2022
8 of the 11 SPDR sectors beat the $SPX yesterday. 10 day relative high for $XLU, 6 for $XLF. 40 day relative low for $XLC, 22 for $XLY, and 10 for $XLK: pic.twitter.com/8rc1O1MU1c
— Optuma (@Optuma) June 29, 2022
Many thanks for your great inspirations and support.
Best wishes,
ThomasJuly 4, 2022 at 8:53 pm #68681Darren
- Topics: 73
- Replies: 923
- Posts: 996
Hi Thomas,
The pre-Covid high values were defined using the HIGHESTHIGH function between January 1st and March 13th 2020, and getting the percent difference from the latest close:
1234V1=HIGHESTHIGH(RANGE=Range, RANGESTART=2020-01-01, RANGEEND=2020-03-13);DIFFPCT(CLOSE(), V1)/100The custom bar colours use this:
1234V1=HIGHESTHIGH(RANGE=Range, RANGESTART=2020-01-01, RANGEEND=2020-03-13);CLOSE()>V1To count the days since any value was that high (eg closing price, RIC, RSI, Volume, etc) change the D1 function here, as required:
12345D1=RIC();D2=LAST(D1);TIMESINCESIGNAL(D1>D2, Unit=Bars)1 user thanked author for this post.
July 20, 2022 at 5:05 am #68787Thomas
- Topics: 131
- Replies: 183
- Posts: 314
Hi Darren,
you published a real cool chart on Twitter (https://twitter.com/Optuma/status/1549447224324755456?cxt=HHwWgMC8wdGC34ArAAAA).
Would you please be so kind again to explain how you created this chart?
Am I right that I need the “Column Chart” feature in the Professional and Enterprise edition of Optuma to create your chart?
But anyway, please just explain how you created the chart with all the necessary scripts.
I use the following script in a watchlist to calculate the maximum drawdown:
12345Line1 = DDP(Week(PERIODAMOUNT=1), BACKTYPE=Weeks, LOOKBACKBARS=52, DEFAULT=Maximum) ;Line2 = Line1 / 100 ;Line2With this script I get the maximum drawdown for the SPX of -24.52%, in your chart you have for the maximum drawdown a value of -23.69%.
What is the reason for this difference?Best wishes,
Thomas -
AuthorPosts
- You must be logged in to reply to this topic.