Float Rotation Indicator for ThinkorSwim

zeek

Active member
2019 Donor
Currently not at home but i will have a look at this over the weekend and then get back to you @jngy2k , last time i checked, my float rotation script had no problems drawing the vertical lines.
 

SuryaKiranC

Well-known member
@jngy2k it would be helpful if you elaborate on the problem, like the timeframe of your chart, the ticker for somebody to verify. add as much details as possible.
 
Last edited:

HeadSpade

New member
Hi Guys, I'm complete Newbie when it comes to coding. I've been using the script with 'VERTICAL LINES'. Is there anyway we can replace those Vertical Lines with just a small Arrow pointing at the candle where the float rotated? I'm tryin to copy and paste from other scripts but as you can guess no success so far.

This is the code:

Code:
def Today = volume(period = "DAY");
input Float = 10000000;
def V = if Today then volume(period = aggregationPeriod.MIN) else 0;
def TVol = TVol[1] + V;
def nodes = (TVol) % Float;

AddVerticalLine(nodes < nodes[1], CONCAT("Float Rotated: ", CONCAT(round(TVol / float, 0), "")) , Color.WHITE, Curve.SHORT_DASH);

AddLabel (yes, ("Float: ")+ Round(Float * .000001, 1) + "M", Color.White);

AddLabel (yes, ("T.Vol: ")+ Round(Today * .000001, 2) + "M", Color.White);

Addlabel (yes, ("Float RT: x")+ Round(Today/float, 0), if nodes < 0 then color.WHITE else Color.RED);
 
Last edited:

jjohan22

New member
Hey @SuryaKiranC you seem to know what you're doing when it comes to this stuff. I was wondering if you could help me with a change in the code. I would like float rotation to be calculated on the current day regardless of time interval. For example, currently you need to specifically be on 1d:1m, 1d:3m, etc. and i would like to be on a longer time interval 10d:1m, 10d:3m. Any help on this would be greatly appreciated as I cant seem to figure it out at the moment! Thanks.
 

SuryaKiranC

Well-known member
@jjohan22 there is no such restriction. You can be in whatever from you want. The only thing that seems to be impacting is if 5he give frame is covering the float traded or not. One another thing to keep in mind is that float data is not available in TOS, you need to source it and keep updating it periodically.
 

jjohan22

New member
@SuryaKiranC Maybe this can help. The 1st pic is a 1day 1 min timeframe. Notice 1st float rotation is in premarket and 2nd rotation is near the open.
2nd image is the same chart but on a 10day 1 min timeframe. Notice that there is still float rotation in pre market but it is number 6.
It means that float rotation is being calculated from 10 days ago. I want it to always calculate float rotation from the current day even if im on a 10 day chart.

I understand that float values need to be put in manually and periodically.

I appreciate the quick response, thanks!
 

SuryaKiranC

Well-known member
@jjohan22 replace

Code:
def aP = GetAggregationPeriod();

with

Code:
def aP = AggregationPeriod.DAY;

or you could simple define it as

Code:
input aP = AggregationPeriod.DAY;

so you can switch it on Script properties going forward however you prefer.
 

SuryaKiranC

Well-known member
@jjohan22 So, I think this is about the amount of data made available on charts, with only 1D selected, you are making only a day, at the most 1 Previous days of data, depends on how you setup charts, available.

If all you are interested in is, look if the entire float of the ticker has changed in a given day, why not use a lower timeframe and use a higher timeframe in a different cell?
 

Similar threads

Top