Okay if we get into specifics, I would like to plot only the prime numbers of the number of times my float rotation indicator rotates.
When I give an input to the float, sometimes the input is small enough to plot many float rotations throughout the intraday.
For example if I used the float input as 10million, today BRQS rotated 19 times.
This data produces too many points for me to look at and I wish to only plot the prime number of times the float rotates.
Code:input Float = 10000000; input showfnodes = yes; input showlabel = no; def today= getday()>=getlastday(); def Todayv = volume(period="DAY"); def V = if Todayv then volume(period = getaggregationPeriod()) else double.NaN; def DVol = if today then DVol[1] + V else 0; def nodes...
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Price level sort of like fibonnaci... but it doesn't matter. I basically need the function, if someone knows how to turn it into script, then I can plot it myself.plot them in what way?
Price level sort of like fibonnaci... but it doesn't matter. I basically need the function, if someone knows how to turn it into script, then I can plot it myself.
I think it cant be done manually and TOS need to add it as a math function.
input Float = 10000000;
input showfnodes = yes;
input showlabel = no;
def today= getday()>=getlastday();
def Todayv = volume(period="DAY");
def V = if Todayv then volume(period = getaggregationPeriod()) else double.NaN;
def DVol = if today then DVol[1] + V else 0;
def nodes = (DVol) % Float;
AddLabel (if showlabel and getAggregationPeriod()<=AggregationPeriod.hour then 1 else 0, "FloatRT: " + Round(Todayv/Float, 1), if Todayv < Float then Color.white else Color.orange);
AddVerticalLine(if getAggregationPeriod()<=AggregationPeriod.ten_MIN and showfnodes then nodes < nodes[1] else 0, Concat(Round(DVol / Float, 0),"") , Color.white, Curve.SHORT_DASH);
Actually come to think of it, how would you only addvertical lines of select numbers of the rotation ?How many primes are we talking about? There are only 168 between 1 and 1000, so it may be easier just to individually define and plot them. Perhaps with a little more definition as to how you want to use them, I might be able to put something together for you.
Okay if we get into specifics, I would like to plot only the prime numbers of the number of times my float rotation indicator rotates.
When I give an input to the float, sometimes the input is small enough to plot many float rotations throughout the intraday.
For example if I used the float input as 10million, today BRQS rotated 19 times.
This data produces too many points for me to look at and I wish to only plot the prime number of times the float rotates.
Before:Code:input Float = 10000000; input showfnodes = yes; input showlabel = no; def today= getday()>=getlastday(); def Todayv = volume(period="DAY"); def V = if Todayv then volume(period = getaggregationPeriod()) else double.NaN; def DVol = if today then DVol[1] + V else 0; def nodes = (DVol) % Float; AddLabel (if showlabel and getAggregationPeriod()<=AggregationPeriod.hour then 1 else 0, "FloatRT: " + Round(Todayv/Float, 1), if Todayv < Float then Color.white else Color.orange); AddVerticalLine(if getAggregationPeriod()<=AggregationPeriod.ten_MIN and showfnodes then nodes < nodes[1] else 0, Concat(Round(DVol / Float, 0),"") , Color.white, Curve.SHORT_DASH);
![]()
AFTER:
![]()
I need to edit the condition for AddVerticalLine where nodes < nodes[1] else 0, Concat(Round(DVol / Float, 0) is only plotting the prime numbers of rotation. Don't know how this can be done.
Actually come to think of it, how would you only addvertical lines of select numbers of the rotation ?
def z = (DVol) % Float;
def isprime;
if z == 3 or z == 5 or z == 7 or z == 11 then {
isprime = 1;
else if z == 13 or z == 17 or z == 19 or z == 23 then {
isprime = 1;
} else {
isprime = 0;
}
addverticalline( isprime, z, color.cyan);
input sym1 = "SPY";
input s1_float = 0;
input sym2 = "C";
input s2_float = 0;
input sym3 = "F";
input s3_float = 0;
input sym4 = "T";
input s4_float = 0;
input sym5 = "V";
input s5_float = 0;
def float1;
if GetSymbol() == sym1 then {
float1 = s1_float;
} else if GetSymbol() == sym2 then {
float1 = s2_float;
} else if GetSymbol() == sym3 then {
float1 = s3_float;
} else if GetSymbol() == sym4 then {
float1 = s4_float;
} else if GetSymbol() == sym5 then {
float1 = s5_float;
} else {
float1 = 0;
}
# read the close price from a variable name
# def c1 = close(sym1)
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
P | How to create a variable that show value but not plot on chart | Questions | 5 | |
T | Create a script that plot lines and % range? | Questions | 3 | |
B | no 'create closing order' present!! | Questions | 0 | |
S | How to create strategy for IUSmartSystem on ES futures | Questions | 6 | |
S | How to create 20 day average volume column | Questions | 5 |
Start a new thread and receive assistance from our community.
useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.
We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.
If you are new, or just looking for guidance, here are some helpful links to get you started.