tux

TonyUX EMA Scalper - Buy / Sell

This is a simple scalping strategy that works for all time frames... I have only tested it on FOREX

It works by checking if the price is currently in an uptrend and if it crosses the 20 EMA .

If it crosses the 20 EMA and its in and uptrend it will post a BUY SIGNAL.
If it crosses the 20 EMA and its in and down it will post a SELL SIGNAL.

The red line is the highest close of the previous 8 bars --- This is resistance
The green line is the lowest close of the previous 8 bars -- This is support
Remove from Favorite Scripts Add to Favorite Scripts
study(title="Tony's EMA Scalper - Buy / Sell", shorttitle="TUX EMA Scalper", overlay=true)
len = input(20, minval=1, title="Length")
src = input(close, title="Source")
out = ema(src, len)
plot(out, title="EMA", color=blue)
last8h = highest(close, 8)
lastl8 = lowest(close, 8)

plot(last8h, color=red, linewidth=2)
plot(lastl8, color=green, linewidth=2)


bearish = cross(close,out) == 1 and close[1] > close 
bullish = cross(close,out) == 1 and close[1] < close 

plotshape(bearish, color=red, style=shape.arrowdown, text="Sell", location=location.abovebar)
plotshape(bullish, color=green, style=shape.arrowup, text="Buy", location=location.belowbar)
How do i create an alert to trigger every time the buy/sell flag shows?
+17 Reply
wolf92s Amirfx216
@Amirfx216, You would need to do something using the alertcondition code.

For this it would look like this:
alertcondition(bearish == true, title="Buy Alert", message="Something to tell you to buy")
alertcondition(bullish == true, title="Sell Alert", message="Something to tell you to sell")

I haven't tried running that but to give you an idea on how to do it.
Reply
wolf92s wolf92s
Sorry don't know how to edit comment. I forgot to mention after you put that in you will have to go through and add alert, change the condition to the study, then select buy alert/sell alert (or whatever you name the titles)
Reply
What am i missing? Seems like this indicator simply prints a buy or sell signal every time price crosses the 20 EMA. Overall trend seems to have no effect on the signals.
+3 Reply
mattzab lucky0309
@lucky0309, Looking at the code, I came to that same conclusion. Trend isn't being calculated, and the red and green lines are simply the highest high/low of the past 8 periods.

I'm surprised this script has so many likes. It's just a buy signal when the price closes above 20 EMA...
Reply
How do i create an alert to trigger every time the buy/sell flag shows?
+14 Reply
@bellz17, that is my question
+1 Reply
@tux On what time frame(s) would you recommend using this script?
+19 Reply
i would also love this indicator please
+3 Reply
I want this indicator sir.
Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar Shows How It Works Chart Features Pricing House Rules Moderators Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Help Center Refer a friend Feature Request Blog & News Twitter
Profile Profile Settings Account and Billing Refer a friend My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out