Boolean Arrows as PaintingStrategy

dinodotcom

Member
2019 Donor
I am wondering if there is someone out there that can help me do a scan for any study that uses Boolean arrows. I have a few studies that will indicate Boolean arrows that I would like to run scans to see if the arrows are present. I am looking for the generic think script code that I can use. Any help is much appreciated.

The code below has "BOOLEAN_ARROW_UP" and "BOOLEAN_ARROW_DOWN"

Code:
input length = 14;
input crossingType = {default above, below};
input threshold = 20;
input averageType = AverageType.WILDERS;

plot signal = crosses(DMI(length, averageType).ADX, threshold, crossingType == CrossingType.above);

signal.DefineColor("Above", GetColor(0));
signal.DefineColor("Below", GetColor(1));
signal.AssignValueColor(if crossingType == CrossingType.above then signal.color("Above") else signal.color("Below"));

signal.SetPaintingStrategy(if crossingType == CrossingType.above
    then PaintingStrategy.BOOLEAN_ARROW_UP
    else PaintingStrategy.BOOLEAN_ARROW_DOWN);

How do I put that into a scanner?
 
In your ThinkorSwim scanner, set the "signal" plot to true.

5hr2WWE.png
 

Attachments

  • 5hr2WWE.png
    5hr2WWE.png
    47 KB · Views: 183
Define three conditions and them sum them. If all true, then the value 3 will be returned.

def cond1 = A > B;
def cond2 = B > C;
def cond3 = C > D;

def result = cond1 + cond2 + cond3;
 
Define three conditions and them sum them. If all true, then the value 3 will be returned.

def cond1 = A > B;
def cond2 = B > C;
def cond3 = C > D;

def result = cond1 + cond2 + cond3;
Thanks a lot! What I plan to do is to rank 4 to 5 variables, there seems no easy way or function to do it except to compare them one by one. So in this case I guess I would need to def all 30 cond? Thanks again!
 
Thanks a lot! What I plan to do is to rank 4 to 5 variables, there seems no easy way or function to do it except to compare them one by one. So in this case I guess I would need to def all 30 cond? Thanks again!

I have in the past been asked how to compare the lowest and highest of 3 variables.
Here's one way to do so

def lowest = min(a, min(b,c));
def highest = max(a, max(b,c));

So with 5 variables in your case you can adopt a similar nested approach although that would get rather complex pretty quick
 
By the way, I found in addchartbubble, I can not use the current value for the price location, for example, Data, I have to use Data[1]
I have in the past been asked how to compare the lowest and highest of 3 variables.
Here's one way to do so

def lowest = min(a, min(b,c));
def highest = max(a, max(b,c));

So with 5 variables in your case you can adopt a similar nested approach although that would get rather complex pretty quick
Thanks!
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
343 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

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.

How do I get started?

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.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top