Mark candle based on dollar volume


Category:
0
0

Hello Pete,

How can I make an arrow signal for the 5-minute chart to show only one arrow (either the black OR red arrow)

if the totalDollarVolume > $100K to be Color.Black Down Arrow and if the totalDollarVolume > $200K to be Color.Red Down Arrow

Thanks

RESOLVED
Marked as spam
Posted by (Questions: 7, Answers: 16)
Asked on January 4, 2019 8:26 pm
131 views
0
Private answer

I updated your question title to more clearly describe the context of your question. This will assist our other viewers with similar questions to find this using the search box.

The problem here is we cannot access “dollar volume” in Thinkorswim. We have total volume (number of shares) and we have number of trades. But we have not way to derive the or compute the actual dollars traded for a given candle.

Marked as spam
Posted by (Questions: 37, Answers: 4086)
Answered on January 5, 2019 8:57 am
0

You did give me a code before for the dollar volume as totalDollars = volume * close

Can we use this code for that?

Btw since you mentioned the # of trades as well. Where can I find that in TOS? Or the coding for that. Since I can’t seem to find it. Or should I post a new question for that?

( at January 5, 2019 9:53 am)
0

That other code is meant to read data at the one minute time frame to decrease the degree of error in the value. In this request, you want to read data from the 5 min chart. We cannot get 1 min data into a 5 min chart.

For the number of trades, search this forum using the word: TICK_COUNT

You can read the official documentation here: http://tlc.thinkorswim.com/center/reference/thinkScript/Constants/FundamentalType/FundamentalType-TICK-COUNT.html

Update: The request has been updated to include an APPROXIMATION of dollar volume due to actual dollar volume not being available on the platform.
def aproximateDollarVolume = volume * close;
plot signalOne = aproximateDollarVolume > 100000 and aproximateDollarVolume <= 200000;
signalOne.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
signalOne.SetDefaultColor(Color.BLACK);
signalOne.SetLineWeight(3);
plot signalTwo = aproximateDollarVolume > 200000;
signalTwo.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
signalTwo.SetDefaultColor(Color.RED);
signalTwo.SetLineWeight(3);
( at January 5, 2019 1:41 pm)
0

If that’s the case. Then what would be the code for the 1min timeframe?

Thanks for the “trades” link.

( at January 6, 2019 12:18 pm)
0

I have updated my response to include code for the approximate dollar volume. You can use this on any time frame but the values are not exact on any time frame.

( at January 7, 2019 8:08 am)
0

Thanks Pete. You are always helpful.

( at January 7, 2019 4:49 pm)