NexusFi: Find Your Edge


Home Menu

 





Need to get aggregate value, totalsum doesnt work


Discussion in ThinkOrSwim

Updated
    1. trending_up 833 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 0 posts
    2. attach_file 0 attachments




 
Search this Thread

Need to get aggregate value, totalsum doesnt work

  #1 (permalink)
darkness3277
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

Reply With Quote




Last Updated on May 31, 2019


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts