Heikin_Ashi Indicator For ThinkOrSwim

Excellent!!!!! You are seeing the yellow, pink colors to the right of the MTF because you increased your "chart expansion" size. If you decrease your expansion size (based on your preference) it will show red or green only and/or only a minimal yellow pink green etc.
Ok thanks:)
 
Hi, when you say there are 3 different signals, in order to use them I would remove #...are the three, #plot trendup, #plot trenddown and the #zig zag line? Sorry it's just that I am slowly learning, little by little. Thanks

The plot trendup and plot trenddown are the original signals that is why I kept them with the HA_Script. After the HA_script there are 3 additional signals. My charts within #134 reference these signals. After the HA_script, there are 3 signals. You do not need to use all 3 of them. I placed them in the script for the benefit of previous members who were on this thread from the inception (work had kept me busy and I wanted members to receive all the updates I made). Additionally, it gives choice as to which members would prefer to use. If you have not done so please read the thread beginning with my first posting. I hope this helps.
 
The plot trendup and plot trenddown are the original signals that is why I kept them with the HA_Script. After the HA_script there are 3 additional signals. My charts within #134 reference these signals. After the HA_script, there are 3 signals. You do not need to use all 3 of them. I placed them in the script for the benefit of previous members who were on this thread from the inception (work had kept me busy and I wanted members to receive all the updates I made). Additionally, it gives choice as to which members would prefer to use. If you have not done so please read the thread beginning with my first posting. I hope this helps.
Ok thanks again.
 
Hi @BonBon ... stellar enhancements! Thanks again.

Say, would you be willing to share your scan query? I can't seem to get it to work based on the criteria you stated in post #1 and I don't recall seeing it addressed elsewhere.

I understand though if you'd prefer to keep that under wraps. :)
 
@everyone .... here's a very slight enhancement to the Multi time-frame Heikin (lower) study for those who might be confused by the multi color scheme for the dots to the right of the current minute. I set the default color to black.


Code:
# Multi time-frame Heikin
#BonBon 1/29/21
#  Four hours and Day MTF not included in the top plot. Three or more of the indicators must be green or red to plot.


declare lower;

input UsePeriod5 = AggregationPeriod.FIVE_MIN;
input UsePeriod15 = AggregationPeriod.FIFTEEN_MIN;
input UsePeriod30 = AggregationPeriod.thirty_MIN;
input UsePeriod60 = AggregationPeriod. HOUR;
input UsePeriod4hr = AggregationPeriod. FOUR_HOURS;
input UsePeriodday = AggregationPeriod.DAY;

input  Con_Cri = 3;

input Main_Heikin_Plot = Yes;


#Timeframe1 5 min

def aOpen5 = open(period = UsePeriod5);
def aClose5 = close(period = UsePeriod5);
def aHigh5 = high(period = UsePeriod5);
def aLow5 = low(period = UsePeriod5);

def haClose5 = (aOpen5 + aClose5 + aHigh5 + aLow5) / 4;
def haOpen5 = (haOpen5[1] + haClose5[1]) / 2;

def trend5 = if haClose5 >= haOpen5 then 1 else if haClose5[1] < haOpen5[1] then -1 else 0;
plot HA_Up5 = if IsNaN(UsePeriod5) then Double.NaN else 6;
HA_Up5.SetPaintingStrategy(PaintingStrategy.POINTS);#SetStyle(curve.Points);
HA_Up5.AssignValueColor(if haClose5 >= haOpen5 then Color.GREEN else if haClose5[1] < haOpen5[1] then Color.RED else color.current);
HA_Up5.SetLineWeight(4);
HA_Up5.SetDefaultColor(color.black);
############################################

#Timeframe2 15 mins

def aOpen15 = open(period = UsePeriod15);
def aClose15 = close(period = UsePeriod15);
def aHigh15 = high(period = UsePeriod15);
def aLow15 = low(period = UsePeriod15);

def haClose15 = (aOpen15 + aClose15 + aHigh15 + aLow15) / 4;
def haOpen15 = (haOpen15[1] + haClose15[1]) / 2;


