MACD-EMA Strategy For ThinkOrSwim

Koolkth1

New member
I'm looking for help coding an indicator based on an intraday trading strategy I've been using.

The strategy:
  • Basically I use (3) Time frames; 1 min, 3 min and 5 min.
  • I use EMA's (3, 8 and 20), price action and Momentum on each time frame to time my entries.
  • (Photo attached) I wait for the 3 and 8 EMA to cross, this is "get ready" the I wait for Price to breach and close below the 20 EMA on each time frame to enter and I look for confirmation of momentum in that same direction (on each time frame) to enter. When the 3 and 8 EMA's cross the 20 EMA it further confirms direction.
On a simple/beta script, I'd like to have some kind of Arrow and Alert paint on each chart when all parameters are met. Maybe, blue when the 3 and 8 cross, then green when price breaches the 20 then Yellow when the 3 and 8 cross the 20. I think it would also be cool to indicate bearish and bullish runs and the arrows would paint in the direction price will travel. Also the last arrow, Green for bullish plays and red for bearish plays.


 
Last edited:

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

Here is a Bullish Example, you can see the 1 min will breach the 20 at times but the 3 min and 5 min take longer. The trade entry criteia relys on all charts 1,3 and 5 min to all have crossed the 20EMA AND the Momentum indicator needs to be slanted in the direction of price, in this example, slanted in an upward angle. This results in a higher probability run and higher breakout.

 
Price Bullish: 3 EMA crosses above 8 EMA on all (3) time frames. It would be great if the script can be placed on all (3) charts and work, while taking the other times frames into account, however, if it can only be placed on the 1 min chart while taking the other timeframes into account, then that would still work. (Maybe a white arrow in the direction of the trade when the 3 crosses above the 8 ema on all time frames.

Then when Price crosses the 20 EMA on all time frames paint a Yellow arrow in the direction on the trade. (sometimes price crosses and then fails)

The 3rd and final arrow would be when the 3 EMA crosses above the 20 EMA (Green arrow for Bullish) (Red arrow for Bearish)

In regards to the MACD, the oscillator within the MACD is used for determining momentum. Sometimes all the above criteria will be met, however, the oscillator will stay flat and the breakout will fail. When the oscillator is angled in the direction of the breakout on all (3) time frames, the move has a much higher probability of breaking out to higher highs.
 
Last edited by a moderator:
Hey @Koolkth1,

Ok so here is the first version... let me know what you think.

Looks very busy as there are many crosses, specially on the 1m time frame.

Please feel free to modify the colors... and I have bubbles instead of arrows in the code but I have edited them out (remove the #'s).

3 > 5 = White Arrow
3 < 5 = Cyan Arrow

3 > 20 = Green Arrow
3 < 20 = Red Arrow

20 > Price = Yellow Arrow
20 < Price = Magenta Arrow

I also have labels for each crossover... feel free to edit them out as well if you don't want them and let me know if you find any errors or need adjustments.
Code:
#My3820EMACrossover

declare upper;

input price = close;
input Length1 = 3;
input Length2 = 8;
input Length3 = 20;
input displace = 0;
input showBreakoutSignals = no;

plot AvgExp1 = ExpAverage(price[-displace], length1);
plot AvgExp2 = ExpAverage(price[-displace], length2);
plot AvgExp3 = ExpAverage(price[-displace], length3);

plot UpSignal1 = price crosses above AvgExp1;
plot DownSignal1 = price crosses below AvgExp1;

plot UpSignal2 = price crosses above AvgExp2;
plot DownSignal2 = price crosses below AvgExp2;

plot UpSignal3 = price crosses above AvgExp3;
plot DownSignal3 = price crosses below AvgExp3;

UpSignal1.SetHiding(!showBreakoutSignals);
DownSignal1.SetHiding(!showBreakoutSignals);

UpSignal2.SetHiding(!showBreakoutSignals);
DownSignal2.SetHiding(!showBreakoutSignals);

UpSignal3.SetHiding(!showBreakoutSignals);
DownSignal3.SetHiding(!showBreakoutSignals);

AvgExp1.SetDefaultColor(color.uptick);
UpSignal1.SetDefaultColor(Color.UPTICK);
UpSignal1.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
DownSignal1.SetDefaultColor(Color.DOWNTICK);
DownSignal1.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

AvgExp2.SetDefaultColor(color.Yellow);
UpSignal2.SetDefaultColor(Color.uptick);
UpSignal2.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
DownSignal2.SetDefaultColor(Color.downtick);
DownSignal2.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

AvgExp3.SetDefaultColor(color.downtick);
UpSignal3.SetDefaultColor(Color.uptick);
UpSignal3.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
DownSignal3.SetDefaultColor(Color.DOWNTICK);
DownSignal3.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

def emaValue1 = movavgExponential (close, Length1);
def emaValue2 = movavgExponential (close, Length2);
def emaValue3 = movavgExponential (close, Length3);

def CrossoverUp1 = emaValue1 [1] < emaValue2 [1] and emaValue1 > emaValue2;
def CrossoverDn1 = emaValue1 [1] > emaValue2 [1] and emaValue1 < emaValue2;
def Diff1 = emavalue1 - emavalue2;

def CrossoverUp2 = emaValue1 [1] < emaValue3 [1] and emaValue1 > emaValue3;
def CrossoverDn2 = emaValue1 [1] > emaValue3 [1] and emaValue1 < emaValue3;
def Diff2 = emavalue1 - emavalue3;

# EMA3 and EMA8 Crossover

Plot ArrowUp1 = if emaValue1 crosses above emaValue2
then low
else double.nan;
ArrowUP1.SetPaintingStrategy(PaintingStrategy.Arrow_UP);
ArrowUP1.SetLineWeight(3);
ArrowUP1.SetDefaultColor(Color.white);
plot ArrowDN1 = if emaValue1 crosses below emaValue2
then high
else double.nan;
ArrowDN1.SetPaintingStrategy(PaintingStrategy.Arrow_DOWN);
ArrowDN1.SetLineWeight(3);
ArrowDN1.SetDefaultColor(Color.Cyan);

AddLabel(emavalue1 > emavalue2, "3up|$" + Round(Diff1,3), Color.Green);
AddLabel(emavalue1 < emavalue2, "8up|$" + Round(Diff1,3), Color.Red);

# EMA3 and EMA8 Crossover bubbles

#def condup1 = if emaValue1 [1] < emaValue2 [1] and emaValue1 > emaValue2 then BarNumber() else Double.NaN;
#input bubblemover_up1 = 3;#Moves bubbles up or down away from other candles
#AddChartBubble(BarNumber() == condup1,
# emaValue2 - bubblemover_up1 * TickSize(),
# "3up",
# Color.uptick, no);

#def conddown1 = if emaValue1 [1] > emaValue2 [1] and emaValue1 < emaValue2 then BarNumber() else Double.NaN;
#input bubblemover_down1 = 3;#Moves bubbles up or down away from other candles
#AddChartBubble(BarNumber() == conddown1,
# emaValue2 - bubblemover_up1 * TickSize(),
# "8up",
# Color.downtick, no);

# EMA3 and EMA20 Crossover

Plot ArrowUp2 = if emaValue1 crosses above emaValue3
then low
else double.nan;
ArrowUP2.SetPaintingStrategy(PaintingStrategy.Arrow_UP);
ArrowUP2.SetLineWeight(3);
ArrowUP2.SetDefaultColor(Color.Green);
plot ArrowDN2 = if emaValue1 crosses below emaValue3
then high
else double.nan;
ArrowDN2.SetPaintingStrategy(PaintingStrategy.Arrow_DOWN);
ArrowDN2.SetLineWeight(3);
ArrowDN2.SetDefaultColor(Color.Red);

AddLabel(emavalue1 > emavalue3, "3up|$" + Round(Diff2,3), Color.Green);
AddLabel(emavalue1 < emavalue3, "20up|$" + Round(Diff2,3), Color.Red);

# EMA3 and EMA20 Crossover bubbles

#def condup2 = if emaValue1 [1] < emaValue3 [1] and emaValue1 > emaValue3 then BarNumber() else Double.NaN;
#input bubblemover_up2 = 3;#Moves bubbles up or down away from other candles
#AddChartBubble(BarNumber() == condup2,
# emaValue3 - bubblemover_up2 * TickSize(),
# "3up",
# Color.uptick, no);

#def conddown2 = if emaValue1 [1] > emaValue3 [1] and emaValue1 < emaValue3 then BarNumber() else Double.NaN;
#input bubblemover_down2 = 3;#Moves bubbles up or down away from other candles
#AddChartBubble(BarNumber() == conddown2,
# emaValue3 - bubblemover_up2 * TickSize(),
# "8up",
# Color.downtick, no);

# EMA20 and Price Crossover

def Diff3 = emavalue3 - price;
Plot ArrowUp3 = if emaValue3 crosses above price
then low
else double.nan;
ArrowUP3.SetPaintingStrategy(PaintingStrategy.Arrow_UP);
ArrowUP3.SetLineWeight(3);
ArrowUP3.SetDefaultColor(Color.Yellow);
plot ArrowDN3 = if emaValue3 crosses below price
then high
else double.nan;
ArrowDN3.SetPaintingStrategy(PaintingStrategy.Arrow_DOWN);
ArrowDN3.SetLineWeight(3);
ArrowDN3.SetDefaultColor(Color.magenta);

AddLabel(emavalue3 > Price, "3up|$" + Round(Diff3,3), Color.Green);
AddLabel(emavalue3 < Price, "Priceup|$" + Round(Diff3,3), Color.Red);

# EMA20 and Price Crossover bubbles

#def condup3 = if emaValue3 [1] < price [1] and emaValue3 > price then BarNumber() else Double.NaN;
#input bubblemover_up3 = 3;#Moves bubbles up or down away from other candles
#AddChartBubble(BarNumber() == condup3,
# price - bubblemover_up3 * TickSize(),
# "3up",
# Color.uptick, no);

#def conddown3 = if emaValue3 [1] > price [1] and emaValue3 < price then BarNumber() else Double.NaN;
#input bubblemover_down3 = 3;#Moves bubbles up or down away from other candles
#AddChartBubble(BarNumber() == conddown3,
# price - bubblemover_up3 * TickSize(),
# "Priceup",
# Color.downtick, no);
 
Last edited by a moderator:
Hey @Koolkth1,

Ok so here is the first version... let me know what you think.

Looks very busy as there are many crosses, specially on the 1m time frame.

Please feel free to modify the colors... and I have bubbles instead of arrows in the code but I have edited them out (remove the #'s).

3 > 5 = White Arrow
3 < 5 = Cyan Arrow

3 > 20 = Green Arrow
3 < 20 = Red Arrow

20 > Price = Yellow Arrow
20 < Price = Magenta Arrow

I also have labels for each crossover... feel free to edit them out as well if you don't want them and let me know if you find any errors or need adjustments.
@PT_Scalper This is a huge help! I would have no idea what to do without the this, thank you!
I did make some edits (I can modify code fine, I just can't figure out how to write it LOL) BTW, I love the labels up top, great idea!

I edited it down to 3 Signals. 3x8, price x20 and 3x20, in that order. It helped cut down the many signals on the 1 Min.

There are several places where 3x8 and price x20 and the signals overlap, so I made the signal arrows smaller on Arrow 1 than Arrow 3.

I can't wait to try this out Monday morning!
SEE UPDATED POST FOR MOST RECENT SCRIPT:
https://usethinkscript.com/threads/macd-ema-strategy.8654/#post-80607
 
Last edited by a moderator:
@PT_Scalper This is a huge help! I would have no idea what to do without the this, thank you!
I did make some edits (I can modify code fine, I just can't figure out how to write it LOL) BTW, I love the labels up top, great idea!

I edited it down to 3 Signals. 3x8, price x20 and 3x20, in that order. It helped cut down the many signals on the 1 Min.

There are several places where 3x8 and price x20 and the signals overlap, so I made the signal arrows smaller on Arrow 1 than Arrow 3.

I can't wait to try this out Monday morning!

#My3820EMACrossover

declare upper;

input price = close;
input Length1 = 3;
input Length2 = 8;
input Length3 = 20;
input displace = 0;
input showBreakoutSignals = no;

plot AvgExp1 = ExpAverage(price[-displace], length1);
plot AvgExp2 = ExpAverage(price[-displace], length2);
plot AvgExp3 = ExpAverage(price[-displace], length3);

def emaValue1 = movavgExponential (close, Length1);
def emaValue2 = movavgExponential (close, Length2);
def emaValue3 = movavgExponential (close, Length3);

def CrossoverUp1 = emaValue1 [1] < emaValue2 [1] and emaValue1 > emaValue2;
def CrossoverDn1 = emaValue1 [1] > emaValue2 [1] and emaValue1 < emaValue2;
def Diff1 = emavalue1 - emavalue2;

def CrossoverUp2 = emaValue1 [1] < emaValue3 [1] and emaValue1 > emaValue3;
def CrossoverDn2 = emaValue1 [1] > emaValue3 [1] and emaValue1 < emaValue3;
def Diff2 = emavalue1 - emavalue3;

# EMA3 and EMA8 Crossover

Plot ArrowUp1 = if emaValue1 crosses above emaValue2
then low
else double.nan;
ArrowUP1.SetPaintingStrategy(PaintingStrategy.Arrow_UP);
ArrowUP1.SetLineWeight(3);
ArrowUP1.SetDefaultColor(Color.Cyan);
plot ArrowDN1 = if emaValue1 crosses below emaValue2
then high
else double.nan;
ArrowDN1.SetPaintingStrategy(PaintingStrategy.Arrow_DOWN);
ArrowDN1.SetLineWeight(3);
ArrowDN1.SetDefaultColor(Color.Orange);

AddLabel(emavalue1 > emavalue2, "3up|$" + Round(Diff1,3), Color.Green);
AddLabel(emavalue1 < emavalue2, "8up|$" + Round(Diff1,3), Color.Red);

# EMA3 and EMA8 Crossover bubbles

#def condup1 = if emaValue1 [1] < emaValue2 [1] and emaValue1 > emaValue2 then BarNumber() else Double.NaN;
#input bubblemover_up1 = 3;#Moves bubbles up or down away from other candles
#AddChartBubble(BarNumber() == condup1,
# emaValue2 - bubblemover_up1 * TickSize(),
# "3up",
# Color.uptick, no);

#def conddown1 = if emaValue1 [1] > emaValue2 [1] and emaValue1 < emaValue2 then BarNumber() else Double.NaN;
#input bubblemover_down1 = 3;#Moves bubbles up or down away from other candles
#AddChartBubble(BarNumber() == conddown1,
# emaValue2 - bubblemover_up1 * TickSize(),
# "8up",
# Color.downtick, no);

# EMA20 and Price Crossover

def Diff3 = emavalue3 - price;
Plot ArrowDN2 = if emaValue3 crosses above price
then high
else double.nan;
ArrowDN2.SetPaintingStrategy(PaintingStrategy.Arrow_DOWN);
ArrowDN2.SetLineWeight(3);
ArrowDN2.SetDefaultColor(Color.Yellow);
plot ArrowUP2 = if emaValue3 crosses below price
then low
else double.nan;
ArrowUP2.SetPaintingStrategy(PaintingStrategy.Arrow_UP);
ArrowUP2.SetLineWeight(3);
ArrowUP2.SetDefaultColor(Color.magenta);

AddLabel(emavalue3 < Price, "Priceup|$" + Round(Diff3,3), Color.Green);
AddLabel(emavalue3 > Price, "20up|$" + Round(Diff3,3), Color.Red);

# EMA20 and Price Crossover bubbles

#def condup2 = if emaValue3 [1] < price [1] and emaValue3 > price then BarNumber() else Double.NaN;
#input bubblemover_up3 = 3;#Moves bubbles up or down away from other candles
#AddChartBubble(BarNumber() == condup2,
# price - bubblemover_up3 * TickSize(),
# "Priceup",
# Color.uptick, no);

#def conddown2 = if emaValue1 [1] > price [1] and emaValue1 < price then BarNumber() else Double.NaN;
#input bubblemover_down3 = 3;#Moves bubbles up or down away from other candles
#AddChartBubble(BarNumber() == conddown2,
# price - bubblemover_up3 * TickSize(),
# "20up",
# Color.downtick, no);

# EMA3 and EMA20 Crossover

Plot ArrowUp3 = if emaValue1 crosses above emaValue3
then low
else double.nan;
ArrowUP3.SetPaintingStrategy(PaintingStrategy.Arrow_UP);
ArrowUP3.SetLineWeight(3);
ArrowUP3.SetDefaultColor(Color.Green);
plot ArrowDN3 = if emaValue1 crosses below emaValue3
then high
else double.nan;
ArrowDN3.SetPaintingStrategy(PaintingStrategy.Arrow_DOWN);
ArrowDN3.SetLineWeight(3);
ArrowDN3.SetDefaultColor(Color.Red);

AddLabel(emavalue1 > emavalue3, "3up|$" + Round(Diff2,3), Color.Green);
AddLabel(emavalue1 < emavalue3, "20up|$" + Round(Diff2,3), Color.Red);

# EMA3 and EMA20 Crossover bubbles

#def condup3 = if emaValue1 [1] < emaValue3 [1] and emaValue1 > emaValue3 then BarNumber() else Double.NaN;
#input bubblemover_up2 = 3;#Moves bubbles up or down away from other candles
#AddChartBubble(BarNumber() == condup2,
# emaValue3 - bubblemover_up2 * TickSize(),
# "3up",
# Color.uptick, no);

#def conddown3 = if emaValue1 [1] > emaValue3 [1] and emaValue1 < emaValue3 then BarNumber() else Double.NaN;
#input bubblemover_down2 = 3;#Moves bubbles up or down away from other candles
#AddChartBubble(BarNumber() == conddown2,
# emaValue3 - bubblemover_up2 * TickSize(),
# "8up",
# Color.downtick, no);


You can see arrow 3 is on the 1 Min but the 3 Min takes a little longer, but there still isn't a true breakout, then once we get the arrow 3 on 5 min, you can see price take off. AND the MACD oscillator is sloping up. What I really love, When all 3 labels on all 3 time frames are green its a GO.
 
Hey @Koolkth1,

How did the indicators work for you?
@PT_Scalper I only had a couple hours this morning before I had to go to a meeting but the indicator did work great! It prevented me from getting into some losing trades. I also added a 50 EMA which was a total game changer for false Bullish Breakouts and helped keep me in some Bearish trades longer. I'm going to be testing this all week.

I also went into the settings and changed every arrow to a dot, which helped clean up the chart even further. The only arrow now is the Final Trade Entry signal.
 
@KevinSammy Here's the code with the SMA added, you can toggle which average shows on the indicator settings menu. If you want to change the 50MA crossover signal, you'll have to define the SMA and replace all the EMAvalue4 with the SMA.
Ruby:
#My3820EMACrossover

declare upper;

input price = close;
input Length1 = 3;
input Length2 = 8;
input Length3 = 20;
input Length4 = 50;
input Length5 = 50;
input displace = 0;
input showBreakoutSignals = no;

plot AvgExp1 = ExpAverage(price[-displace], length1);
plot AvgExp2 = ExpAverage(price[-displace], length2);
plot AvgExp3 = ExpAverage(price[-displace], length3);
Plot AvgExp4 = ExpAverage(price[-displace], Length4);
plot SMA = Average(price[-displace], length5);

def emaValue1 = movavgExponential (close, Length1);
def emaValue2 = movavgExponential (close, Length2);
def emaValue3 = movavgExponential (close, Length3);
def emavalue4 = movAvgExponential (close, Length4);

def CrossoverUp1 = emaValue1 [1] < emaValue2 [1] and emaValue1 > emaValue2;
def CrossoverDn1 = emaValue1 [1] > emaValue2 [1] and emaValue1 < emaValue2;
def Diff1 = emavalue1 - emavalue2;

def CrossoverUp2 = emaValue1 [1] < emaValue3 [1] and emaValue1 > emaValue3;
def CrossoverDn2 = emaValue1 [1] > emaValue3 [1] and emaValue1 < emaValue3;
def Diff2 = emavalue1 - emavalue3;

def CrossoverUp3 = emaValue3 [1] < emaValue4 [1] and emaValue3 > emaValue4;
def CrossoverDn3 = emaValue3 [1] > emaValue4 [1] and emaValue3 < emaValue4;
def Diff4 = emavalue3 - emavalue4;

# EMA3 and EMA8 Crossover

Plot ArrowUp1 = if emaValue1 crosses above emaValue2
then low
else double.nan;
Arrowup1.SetPaintingStrategy(PaintingStrategy.Arrow_UP);
ArrowUp1.SetLineWeight(3);
ArrowUp1.SetDefaultColor(Color.Cyan);
plot ArrowDN1 = if emaValue1 crosses below emaValue2
then high
else double.nan;
ArrowDN1.SetPaintingStrategy(PaintingStrategy.Arrow_DOWN);
ArrowDN1.SetLineWeight(3);
ArrowDN1.SetDefaultColor(Color.Orange);

AddLabel(emavalue1 > emavalue2, "3>8|$" + Round(Diff1,4), Color.Green);
AddLabel(emavalue1 < emavalue2, "8>3|$" + Round(Diff1,4), Color.Red);

# EMA3 and EMA8 Crossover bubbles

#def condup1 = if emaValue1 [1] < emaValue2 [1] and emaValue1 > emaValue2 then BarNumber() else Double.NaN;
#input bubblemover_up1 = 3;#Moves bubbles up or down away from other candles
#AddChartBubble(BarNumber() == condup1,
# emaValue2 - bubblemover_up1 * TickSize(),
# "3up",
# Color.uptick, no);

#def conddown1 = if emaValue1 [1] > emaValue2 [1] and emaValue1 < emaValue2 then BarNumber() else Double.NaN;
#input bubblemover_down1 = 3;#Moves bubbles up or down away from other candles
#AddChartBubble(BarNumber() == conddown1,
# emaValue2 - bubblemover_up1 * TickSize(),
# "8up",
# Color.downtick, no);

# EMA20 and Price Crossover

def Diff3 = emavalue3 - price;
Plot ArrowDN2 = if emaValue3 crosses above price
then high
else double.nan;
ArrowDN2.SetPaintingStrategy(PaintingStrategy.Arrow_DOWN);
ArrowDN2.SetLineWeight(3);
ArrowDN2.SetDefaultColor(Color.Yellow);
plot ArrowUP2 = if emaValue3 crosses below price
then low
else double.nan;
ArrowUP2.SetPaintingStrategy(PaintingStrategy.Arrow_UP);
ArrowUP2.SetLineWeight(3);
ArrowUP2.SetDefaultColor(Color.magenta);

AddLabel(emavalue3 < Price, "Price>20|$" + Round(Diff3,4), Color.Green);
AddLabel(emavalue3 > Price, "20>Price|$" + Round(Diff3,4), Color.Red);

# EMA20 and Price Crossover bubbles

#def condup2 = if emaValue3 [1] < price [1] and emaValue3 > price then BarNumber() else Double.NaN;
#input bubblemover_up2 = 3;#Moves bubbles up or down away from other candles
#AddChartBubble(BarNumber() == condup2,
# price - bubblemover_up2 * TickSize(),
# "Priceup",
# Color.uptick, no);

#def conddown2 = if emaValue1 [1] > price [1] and emaValue1 < price then BarNumber() else Double.NaN;
#input bubblemover_down2 = 3;#Moves bubbles up or down away from other candles
#AddChartBubble(BarNumber() == conddown2,
# price - bubblemover_up2 * TickSize(),
# "20up",
# Color.downtick, no);

# EMA3 and EMA20 Crossover

Plot ArrowUp3 = if emaValue1 crosses above emaValue3
then low
else double.nan;
ArrowUP3.SetPaintingStrategy(PaintingStrategy.Arrow_UP);
ArrowUP3.SetLineWeight(3);
ArrowUP3.SetDefaultColor(Color.Green);
plot ArrowDN3 = if emaValue1 crosses below emaValue3
then high
else double.nan;
ArrowDN3.SetPaintingStrategy(PaintingStrategy.Arrow_DOWN);
ArrowDN3.SetLineWeight(3);
ArrowDN3.SetDefaultColor(Color.Red);

AddLabel(emavalue1 > emavalue3, "3>20|$" + Round(Diff2,4), Color.Green);
AddLabel(emavalue1 < emavalue3, "20>3|$" + Round(Diff2,4), Color.Red);

# EMA3 and EMA20 Crossover bubbles

#def condup3 = if emaValue1 [1] < emaValue3 [1] and emaValue1 > emaValue3 then BarNumber() else Double.NaN;
#input bubblemover_up3 = 3;#Moves bubbles up or down away from other candles
#AddChartBubble(BarNumber() == condup2,
# emaValue3 - bubblemover_up3 * TickSize(),
# "3up",
# Color.uptick, no);

#def conddown3 = if emaValue1 [1] > emaValue3 [1] and emaValue1 < emaValue3 then BarNumber() else Double.NaN;
#input bubblemover_down3 = 3;#Moves bubbles up or down away from other candles
#AddChartBubble(BarNumber() == conddown2,
# emaValue3 - bubblemover_up3 * TickSize(),
# "8up",
# Color.downtick, no);

# EMA20 and EMA50 Crossover

Plot ArrowUp4 = if emaValue3 crosses above emaValue4
then low
else double.nan;
ArrowUP4.SetPaintingStrategy(PaintingStrategy.Arrow_UP);
ArrowUP4.SetLineWeight(3);
ArrowUP4.SetDefaultColor(Color.Green);
plot ArrowDN4 = if emaValue3 crosses below emaValue4
then high
else double.nan;
ArrowDN4.SetPaintingStrategy(PaintingStrategy.Arrow_DOWN);
ArrowDN4.SetLineWeight(3);
ArrowDN4.SetDefaultColor(Color.Red);

AddLabel(emavalue3 > emavalue4, "20>50|$" + Round(Diff4,4), Color.Green);
AddLabel(emavalue3 < emavalue4, "50>20|$" + Round(Diff4,4), Color.Red);

# EMA20 and EMA50 Crossover bubbles

#def condup4 = if emaValue3 [1] < emaValue4 [1] and emaValue3 > emaValue4 then BarNumber() else Double.NaN;
#input bubblemover_up4 = 3;#Moves bubbles up or down away from other candles
#AddChartBubble(BarNumber() == condup2,
# emaValue4 - bubblemover_up4 * TickSize(),
# "20up",
# Color.uptick, no);

#def conddown4 = if emaValue3 [1] > emaValue4 [1] and emaValue3 < emaValue4 then BarNumber() else Double.NaN;
#input bubblemover_down4 = 3;#Moves bubbles up or down away from other candles
#AddChartBubble(BarNumber() == conddown2,
# emaValue4 - bubblemover_up4 * TickSize(),
# "50up",
# Color.downtick, no);
 
I applied this indicator to my charts, and there is a lot going on. If I were to simplify what is on the chart, should I just have arrow 3 plotted on all 3 timelines, and when arrow 3 appears on all 3, then it is time to buy? is that how I would use it?

Thanks
 
I applied this indicator to my charts, and there is a lot going on. If I were to simplify what is on the chart, should I just have arrow 3 plotted on all 3 timelines, and when arrow 3 appears on all 3, then it is time to buy? is that how I would use it?

Thanks
@reiserbc Great questions, I've actually be considering doing a video for this, I'll put something together later tonight. There's a few different nuances that I think are important, they also explain why certain items are included in this indicator.
 
@reiserbc Great questions, I've actually be considering doing a video for this, I'll put something together later tonight. There's a few different nuances that I think are important, they also explain why certain items are included in this indicator.
Sounds great! can't wait to see the video.
 
Here is the video explaining the Indicator with some ways that I use it.

Great video! Very helpful in learning how to utilize this for trading. Can’t wait to try it out!

How would you go about finding stocks to trade, utilizing this indicator? Is there a scanner taking the indicator into account? Would I scan for stocks where the 3ema crosses the 8ema on the 5m and see if it meets all other criteria on the 1,3,5?

Thanks for your help!
 
Great video! Very helpful in learning how to utilize this for trading. Can’t wait to try it out!

How would you go about finding stocks to trade, utilizing this indicator? Is there a scanner taking the indicator into account? Would I scan for stocks where the 3ema crosses the 8ema on the 5m and see if it meets all other criteria on the 1,3,5?

Thanks for your help!
@reiserbc I don;t have a scanner setup for this, I primarily use my watch list and take a look 15 min after the open at whatever is trending/ cycling well. for intraday trading I try to stick with tickers I'm familiar with the way the move and react.

You could however, set up a scan just the way you stated above. Those parameters should bring up a nice list of stocks, then you would just have to take a look at the charts and wait for the 20 EMA to cross and reference that with the MACD momentum.
 
@reiserbc I don;t have a scanner setup for this, I primarily use my watch list and take a look 15 min after the open at whatever is trending/ cycling well. for intraday trading I try to stick with tickers I'm familiar with the way the move and react.

You could however, set up a scan just the way you stated above. Those parameters should bring up a nice list of stocks, then you would just have to take a look at the charts and wait for the 20 EMA to cross and reference that with the MACD momentum.

Tried to make a scanner with this and i haven't had luck with it yet. Just scanning for the crossovers is giving me bad results. Could you screenshot or put up another video on setting up a good scan with this script? What I would really like to do is set up an alert when one of the stocks on my watch list has a has an UpArrow 2 or 3 possible on the 3/5 min charts.

Awesome script by the way. Was successful today with it on options
 
@reiserbc I don;t have a scanner setup for this, I primarily use my watch list and take a look 15 min after the open at whatever is trending/ cycling well. for intraday trading I try to stick with tickers I'm familiar with the way the move and react.

You could however, set up a scan just the way you stated above. Those parameters should bring up a nice list of stocks, then you would just have to take a look at the charts and wait for the 20 EMA to cross and reference that with the MACD momentum.
Thanks for the feedback and again for the indicator! I havent had a chance to test it out because of work, but I have I believe successfully created a scanner for it. It looks for the criteria you have listed out, 3ema x 8ema, price above 20ema, and the 3ema x 20ema. I set it to the 5m agg period, since thats the last timeframe we want to see before confirming, you would still need to confirm via momentum, but it filters what we are looking for. The scan settings can be viewed here
 
@Koolkth1 ... thank you for your contribution...and for the video. All very helpful.
Looks quite promising and I'm looking forward to testing it tomorrow.

I've been monkeying around with it and decided to add a few things to suit my needs. ... and decided to pay it forward just as you have.

My mods are as follows:

1. Added a chart label named "MOMO" which will be green or red according to the MQ_Momentum histogram. Note: for the 5m chart, I have modified the settings to 13,5,5.
2. Added a chart label named "+ADX" which signifies whether the ADX line is sloping upwards or not. Note: this indicator does not care if ADX has a value over 20 or not. I've found that it's most important if the line is sloping upwards or not to determine if trend is beginning or "strengthening".
3. Added a RVOL indicator which will paint the candles either dark red (excessive volume in a direction), gray (normal volume) or black (negligible volume). The RVOL indicator will also display a label according to the colors... "+RVOL+" (excessive), "/RVOL/" (normal) or "RVOL" (negligible).
4. Last, I added a "Supply / Demand" zone indicator that comes in VERY handy in my trading. Look for bounces at red demand zones and reversals at green supply zones. On multiple time frames you'll end up with a lot of zones. When a zone coincides on all three time frames, it might be a hearty zone.

Screenshot:
Chart: https://tos.mx/m4oznmh
 
I also lean toward this kind of strategy. Is this set up still working well in the current market?
 
I also lean toward this kind of strategy. Is this set up still working well in the current market?

If your comment was directed at me @CDG , I will say that I'm still evaluating it. Trading it to paper.

Looks promising though... if you like to scalp.
 

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
221 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