Wednesday, December 12, 2007

Here's a simple script to see the VWAP (Volume weighted average price). To see a good approximation, you need to switch to the one minute chart since TOS doesn't provide tick data.

plot Data = TotalSum(Volume * Close) / TotalSum(Volume);

7 comments:

Anonymous said...

Thank you, have any more?

Sia said...

Thaaaaaaaaanks, I've been looking for this forever.

Anonymous said...

I am also very interested in thinkScript having been a programmer for 35 years, but the documentation is pretty light. When you start typing any verb (eg. DEBUG) you see argmument types but absolutely no usage verbiage. Do you have any insights into getting a better handle on the "builtins".

Jeff said...

In case anyone is interested, I made a rough estimate of Pascal Willain's Effective Volume function (from this book: http://www.amazon.com/Value-Time-Trading-through-Effective/dp/0470118733/ref=sr_1_1?ie=UTF8&s=books&qid=1214245618&sr=8-1 ). Too bad ThinkScript doesn't give me a good way to calculate the separation volume...


def h = Max(high, close[1]);
def l = Min(low, close[1]);
input priceIncrement = 0.01;
def ev = volume * (close - close[1] + priceIncrement) / (h - l + priceIncrement);
# version without opening noise
def ev2 = if(secondsFromTime(930)>600,ev,0);
plot EffectiveVolume = ev2;
#plot elapsedtime = secondsFromTime(930);

def ev_mag_avg = Average(data = AbsValue(ev2), length = 100);
def small_ev = if(AbsValue(ev2) < ev_mag_avg, ev2, 0);
def large_ev = if(AbsValue(ev2) >= ev_mag_avg, ev2, 0);
plot SmallEffectiveVolume = small_ev;
plot LargeEffectiveVolume = large_ev;
plot SmallEffectiveVolumeAvg = Average(data = small_ev, length = 30);
plot LargeEffectiveVolumeAvg = Average(data = large_ev, length = 30);

Unknown said...

Great Blog! Keep up the good work.

Anonymous said...

Hey, do you have an idea about how to get the Coppock Curve on TOS? Formula is WMA10 * (ROC11+ROC14).
I can find these formulas separate ofcourse but have no idea how to combine them.Thanks

Anonymous said...

Anyone tried to write a Hawkeye Indicator script yet? Looks like it would be awesome from the pics online, google search "Hawkeye Indicators"