Heikin_Ashi Indicator For ThinkOrSwim

Can you show it to me? Did the above information resolve the issue?
Yeah he's talking about this

QsgmtSu.png
 
Also, does this reversal bubble not repaint? @BonBon
Previously, I used arrows with the same code for plotting the reversals. They did not repaint. I simply changed the arrows to bubbles which should not repaint. I have not tested the bubbles as yet but I assume the theory should hold as it did for the arrows.
 
@D_Tramp Yes... this is the script that I use for the watchlist.

Code:
input period = 50;
input hideCandles = no;
input candleSmoothing = {default Valcu, Vervoort};
input show_bubble_labels = yes;

input movingAverageType = {default Exponential, TEMA};

def openMA;
def closeMA;
def highMA;
def lowMA;

switch (movingAverageType) {

case Exponential:
    openMA = CompoundValue(1, ExpAverage(open, period), open);
    closeMA = CompoundValue(1, ExpAverage(close, period), close);
    highMA = CompoundValue(1, ExpAverage(high, period), high);
    lowMA = CompoundValue(1, ExpAverage(low, period), low);

case TEMA:
    openMA = CompoundValue(1, TEMA(open, period), open);
    closeMA = CompoundValue(1, TEMA(close, period), close);
    highMA = CompoundValue(1, TEMA(high, period), high);
    lowMA = CompoundValue(1, TEMA(low, period), low);
}


def haOpen = CompoundValue(1,( (haOpen[1] + (openMA[1] + highMA[1] + lowMA[1] + closeMA[1]) / 4.0) / 2.0), open);
def haClose = ((((openMA + highMA + lowMA + closeMA) / 4.0) + haOpen + Max(highMA, haOpen) + Min(lowMA, haOpen)) / 4.0);
def haLow =  Min(lowMA, Min(haclose, haOpen));
def haHigh = Max(highMA, Max(haclose, haOpen));

def trend = haclose >= haopen;
plot trendup = trend and !trend[1];

def trendd = haclose < haopen;
plot trendDown = trendd and !trendd[1];

def arrowup = trendup;
def arrowdown = trenddown;

def trigger = if arrowup then 100 else if arrowdown then -100 else trigger [1];

AddLabel(yes, if trigger == 100 then "👍" else if trigger == -100 then "👎" else "NA", if trigger ==100 then color.black else if trigger == -100 then color.black else color.white);

AssignbackgroundColor(if trigger == 100 then Color.Green else if trigger == -100 then Color.dark_Red else Color.black);

alert(Trendup,"Trend Up", alert.Bar, sound.bell);
alert(Trenddown,"Trend down", alert.Bar, sound.bell);
 
Last edited:
I am not a coder but was able to fix the input midTermPeriod error by adding quote to the default value as shown below:

Code:
default "15 min"
 
@Ghs..thanks. Definitely missed that as well while cleaning up my code. (I tend to place explanations etc. in my code and removed them while prepping to post the script) I made the changes in the original post. Thanks again.
 
@D_Tramp Yes... this is the script that I use for the watchlist.

Code:
input period = 50;
input hideCandles = no;
input candleSmoothing = {default Valcu, Vervoort};
input show_bubble_labels = yes;

input movingAverageType = {default Exponential, TEMA};

def openMA;
def closeMA;
def highMA;
def lowMA;

switch (movingAverageType) {

case Exponential:
    openMA = CompoundValue(1, ExpAverage(open, period), open);
    closeMA = CompoundValue(1, ExpAverage(close, period), close);
    highMA = CompoundValue(1, ExpAverage(high, period), high);
    lowMA = CompoundValue(1, ExpAverage(low, period), low);

case TEMA:
    openMA = CompoundValue(1, TEMA(open, period), open);
    closeMA = CompoundValue(1, TEMA(close, period), close);
    highMA = CompoundValue(1, TEMA(high, period), high);
    lowMA = CompoundValue(1, TEMA(low, period), low);
}


def haOpen = CompoundValue(1,( (haOpen[1] + (openMA[1] + highMA[1] + lowMA[1] + closeMA[1]) / 4.0) / 2.0), open);
def haClose = ((((openMA + highMA + lowMA + closeMA) / 4.0) + haOpen + Max(highMA, haOpen) + Min(lowMA, haOpen)) / 4.0);
def haLow =  Min(lowMA, Min(haclose, haOpen));
def haHigh = Max(highMA, Max(haclose, haOpen));


def arrowup = trendup;
def arrowdown = trenddown;

def trigger = if arrowup then 100 else if arrowdown then -100 else trigger [1];

AddLabel(yes, if trigger == 100 then "👍" else if trigger == -100 then "👎" else "NA", if trigger ==100 then color.black else if trigger == -100 then color.black else color.white);

AssignbackgroundColor(if trigger == 100 then Color.Green else if trigger == -100 then Color.dark_Red else Color.black);

alert(Trendup,"Trend Up", alert.Bar, sound.bell);
alert(Trenddown,"Trend down", alert.Bar, sound.bell);
Please help @BonBon, I have this errors:
0ab75ba68ee672d7fcc7a35e1c2a9df8ca522d04e9d4045be1.jpg
 
@BonBon Is there a way to have just the HA candles without smoothing...or just candlesticks without HA but the signals and everything else stays...I have been watching all morning and no repaint so far...very interesting. But I read my candlestick better.
 
@hexis777 You have to add the below script from the main study

Code:
def trend = haclose >= haopen;
plot trendup = trend and !trend[1];

def trendd = haclose < haopen;
plot trendDown = trendd and !trendd[1];
 
You have to add the below script from the main study

def trend = haclose >= haopen;
plot trendup = trend and !trend[1];

def trendd = haclose < haopen;
plot trendDown = trendd and !trendd[1];
Hi bro, excuseme, I added this part to the script you use in the Watchlist #28, but now it generates this error :(

97a09fb1917f1950dcca2bcf58b07f3a93d6df748c068fb10d.jpg
 
Use the above script that was posted for the watchlist and add the below. Place it directly before the "arrowup" statement.

def trend = haclose >= haopen;
plot trendup = trend and !trend[1];

def trendd = haclose < haopen;
plot trendDown = trendd and !trendd[1];
 
@BonBon Is there a way to have just the HA candles without smoothing...or just candlesticks without HA but the signals and everything else stays...I have been watching all morning and no repaint so far...very interesting. But I read my candlestick better.
Yes.. please have a look at the previous discussion.
 
Use the above script that was posted for the watchlist and add the below. Place it directly before the "arrowup" statement.

def trend = haclose >= haopen;
plot trendup = trend and !trend[1];

def trendd = haclose < haopen;
plot trendDown = trendd and !trendd[1];

Excellent master, works well ,)
 

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

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
291 Online
Create Post

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