def trend15 = if haClose15 >= haOpen15 then 1 else if haClose15[1] < haOpen15[1] then -1 else 0;
plot HA_Up15 = if IsNaN(UsePeriod15) then Double.NaN else 5;
#plot HA_Up15 = if haClose15 >= haOpen15 then 1 else 0;
HA_Up15.SetPaintingStrategy(PaintingStrategy.Points);#SetStyle(Curve.POINTS);
HA_Up15.AssignValueColor(if haClose15 >= haOpen15 then Color.GREEN else if haClose15 [1]< haOpen15[1] then Color.RED else color.current);
HA_Up15.SetLineWeight(4);
HA_Up15.SetDefaultColor(color.black);
#######################################

#Timeframe3  30 mins

def aOpen30 = open(period = UsePeriod30);
def aClose30 = close(period = UsePeriod30);
def aHigh30 = high(period = UsePeriod30);
def aLow30 = low(period = UsePeriod30);

def haClose30 = (aOpen30 + aClose30 + aHigh30 + aLow30) / 4;
def haOpen30 = (haOpen30[1] + haClose30[1]) / 2;


def trend30 = if haClose30 >= haOpen30 then 1 else if haClose30[1] < haOpen30[1] then -1 else 0;
plot HA_Up30 = if IsNaN(UsePeriod30) then Double.NaN else 4;
#plot HA_Up60 = if haClose60 >= haOpen60 then 1 else 0;
HA_Up30.SetPaintingStrategy(PaintingStrategy.Points);#SetStyle(Curve.POINTS);
HA_Up30.AssignValueColor(if haClose30 >= haOpen30 then Color.GREEN else if haClose30[1] < haOpen30[1] then Color.RED else color.current);
HA_Up30.SetLineWeight(4);
HA_Up30.SetDefaultColor(color.black);

################################
#Timeframe4  60mins

def aOpen60 = open(period = UsePeriod60);
def aClose60 = close(period = UsePeriod60);
def aHigh60 = high(period = UsePeriod60);
def aLow60 = low(period = UsePeriod60);

def haClose60 = (aOpen60 + aClose60 + aHigh60 + aLow60) / 4;
def haOpen60 = (haOpen60[1] + haClose60[1]) / 2;

def trend60 = if haClose60 >= haOpen60 then 1 else if haClose60[1] < haOpen60[1] then -1 else 0;
plot HA_Up60 = if IsNaN(UsePeriod60) then Double.NaN else 3;
#plot HA_Up60 = if haClose60 >= haOpen60 then 1 else 0;
HA_Up60.SetPaintingStrategy(PaintingStrategy.Points);#SetStyle(Curve.POINTS);
HA_Up60.AssignValueColor(if haClose60 >= haOpen60 then Color.GREEN else if haClose60[1] < haOpen60[1] then Color.RED else color.current);
HA_Up60.SetLineWeight(4);
HA_Up60.SetDefaultColor(color.black);
##################################
#Timeframe5 4hrs

def aOpen4hr = open(period = UsePeriod4hr);
def aClose4hr = close(period = UsePeriod4hr);
def aHigh4hr = high(period = UsePeriod4hr);
def aLow4hr = low(period = UsePeriod4hr);

def haClose4hr = (aOpen4hr + aClose4hr + aHigh4hr + aLow4hr) / 4;
def haOpen4hr = (haOpen4hr[1] + haClose4hr[1]) / 2;

def trend4hr = if haClose4hr >= haOpen4hr then 1 else if haClose4hr < haOpen4hr then -1 else 0;
plot HA_Up4hr = if IsNaN(UsePeriod4hr) then Double.NaN else 2;
#plot HA_Up60 = if haClose60 >= haOpen60 then 1 else 0;
HA_Up4hr.SetPaintingStrategy(PaintingStrategy.Points);#SetStyle(Curve.POINTS);
HA_Up4hr.AssignValueColor(if haClose4hr >= haOpen4hr then Color.GREEN else if haClose4hr[1] < haOpen4hr[1] then Color.RED else color.current);
HA_Up4hr.SetLineWeight(4);
HA_Up4hr.SetDefaultColor(color.black);
#######################################

#Timeframe6 Day

def aOpenday = open(period = UsePeriodday);
def aCloseday = close(period = UsePeriodday);
def aHighday = high(period = UsePeriodday);
def aLowday = low(period = UsePeriodday);

def haCloseday = (aOpenday + aCloseday + aHighday + aLowday) / 4;
def haOpenday = (haOpenday[1] + haCloseday[1]) / 2;

