Entry based in candle and ema

Ismelloa

New member
Hi everyone I tried to build a scam but I don't know how but the strategy would be a scam with these parameters

Find stocks where the current price is bellow the close of the last 2 candles and these last 2 candles are bellow the 8 ema and 20 ema.
 

Attachments

  • Screenshot_20231130_222043_TradingView.jpg
    Screenshot_20231130_222043_TradingView.jpg
    160.3 KB · Views: 93
  • Screenshot_20231130_222010_TradingView.jpg
    Screenshot_20231130_222010_TradingView.jpg
    163.2 KB · Views: 94
Last edited:
Solution
Hi Sleepyz I appreciate your help. if I want to change the scan from 5 min to scan 15 min. where would I need to change that?

another question. I just did not get this line of code. why did u add this one?
def close_before_last2close_above_ema1_or_ema2 = close[3] > ema1[3] or close[3] > ema2[3];

To change the scan timeframe do it in the scanner.
Screenshot 2024-01-01 075014.png



As far as that def, I was trying to identify that the last close was actually the lower than the previous clos and all of your other conditions, so I aggregated them in one def.
Hi everyone I tried to build a scam but I don't know how but the strategy would be a scam with these parameters

Find stocks where the current price is bellow the close of the last 2 candles and these last 2 candles are bellow the 8 ema and 20 ema.

Put this in the scanner. I used the above description and also the images as guides. Make any changes that you want.

Screenshot 2023-12-16 071746.png
Screenshot 2023-12-16 071533.png
Code:
#Find stocks where the current price is bellow the close of the last 2 candles and these last 2 candles are bellow the 8 ema and 20 ema.

input len1 = 8;
input len2 = 20;
def ema1 = ExpAverage(close, len1);
def ema2 = ExpAverage(close, len2);

def close_before_last2close_above_ema1_or_ema2 = close[3] > ema1[3] or close[3] > ema2[3];

def last2closes_below_ema1_and_ema2 = close[1] < ema1[1] and close[1] < ema2[1] and
                                      close[2] < ema1[2] and close[2] < ema2[2];

def currentclose_below_last2closes  = close < close[1] and close < close[2];

def currenthigh_below_ema1_ema2 = high < ema1 and high < ema2;

plot scan = close_before_last2close_above_ema1_or_ema2 and
            last2closes_below_ema1_and_ema2 and
            currenthigh_below_ema1_ema2 and
            currentclose_below_last2closes;
#scan.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

#
 
Put this in the scanner. I used the above description and also the images as guides. Make any changes that you want.
Hi Sleepyz I appreciate your help. if I want to change the scan from 5 min to scan 15 min. where would I need to change that?

another question. I just did not get this line of code. why did u add this one?
def close_before_last2close_above_ema1_or_ema2 = close[3] > ema1[3] or close[3] > ema2[3];
 
Last edited by a moderator:
Hi Sleepyz I appreciate your help. if I want to change the scan from 5 min to scan 15 min. where would I need to change that?

another question. I just did not get this line of code. why did u add this one?
def close_before_last2close_above_ema1_or_ema2 = close[3] > ema1[3] or close[3] > ema2[3];

To change the scan timeframe do it in the scanner.
Screenshot 2024-01-01 075014.png



As far as that def, I was trying to identify that the last close was actually the lower than the previous clos and all of your other conditions, so I aggregated them in one def.
 
Solution
To change the scan timeframe do it in the scanner.
View attachment 20584


As far as that def, I was trying to identify that the last close was actually the lower than the previous clos and all of your other conditions, so I aggregated them in one def.
it shouldn't be close[3] < ema1[3] or close[3] < ema2[3];? becuase I am not looking if close above only bellow
 
Last edited:

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
424 Online
Create Post

Similar threads

Similar threads

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