SATY Bias Candles For ThinkOrSwim

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
SATY Bias Candles script:
shared study link: http://tos.mx/yw2MZKc Click here for --> Easiest way to load shared links

Ruby:
# Saty Bias Candles
# Copyright (C) 2022 Saty Mahajan
#
# Settings
input time_warp = {default "off", "1m", "2m", "3m", "4m", "5m", "10m", "15m", "20m", "30m", "1h", "2h", "4h", "D", "W", "M", "Y"};
input Fast_EMA = 8;
input Pivot_EMA = 21;
input Slow_EMA = 34;
input Highlight_Fast = no;
input Highlight_Pivot = no;
input Highlight_Slow = no;
input Show_Conviction_Arrows = yes;
input Conviction_Arrow_Size = 2;
input Fast_Conviction_EMA = 13;
input Slow_Conviction_EMA = 48;
input Show_Fast_Conviction_EMA = yes;
input Show_Slow_Conviction_EMA = yes;
input Show_Candle_Bias = no;
input Bias_EMA = 21;

# Time Warp
def price;
switch (time_warp) {
case "off":
    price = close;
case "1m":
    price = close(period = AggregationPeriod.MIN);
case "2m":
    price = close(period = AggregationPeriod.TWO_MIN);
case "3m":
    price = close(period = AggregationPeriod.THREE_MIN);
case "4m":
    price = close(period = AggregationPeriod.FOUR_MIN);
case "5m":
    price = close(period = AggregationPeriod.FIVE_MIN);
case "10m":
    price = close(period = AggregationPeriod.TEN_MIN);
case "15m":
    price = close(period = AggregationPeriod.FIFTEEN_MIN);
case "20m":
    price = close(period = AggregationPeriod.TWENTY_MIN);
case "30m":
    price = close(period = AggregationPeriod.THIRTY_MIN);
case "1h":
    price = close(period = AggregationPeriod.HOUR);
case "2h":
    price = close(period = AggregationPeriod.TWO_HOURS);
case "4h":
    price = close(period = AggregationPeriod.FOUR_HOURS);
case "D":
    price = close(period = AggregationPeriod.DAY);
case "W":
    price = close(period = AggregationPeriod.WEEK);
case "M":
    price = close(period = AggregationPeriod.MONTH);
case "Y":
    price = close(period = AggregationPeriod.YEAR);
}

# Calculations
def FastValue = ExpAverage(price, Fast_EMA);
def PivotValue = ExpAverage(price, Pivot_EMA);
def SlowValue = ExpAverage(price, Slow_EMA);
def Fast_Conviction_Value = ExpAverage(price, Fast_Conviction_EMA);
def Slow_Conviction_Value = ExpAverage(price, Slow_Conviction_EMA);

# Add Clouds
DefineGlobalColor("Fast Long", Color.GREEN);
DefineGlobalColor("Fast Short", Color.RED);
DefineGlobalColor("Slow Long", Color.CYAN);
DefineGlobalColor("Slow Short", Color.LIGHT_ORANGE);
DefineGlobalColor("Pivot Highlight", Color.LIGHT_GRAY);
DefineGlobalColor("Fast Highlight", Color.LIGHT_GRAY);
DefineGlobalColor("Slow Highlight", Color.LIGHT_GRAY);
DefineGlobalColor("Bullish Conviction Arrow", Color.CYAN);
DefineGlobalColor("Bearish Conviction Arrow", Color.ORANGE);

# Show Candle Bias
def BiasValue = ExpAverage(price, Bias_EMA);
def above_pivot = close >= BiasValue;
def below_pivot = close < BiasValue;
def up = open < close;
def doji = open == close;
def down = open > close;
AssignPriceColor(if above_pivot and up and Show_Candle_Bias then GlobalColor("Fast Long") else if below_pivot and up and Show_Candle_Bias then GlobalColor("Slow Short") else if above_pivot and down and Show_Candle_Bias then GlobalColor("Slow Long") else if below_pivot and down and Show_Candle_Bias then GlobalColor("Fast Short") else if doji and Show_Candle_Bias then Color.GRAY else Color.CURRENT);
@j11235813
 

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
434 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