Deerfield
Posts: 1 since May 2019
Thanks Given: 0
Thanks Received: 0
|
Thinkorswim
so basically this is the script for a 1tick based VWAP which I believe is more accurate than standard candle based one. To make it work it has to be added to a 1 tick chart
def Active = SecondsFromTime(0929) >= 0 and
SecondsTillTime(1559) >= 0;
def vol = if Active and !Active[1]
then volume * close
else if Active
then vol[1] + volume * close
else vol[1];
def vol1 = if Active and !Active[1]
then volume
else if Active
then vol1[1] + volume
else vol1[1];
def avgprice = vol / vol1; # the vwap curve
def vol2 = if Active and close > avgprice + 0.001
then volume
else 0;
plot curve2 = vol2; # volume of ticks that trade above vwap
so the goal here is to get an aggregate volume of pops on the curve2. havent been able to do that - the code I used for vol and vol1 to get aggregate values - doesnt work. and totalsum gives some insane number.
Please assist
|