def trendday = if haCloseday >= haOpenday then 1 else if haCloseday [1] < haOpenday[1] then -1 else 0;
plot HA_Upday = if IsNaN(UsePeriodday) then Double.NaN else 1;
#plot HA_Up60 = if haClose60 >= haOpen60 then 1 else 0;
HA_Upday.SetPaintingStrategy(PaintingStrategy.Points);#SetStyle(Curve.POINTS);
HA_Upday.AssignValueColor(if haCloseday >= haOpenday then Color.GREEN else if haCloseday[1] < haOpenday[1] then Color.RED else color.current);
HA_Upday.SetLineWeight(4);
HA_Upday.SetDefaultColor(color.black);

####################################
#def Trend1 = if haClose5 >= haOpen5 then 1 else if haClose5[1] < haOpen5[1] then -1 else 0;
#def Trend2 = if haClose15 >= haOpen15 then 1 else if haClose15[1] < haOpen15[1] then -1 else 0;
#def Trend3 = if haClose60 >= haOpen60 then 1 else if haClose60[1] < haOpen60[1] then -1 else 0;
#def Trend4 = if haClose4hr >= haOpen4hr then 1 else if haClose4hr[1] < haOpen4hr[1] then -1 else 0;
#def Trend5_ = if  haCloseday >= haOpenday then 1 else if haCloseday[1] < haOpenday[1] then -1 else 0;

#Down Trend
#def Trend1a = if haClose5 < haOpen5 then 1 else if haClose5[1] >= haOpen5[1] then -1 else 0;
#def Trend2b = if haClose15 < haOpen15 then 1 else if haClose15[1] >= haOpen15[1] then -1 else 0;
#def Trend3c = if haClose60 < haOpen60  then 1 else if haClose60[1]>= haOpen60[1] then -1 else 0;
#def Trend4d = if haClose4hr < haOpen4hr then 1 else if haClose4hr[1] >= haOpen4hr[1] then -1 else 0;
#def Trend5e = if  haCloseday < haOpenday  then 1 else if haCloseday[1] >= haOpenday[1] then -1 else 0;

#Up Trend
def Trend1 = if haClose5 >= haOpen5 then 1 else if haClose5[1] < haOpen5[1] then -1 else 0;
def Trend2 = if haClose15 >= haOpen15 then 1 else if haClose15[1] < haOpen15[1] then -1 else 0;
def Trend3 = if haClose30>= haOpen30 then 1 else if haClose30[1] < haOpen30[1] then -1 else 0;
def Trend4 = if haClose60 >= haOpen60 then 1 else if haClose60[1] < haOpen60[1] then -1 else 0;
def Trend5_ = if haClose4hr >= haOpen4hr then 1 else if haClose4hr[1] < haOpen4hr[1] then -1 else 0;
def Trend6 = if  haCloseday >= haOpenday then 1 else if haCloseday[1] < haOpenday[1] then -1 else 0;

#Down Trend
def Trend1a = if haClose5 < haOpen5 then 1 else if haClose5[1] >= haOpen5[1] then -1 else 0;
def Trend2b = if haClose15 < haOpen15 then 1 else if haClose15[1] >= haOpen15[1] then -1 else 0;
def Trend3c = if haClose30 < haOpen30 then 1 else if haClose30[1] >= haOpen30[1] then -1 else 0;
def Trend4d = if haClose60 < haOpen60  then 1 else if haClose60[1] >= haOpen60[1] then -1 else 0;
def Trend5e= if haClose4hr < haOpen4hr then 1 else if haClose4hr[1] >= haOpen4hr[1] then -1 else 0;
def Trend6f = if  haCloseday < haOpenday  then 1 else if haCloseday[1] >= haOpenday[1] then -1 else 0;

#plot MTF_TREND = 6;
#MTF_TREND.SetPaintingStrategy(PaintingStrategy.Points);
#MTF_TREND.SetLineWeight(lineWeight = 3);
#MTF_TREND.DefineColor("Buy", GetColor(5));
#MTF_TREND.DefineColor("Sell", GetColor(6));
#MTF_TREND.AssignValueColor(if (Trend1 + Trend2 + Trend3 + Trend4 + Trend5_) >= 3 then Color.GREEN else Color.RED);

#MTF_TREND.AssignValueColor(if PaintBars is false and (Trend1 + Trend2 + Trend3 + Trend4 + Trend5_) >= 3 #then Color.GREEN else if PaintBars is false and (Trend1 + Trend2 + Trend3 + Trend4 + Trend5_) < 3 then #Color. RED else color.current);

