#### MBF

##### Active member

**2019 Donor**

Does anyone know if this indi is out there somewhere? It's a beautiful thing.

Does anyone know if this indi is out there somewhere? It's a beautiful thing.

T

@MBF Here is a Heiken Ashi Moving Average study you may like to check out. Feel free to edit the length of the moving average to suit your requirements

# START

def length = 8;

def HAopen;

def HAhigh;

def HAlow;

def HAclose;

HAopen = CompoundValue(1, (haopen[1] + haclose[1]) / 2, (open[1] + close) / 2);

HAhigh = Max(high, close[1]);

HAlow = Min(low, close[1]);

HAclose = (HAopen + HAclose[1] + HAlow + close) / 4;

AssignPriceColor(if HAclose > HAopen then Color.GREEN else color.RED);

plot HAMA = Average(HAclose, length);

# END

# START

def length = 8;

def HAopen;

def HAhigh;

def HAlow;

def HAclose;

HAopen = CompoundValue(1, (haopen[1] + haclose[1]) / 2, (open[1] + close) / 2);

HAhigh = Max(high, close[1]);

HAlow = Min(low, close[1]);

HAclose = (HAopen + HAclose[1] + HAlow + close) / 4;

AssignPriceColor(if HAclose > HAopen then Color.GREEN else color.RED);

plot HAMA = Average(HAclose, length);

# END

Last edited:

Thank you!!!@MBF Here is a Heiken Ashi Moving Average study you may like to check out. Feel free to edit the length of the moving average to suit your requirements

# START

def length = 8;

def HAopen;

def HAhigh;

def HAlow;

def HAclose;

HAopen = CompoundValue(1, (haopen[1] + haclose[1]) / 2, (open[1] + close) / 2);

HAhigh = Max(high, close[1]);

HAlow = Min(low, close[1]);

HAclose = (HAopen + HAclose[1] + HAlow + close) / 4;

AssignPriceColor(if HAclose > HAopen then Color.GREEN else color.RED);

plot HAMA = Average(close, length);

# END

S

back to your question. There is this study I made while playing with HKA - it color candles pink when there is HKA trend transition. It can be used both on regular and HKA charts

Code:

```
#HK
#Use bar to figure trendDown or confirm.
#heikin ashi bars. close=OHLC/4. open=1/2(open[1]+close[1]) and HA trend
#
def haclose = (open + high + low + close) / 4;
def haopen = CompoundValue(1, (haopen[1] + haclose[1]) / 2, (open[1] + close[1]) / 2);
def hahigh=max(open,max(close,high));def halow=min(open,min(close,high));
def HAtrendUP = haclose > haclose[1];
def upBar = if HAtrendUP then upBar[1] + 1 else 0;
def HATrendDown = haclose <= haclose[1];
def downBar = if HATrendDown then downBar[1] + 1 else 0;
def bars = upBar + downBar;
#the one with body small relative to wicks . let say less than 0.3
def HAtransition=absvalue((haopen-haclose)/(hahigh-halow))<0.3;
def HARed = HAOpen > HAclose;
def HAGreen = !HARed;
def HADecidedRed = HARed and HAHigh == HAopen;
def HADecidedGreen = HAGreen and HAlow == HAOpen;
plot data=0;
#
AssignPriceColor( if hatransition then color.MAGENTA
else Color.CURRENT);
```

@skynetgen Thank you I will take it for a spin!

Take a look at this beauty.

Take a look at this beauty.

S

p.s. I am now of opinion that inidcator based on the single timeframe can never do that. In fact probably no indicator can do that with high probability if its single timeframe, price action based only. There are other factors which determine that.

I really get that but, say you were to apply the RVOL condition? Knowing that a stock will trend one way the other might be helpful in at least picking stocks for the day that have a higher probability to trend.

p.s. I am now of opinion that inidcator based on the single timeframe can never do that. In fact probably no indicator can do that with high probability if its single timeframe, price action based only. There are other factors which determine that.

S

yeah. Since you mentioned SMB capital ( I watched their videos a lot) - its what they call "stocks in play". Stocks with catalyst, and rvol etc. One problem with RVOL in TOS - it doesnt have one. You need something which will show relative volume AT TIME OF DAY compared to average volume done at this time of day.I really get that but, say you were to apply the RVOL condition? Knowing that a stock will trend one way the other might be helpful in at least picking stocks for the day that have a higher probability to trend.

And yeah playing stock in play increased the odds of "something" happening. However what actually happens - it might be varied chop and then trend. it might be trend which is gone and done by 945 and then chop. It might be both way fakeouts and then sqz sideways. Many things. So you would narrow down to "something happening" (maybe!) but still problem of knowing when trend starts and not of various fakeouts/chops remains.

I been doing stocks in play for a while now - its far from easy! (at least for me)

S

To find stocks in play I use simply premarket gapper approach . Filtering by price, capitalization and average volume per day (to weed out penny and/ or illiquid stocks). Out of average 15-30 names which pop on scanners 2-4 stocks I pick have at least one mover "stock in play". That is done premarket so I dont have to scramble with scans intraday

here is this very simple scan: http://tos.mx/WXUxaCb

another proxy for stocks in play I use is sizzle index. (>2 is wide critera, >5 picks something with big catalyst practically every day)

I sure like this moving average ty@MBF Here is a Heiken Ashi Moving Average study you may like to check out. Feel free to edit the length of the moving average to suit your requirements

# START

def length = 8;

def HAopen;

def HAhigh;

