Optuma Forums › Optuma Scripting › Anchored VWAP scripts
- This topic has 3 replies, 2 voices, and was last updated 2 weeks ago by
Marc.
-
AuthorPosts
-
March 7, 2020 at 2:32 am #57277
Darren
- Topics: 73
- Replies: 937
- Posts: 1,010
To calculate the distance from the anchored VWAP line for IPOs – and therefore be alerted when the level is crossed – use the following scripts.
[Click here and here for other IPO posts.]
Distance from A-VWAP as a Show View tool or watchlist column:
12345678//Get IPO Date$IPO=FIRST(BARDATE());//Calculate VWAP from IPO DateR1=AVWAP(BACKTYPE=Fixed, DATE=$IPO);//Calculate % difference((CLOSE()/R1)-1)The following can be added to a watchlist for A-VWAP crosses:
123456789101112//Get IPO Date$IPO=FIRST(BARDATE());//Calc VWAP from IPO Date;V1=AVWAP(BACKTYPE=Fixed, DATE=$IPO);//Does Close cross VWAP?Above = CLOSE() CrossesAbove V1;Below = CLOSE() CrossesBelow V1;//For formatting column in a watchlist//Cross above will display as 1, cross below as 0.5;IF(Above==1,1,(IF(Below==1,0.5),0))This shows PTON crossing below, and WORK above:
To format the A-VWAP Cross column right-click on the header and change the Custom Labels to match the values in the script (ie ==1 is Above, etc):
February 27, 2023 at 8:00 pm #70415Marc
- Topics: 23
- Replies: 38
- Posts: 61
Hi Optuma,
I use the IPOVwap with standard deviations. Below is my script.
Optuma limits the number of sigma multiplier to 4 which does not allow to cover every charts (check Apple, Nvidia) Would it be possible to raise this limit? (this issue was already raised here and left unanswered).
(I also believe I could not put all the STD I wanted into the same script. I use another script to cover negative STD + 50% of the third upward channel).
Thanks
Marc::Script::
// IPOvwap
$IPO=FIRST(BARDATE());
IPOvwap=AVWAP(BACKTYPE=Fixed, DATE=$IPO, CALC=OHLC);//IPOvwap_STD_down=STD(IPOvwap, MULT=0.50, BARS=100, TYPE=Average Plus Deviation);
IPOvwap_STD_up1=STD(IPOvwap, MULT=2.00, TYPE=Average Plus Deviation);
IPOvwap_STD_up2=STD(IPOvwap, MULT=3.00, BARS=100, TYPE=Average Plus Deviation);
IPOvwap_STD_upx3=STD(IPOvwap, MULT=4.00, BARS=100, TYPE=Average Plus Deviation);//50%
IPOvwap_STD_upx1.5=STD(IPOvwap, MULT=1.50, BARS=100, TYPE=Average Plus Deviation);
IPOvwap_STD_upx2.5=STD(IPOvwap, MULT=2.50, BARS=100, TYPE=Average Plus Deviation);
IPOvwap_STD_upx3.5=STD(IPOvwap, MULT=3.50, TYPE=Average Plus Deviation, BARS=100);plot0= IPOvwap;
plot2 = IPOvwap_STD_up1;
plot3 = IPOvwap_STD_up2;
plot4 = IPOvwap_STD_upx3;//50% up
plot5 = IPOvwap_STD_upx1.5;
plot6 = IPOvwap_STD_upx2.5;
plot7 = IPOvwap_STD_upx3.5;plot0.Colour = yellow;
plot0.Linestyle = dot;
plot0.LineWidth = 2;
plot1.Colour = red;
plot1.LineWidth = 2;
plot2.Colour = red;
plot2.LineWidth = 2;
plot3.Colour = red;
plot3.LineWidth = 2;
plot3.transparency = 100;
plot4.Colour = red;
plot4.Colour = red;
plot4.LineWidth = 2;
plot4.transparency = 100;
plot5.Colour = red;
plot5.Colour = red;
plot5.LineWidth = 1;
plot5.transparency = 20;
plot5.Colour = red;
plot6.LineWidth = 1;
plot6.transparency = 20;
plot6.Colour = red;
plot7.Colour = red;
plot7.LineWidth = 1;
plot7.transparency = 20;March 2, 2023 at 2:44 pm #70425Darren
- Topics: 73
- Replies: 937
- Posts: 1,010
Hi Marc,
Sigma is a statistical measure on normal distributions, so I don’t think it makes sense to have higher sigmas (4 sigmas will include 99.9937% of expected events which is why there’s a limit). Instead, you could multiply the original STD calculation to get the different levels, which is what we made available in the Linear Regression Bands tool in response to the other post.
1234567891011// IPOvwap$IPO=FIRST(BARDATE());IPOvwap=AVWAP(BACKTYPE=Fixed, DATE=$IPO, CALC=OHLC);//IPOvwap_STD_down=STD(IPOvwap, MULT=0.50, BARS=100, TYPE=Average Plus Deviation);Plot1=STD(IPOvwap, MULT=2.00, TYPE=Average Plus Deviation);Plot2=Plot1 * 2;Plot3=Plot1 * 3;Plot4=Plot1 * 4;Plot5=Plot1 * 5;Here’s how that looks on NVDA:
March 3, 2023 at 5:49 pm #70447Marc
- Topics: 23
- Replies: 38
- Posts: 61
Excellent. Thanks Darren
-
AuthorPosts
- You must be logged in to reply to this topic.