def HA_MTF_TrendUP = (Trend1 + Trend2 + Trend3 + Trend4) >=  Con_Cri ;
def HA_MTF_TrendDN = (Trend1a + Trend2b + Trend3c + Trend4d) >=  Con_Cri;

plot Main_Heikin = 7;
Main_Heikin.SetPaintingStrategy(PaintingStrategy.POINTS);
Main_Heikin.AssignValueColor(if HA_MTF_TrendUP == 1 then Color.Green else if HA_MTF_TrendDN == 1 then color.red else Color.Black);
Main_Heikin.SetLineWeight(4);
Main_Heikin.SetDefaultColor(color.black);

#End code
 
@RickK.... thank you for making the change.

@everyone... another alternative that I referenced earlier is to minimize your right expansion area. Please see below. As you can see I have my expansion area set at 5. You can set it to zero etc. and it will remove the colors as well as the the black area (those who are interested in the aesthetics.

GEAxupH.jpg
 
Hi @BonBon ... stellar enhancements! Thanks again.

Say, would you be willing to share your scan query? I can't seem to get it to work based on the criteria you stated in post #1 and I don't recall seeing it addressed elsewhere.

I understand though if you'd prefer to keep that under wraps. :)
@RickK..... I will definitely share with everyone along with the watchlist.

@everyone, if you experimented with the signals you would realize some of the appear late (the zigzag and swing). You have to determine how you want to use them and/or minimize the reversal swings etc. in the code. There are threads and forums you can use to reference the swing highs/lows, etc. If anyone finds an alternative please share.

I tend to use the zigzag signal to identify the low swing which also signals the end of the pullback or retracement (I tend to use the fib to identify retracement levels with gappers ). This signals that the HA_ trend signal is about to appear and helps my entry (buy low sell high) which puts me in a favorable position.
 
@RickK..... I will definitely share with everyone along with the watchlist.

@everyone, if you experimented with the signals you would realize some of the appear late (the zigzag and swing). You have to determine how you want to use them and/or minimize the reversal swings etc. in the code. There are threads and forums you can use to reference the swing highs/lows, etc. If anyone finds an alternative please share.

I tend to use the zigzag signal to identify the low swing which also signals the end of the pullback or retracement (I tend to use the fib to identify retracement levels with gappers ). This signals that the HA_ trend signal is about to appear and helps my entry (buy low sell high) which puts me in a favorable position.
Hi BonBon just a quick question. I am new to this and I feel stupid asking but if I don't ask then I will never learn. Can you please explain to me the 3 signals that are built into the script from post #134. Do I have to physically go in and remove #'s on each one to use? What are the 3 signals exactly?
I looked thru the script and I don't understand how to implement the changes. Any help is appreciated. Thanks and sorry to bother.
 
is the MTF indicator correctly? if i look at a one day 5 minute chart i get diffferent readings than if i look at the a 5 day 5 minute, i should get the same readings for the current candle right?
 
is the MTF indicator correctly? if i look at a one day 5 minute chart i get diffferent readings than if i look at the a 5 day 5 minute, i should get the same readings for the current candle right?
@germanburrito .... please ensure your timeframes are correct. If using a 1D 1M you must also use a 1D 5M timeframe when checking for accuracy of the plots. Also, when the one minute is plotting the 5 minute time frame, the 5 minute will show the current color (which may be blue, pink etc. based on the original code). I hope my explanation helps.
 
@germanburrito .... please ensure your timeframes are correct. If using a 1D 1M you must also use a 1D 5M timeframe when checking for accuracy of the plots. Also, when the one minute is plotting the 5 minute time frame, the 5 minute will show the current color (which may be blue, pink etc. based on the original code). I hope my explanation helps.
U38vjp7.png




look at this charts one is set for a 5 day 5 minute and the other for a one day 5 minute, they should both read the same for the current day on bigger time frames, right? if not something might not be accurate. am i missing something?
 
@germanburrito.... Please see below.. this chart shows a 1 day 1 min and 1 day 5 min. This is the script from #134. Line 6 is the 5 minute timeframe on both charts. The times coincide. Did you make any changes to the original script? What about settings etc.?

https%3A//i.imgur.com/l5VtkQ6.jpg[/img]']
l5VtkQ6.jpg
 
U38vjp7.png




look at this charts one is set for a 5 day 5 minute and the other for a one day 5 minute, they should both read the same for the current day on bigger time frames, right? if not something might not be accurate. am i missing something?

@germanburrito , check to see if they read the same if you have regular candles on both charts. The HA candles on the right might throw things off with the OHLC. Just guessing.
 
@BonBon I'm still testing this in paper account to understand the value and how to use it effectively, couple of requests -

Fibonocci study on your chart is really great, is it possible for you to just share that study (tos link will be great.. if not code is fine too)

I know you mentioned about sharing scan query some time soon, it might be of great help for someone like a beginner to start on the right track.!
 
Last edited:
I am not able to get the same settings as posted in #134, the fib study does not show up. Not sure what is incorrect. I did split the MTF to lower study and that looks good. But not able to get the 3rd (lower most) signals on my charts. Dr. BonBon, don't want too overload you with questions, but do respond when you can, no rush. I am not a coder (not even close) Thanks for all the contributions.
 
@everyone .... here's a very slight enhancement to the Multi time-frame Heikin (lower) study for those who might be confused by the multi color scheme for the dots to the right of the current minute. I set the default color to black.


Code:
# Multi time-frame Heikin
#BonBon 1/29/21
#  Four hours and Day MTF not included in the top plot. Three or more of the indicators must be green or red to plot.


declare lower;

input UsePeriod5 = AggregationPeriod.FIVE_MIN;
input UsePeriod15 = AggregationPeriod.FIFTEEN_MIN;
input UsePeriod30 = AggregationPeriod.thirty_MIN;
input UsePeriod60 = AggregationPeriod. HOUR;
input UsePeriod4hr = AggregationPeriod. FOUR_HOURS;
input UsePeriodday = AggregationPeriod.DAY;

input  Con_Cri = 3;

input Main_Heikin_Plot = Yes;


#Timeframe1 5 min

def aOpen5 = open(period = UsePeriod5);
def aClose5 = close(period = UsePeriod5);
def aHigh5 = high(period = UsePeriod5);
def aLow5 = low(period = UsePeriod5);

def haClose5 = (aOpen5 + aClose5 + aHigh5 + aLow5) / 4;
def haOpen5 = (haOpen5[1] + haClose5[1]) / 2;

def trend5 = if haClose5 >= haOpen5 then 1 else if haClose5[1] < haOpen5[1] then -1 else 0;
plot HA_Up5 = if IsNaN(UsePeriod5) then Double.NaN else 6;
HA_Up5.SetPaintingStrategy(PaintingStrategy.POINTS);#SetStyle(curve.Points);
HA_Up5.AssignValueColor(if haClose5 >= haOpen5 then Color.GREEN else if haClose5[1] < haOpen5[1] then Color.RED else color.current);
HA_Up5.SetLineWeight(4);
HA_Up5.SetDefaultColor(color.black);
############################################

#Timeframe2 15 mins

def aOpen15 = open(period = UsePeriod15);
def aClose15 = close(period = UsePeriod15);
def aHigh15 = high(period = UsePeriod15);
def aLow15 = low(period = UsePeriod15);

def haClose15 = (aOpen15 + aClose15 + aHigh15 + aLow15) / 4;
def haOpen15 = (haOpen15[1] + haClose15[1]) / 2;


def trend15 = if haClose15 >= haOpen15 then 1 else if haClose15[1] < haOpen15[1] then -1 else 0;
plot HA_Up15 = if IsNaN(UsePeriod15) then Double.NaN else 5;
#plot HA_Up15 = if haClose15 >= haOpen15 then 1 else 0;
HA_Up15.SetPaintingStrategy(PaintingStrategy.Points);#SetStyle(Curve.POINTS);
HA_Up15.AssignValueColor(if haClose15 >= haOpen15 then Color.GREEN else if haClose15 [1]< haOpen15[1] then Color.RED else color.current);
HA_Up15.SetLineWeight(4);
HA_Up15.SetDefaultColor(color.black);
#######################################

#Timeframe3  30 mins

def aOpen30 = open(period = UsePeriod30);
def aClose30 = close(period = UsePeriod30);
def aHigh30 = high(period = UsePeriod30);
def aLow30 = low(period = UsePeriod30);

def haClose30 = (aOpen30 + aClose30 + aHigh30 + aLow30) / 4;
def haOpen30 = (haOpen30[1] + haClose30[1]) / 2;


def trend30 = if haClose30 >= haOpen30 then 1 else if haClose30[1] < haOpen30[1] then -1 else 0;
plot HA_Up30 = if IsNaN(UsePeriod30) then Double.NaN else 4;
#plot HA_Up60 = if haClose60 >= haOpen60 then 1 else 0;
HA_Up30.SetPaintingStrategy(PaintingStrategy.Points);#SetStyle(Curve.POINTS);
HA_Up30.AssignValueColor(if haClose30 >= haOpen30 then Color.GREEN else if haClose30[1] < haOpen30[1] then Color.RED else color.current);
HA_Up30.SetLineWeight(4);
HA_Up30.SetDefaultColor(color.black);

################################
#Timeframe4  60mins

def aOpen60 = open(period = UsePeriod60);
def aClose60 = close(period = UsePeriod60);
def aHigh60 = high(period = UsePeriod60);
def aLow60 = low(period = UsePeriod60);

def haClose60 = (aOpen60 + aClose60 + aHigh60 + aLow60) / 4;
def haOpen60 = (haOpen60[1] + haClose60[1]) / 2;

def trend60 = if haClose60 >= haOpen60 then 1 else if haClose60[1] < haOpen60[1] then -1 else 0;
plot HA_Up60 = if IsNaN(UsePeriod60) then Double.NaN else 3;
#plot HA_Up60 = if haClose60 >= haOpen60 then 1 else 0;
HA_Up60.SetPaintingStrategy(PaintingStrategy.Points);#SetStyle(Curve.POINTS);
HA_Up60.AssignValueColor(if haClose60 >= haOpen60 then Color.GREEN else if haClose60[1] < haOpen60[1] then Color.RED else color.current);
HA_Up60.SetLineWeight(4);
HA_Up60.SetDefaultColor(color.black);
##################################
#Timeframe5 4hrs

def aOpen4hr = open(period = UsePeriod4hr);
def aClose4hr = close(period = UsePeriod4hr);
def aHigh4hr = high(period = UsePeriod4hr);
def aLow4hr = low(period = UsePeriod4hr);

def haClose4hr = (aOpen4hr + aClose4hr + aHigh4hr + aLow4hr) / 4;
def haOpen4hr = (haOpen4hr[1] + haClose4hr[1]) / 2;

def trend4hr = if haClose4hr >= haOpen4hr then 1 else if haClose4hr < haOpen4hr then -1 else 0;
plot HA_Up4hr = if IsNaN(UsePeriod4hr) then Double.NaN else 2;
#plot HA_Up60 = if haClose60 >= haOpen60 then 1 else 0;
HA_Up4hr.SetPaintingStrategy(PaintingStrategy.Points);#SetStyle(Curve.POINTS);
HA_Up4hr.AssignValueColor(if haClose4hr >= haOpen4hr then Color.GREEN else if haClose4hr[1] < haOpen4hr[1] then Color.RED else color.current);
HA_Up4hr.SetLineWeight(4);
HA_Up4hr.SetDefaultColor(color.black);
#######################################

#Timeframe6 Day

def aOpenday = open(period = UsePeriodday);
def aCloseday = close(period = UsePeriodday);
def aHighday = high(period = UsePeriodday);
def aLowday = low(period = UsePeriodday);

def haCloseday = (aOpenday + aCloseday + aHighday + aLowday) / 4;
def haOpenday = (haOpenday[1] + haCloseday[1]) / 2;

def trendday = if haCloseday >= haOpenday then 1 else if haCloseday [1] < haOpenday[1] then -1 else 0;
plot HA_Upday = if IsNaN(UsePeriodday) then Double.NaN else 1;
#plot HA_Up60 = if haClose60 >= haOpen60 then 1 else 0;
HA_Upday.SetPaintingStrategy(PaintingStrategy.Points);#SetStyle(Curve.POINTS);
HA_Upday.AssignValueColor(if haCloseday >= haOpenday then Color.GREEN else if haCloseday[1] < haOpenday[1] then Color.RED else color.current);
HA_Upday.SetLineWeight(4);
HA_Upday.SetDefaultColor(color.black);

####################################
#def Trend1 = if haClose5 >= haOpen5 then 1 else if haClose5[1] < haOpen5[1] then -1 else 0;
#def Trend2 = if haClose15 >= haOpen15 then 1 else if haClose15[1] < haOpen15[1] then -1 else 0;
#def Trend3 = if haClose60 >= haOpen60 then 1 else if haClose60[1] < haOpen60[1] then -1 else 0;
#def Trend4 = if haClose4hr >= haOpen4hr then 1 else if haClose4hr[1] < haOpen4hr[1] then -1 else 0;
#def Trend5_ = if  haCloseday >= haOpenday then 1 else if haCloseday[1] < haOpenday[1] then -1 else 0;

#Down Trend
#def Trend1a = if haClose5 < haOpen5 then 1 else if haClose5[1] >= haOpen5[1] then -1 else 0;
#def Trend2b = if haClose15 < haOpen15 then 1 else if haClose15[1] >= haOpen15[1] then -1 else 0;
#def Trend3c = if haClose60 < haOpen60  then 1 else if haClose60[1]>= haOpen60[1] then -1 else 0;
#def Trend4d = if haClose4hr < haOpen4hr then 1 else if haClose4hr[1] >= haOpen4hr[1] then -1 else 0;
#def Trend5e = if  haCloseday < haOpenday  then 1 else if haCloseday[1] >= haOpenday[1] then -1 else 0;

#Up Trend
def Trend1 = if haClose5 >= haOpen5 then 1 else if haClose5[1] < haOpen5[1] then -1 else 0;
def Trend2 = if haClose15 >= haOpen15 then 1 else if haClose15[1] < haOpen15[1] then -1 else 0;
def Trend3 = if haClose30>= haOpen30 then 1 else if haClose30[1] < haOpen30[1] then -1 else 0;
def Trend4 = if haClose60 >= haOpen60 then 1 else if haClose60[1] < haOpen60[1] then -1 else 0;
def Trend5_ = if haClose4hr >= haOpen4hr then 1 else if haClose4hr[1] < haOpen4hr[1] then -1 else 0;
def Trend6 = if  haCloseday >= haOpenday then 1 else if haCloseday[1] < haOpenday[1] then -1 else 0;

#Down Trend
def Trend1a = if haClose5 < haOpen5 then 1 else if haClose5[1] >= haOpen5[1] then -1 else 0;
def Trend2b = if haClose15 < haOpen15 then 1 else if haClose15[1] >= haOpen15[1] then -1 else 0;
def Trend3c = if haClose30 < haOpen30 then 1 else if haClose30[1] >= haOpen30[1] then -1 else 0;
def Trend4d = if haClose60 < haOpen60  then 1 else if haClose60[1] >= haOpen60[1] then -1 else 0;
def Trend5e= if haClose4hr < haOpen4hr then 1 else if haClose4hr[1] >= haOpen4hr[1] then -1 else 0;
def Trend6f = if  haCloseday < haOpenday  then 1 else if haCloseday[1] >= haOpenday[1] then -1 else 0;

#plot MTF_TREND = 6;
#MTF_TREND.SetPaintingStrategy(PaintingStrategy.Points);
#MTF_TREND.SetLineWeight(lineWeight = 3);
#MTF_TREND.DefineColor("Buy", GetColor(5));
#MTF_TREND.DefineColor("Sell", GetColor(6));
#MTF_TREND.AssignValueColor(if (Trend1 + Trend2 + Trend3 + Trend4 + Trend5_) >= 3 then Color.GREEN else Color.RED);

#MTF_TREND.AssignValueColor(if PaintBars is false and (Trend1 + Trend2 + Trend3 + Trend4 + Trend5_) >= 3 #then Color.GREEN else if PaintBars is false and (Trend1 + Trend2 + Trend3 + Trend4 + Trend5_) < 3 then #Color. RED else color.current);

def HA_MTF_TrendUP = (Trend1 + Trend2 + Trend3 + Trend4) >=  Con_Cri ;
def HA_MTF_TrendDN = (Trend1a + Trend2b + Trend3c + Trend4d) >=  Con_Cri;

plot Main_Heikin = 7;
Main_Heikin.SetPaintingStrategy(PaintingStrategy.POINTS);
Main_Heikin.AssignValueColor(if HA_MTF_TrendUP == 1 then Color.Green else if HA_MTF_TrendDN == 1 then color.red else Color.Black);
Main_Heikin.SetLineWeight(4);
Main_Heikin.SetDefaultColor(color.black);

#End code
Hey Rick, your code works great on 1 minute or 5 minute chart. But when I got to 10 minute or 15 minute or higher, nothing shows up...its blank. Do you know why? Thanks in advance.
 
@BonBon Love it it looks very promising. Thanks for the work and sharing. New to this completely been trading for yrs. But with tradestation. Could you please be able to get this to be a scan whenever you have the time, thanks ever so much.
 
Last edited by a moderator:

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