def HAlow;

def HAclose;

HAopen = CompoundValue(1, (haopen[1] + haclose[1]) / 2, (open[1] + close) / 2);

HAhigh = Max(high, close[1]);

HAlow = Min(low, close[1]);

HAclose = (HAopen + HAclose[1] + HAlow + close) / 4;

AssignPriceColor(if HAclose > HAopen then Color.GREEN else color.RED);

plot HAMA = Average(close, length);

# END

Thank you @skynetgen!To find stocks in play I use simply premarket gapper approach . Filtering by price, capitalization and average volume per day (to weed out penny and/ or illiquid stocks). Out of average 15-30 names which pop on scanners 2-4 stocks I pick have at least one mover "stock in play". That is done premarket so I dont have to scramble with scans intraday

here is this very simple scan: http://tos.mx/WXUxaCb

another proxy for stocks in play I use is sizzle index.

I don't really understand that last part,

(>2 is wide critera, >5 picks something with big catalyst practically every day).

S

if you add stocks to your watchlist and add sizzle index column just sort by it . - indicates increased activity - basically a proxy to relvol (very often you will see significantly increased volume on those stocks)Thank you @skynetgen!

I don't really understand that last part,

(>2 is wide critera, >5 picks something with big catalyst practically every day).

S

@MBF Here is a Heiken Ashi Moving Average study you may like to check out. Feel free to edit the length of the moving average to suit your requirements

# START

def length = 8;

def HAopen;

def HAhigh;

def HAlow;

def HAclose;

HAopen = CompoundValue(1, (haopen[1] + haclose[1]) / 2, (open[1] + close) / 2);

HAhigh = Max(high, close[1]);

HAlow = Min(low, close[1]);

HAclose = (HAopen + HAclose[1] + HAlow + close) / 4;

AssignPriceColor(if HAclose > HAopen then Color.GREEN else color.RED);

plot HAMA = Average(close, length);

# END

There is small bug here (uses close isntead of haclose). Anyhow this HA code works better than one I was using before. Integrated it with my transition code

tos.mx

T

def length = 8;

def HAopen;

def HAhigh;

def HAlow;

def HAclose;

HAopen = CompoundValue(1, (haopen[1] + haclose[1]) / 2, (open[1] + close) / 2);

HAhigh = Max(high, close[1]);

HAlow = Min(low, close[1]);

HAclose = (HAopen + HAclose[1] + HAlow + close) / 4;

AssignPriceColor(if HAclose > HAopen then Color.GREEN else color.RED);

plot HAMA = Average(HAclose, length);

@skynetgen - Like your transitions.There is small bug here (uses close isntead of haclose). Anyhow this HA code works better than one I was using before. Integrated it with my transition code

## ThinkScript study_20191110

tos.mx

The green line is the HA_MA and the cyan/brn line is the VWMA

H

T

# Mobius

# SuperTrend HeikenAshi

# V03.10.2015

# Up = (HIGH + LOW) / 2 + Multiplier * ATR

# Down = (HIGH + LOW) / 2 – Multiplier * ATR

# When the change of trend occurs, the indicator flips

input AtrMult = .70;

input nATR = 4;

input AvgType = AverageType.HULL;

input PaintBars = yes;

input BubbleOn = no;

input ShowLabel = no;

input AlertOn = no;

input PlotLine = no;

def HAopen;

def HAhigh;

def HAlow;

def HAclose;

HAopen = CompoundValue(1, (haopen[1] + haclose[1]) / 2, (open[1] + close) / 2);

HAhigh = Max(high, close[1]);

HAlow = Min(low, close[1]);

haclose = (HAopen + HAclose[1] + HAlow + close) / 4;

def v = volume;

def bar = barNumber();

def EOD = if SecondsTillTime(1545) == 0 and

SecondsFromTime(1545) == 0

then 1

else 0;

def NotActive = if SecondsFromTime(1545) > 0

then 1

else 0;

def ATR = MovingAverage(AvgType, TrueRange(HAhigh, HAclose, HAlow), nATR);

def UP = HL2 + (AtrMult * ATR);

def DN = HL2 + (-AtrMult * ATR);

def ST = if close < ST[1]

then Round(UP / tickSize(), 0) * tickSize()

else Round(DN / tickSize(), 0) * tickSize();

plot SuperTrend = ST;

SuperTrend.SetHiding(!PlotLine);

SuperTrend.AssignValueColor(if close < ST then Color.RED else Color.GREEN);

SuperTrend.SetPaintingStrategy(PaintingStrategy.Line);

AssignPriceColor(if PaintBars and close < ST

then Color.RED

else if PaintBars and close > ST

then Color.GREEN

else Color.CURRENT);

plot ST_point = if isNaN(close[-1])

then ST

else double.nan;

ST_point.SetStyle(Curve.Points);

ST_point.SetLineWeight(3);

ST_point.SetDefaultColor(Color.Yellow);

# End Code SuperTrend HeikenAshi

H

@tomsk woah...OK this is interesting...I will be testing this out! Thank You!

Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|

W | Heiken Ashi conditional order at close of bar? | Questions | 3 | |

S | Strategy based on Heiken Ashi Moving Average | Questions | 4 | |

MA Colored Heiken Ashi Trend with PaintBars for ThinkorSwim | Indicators | 6 | ||

A Re-Painting Heiken MTF Strategy | Strategies | 49 | ||

W | Heiken-Ashi Based on MACD Indicator for ThinkorSwim | Custom | 1 |