Plot an arrow when price is over / under 8 day EMA?

IAMDOV

New member
Hi everyone. I am quite new to this Thinkscript stuff. I am looking to see if anyone can help me create or point me in the right direction for this Thinkscript.

I would like an Up Arrow plotted on the candle when the Price is 3 or more dollars BELOW the 8-day EMA.
and a Down Arrow plotted on the candle when is it 3 or more dollars ABOVE the 8-day EMA.

I am a scalp / intraday trader. I am normally on the 1 minute and 5 minute chart.

Thank you to anyone who can help in advanced :)
 
Last edited by a moderator:
What you are looking for has nothing to do with the 8 days you referenced, only the 1 and 5 minutes... They don't use an 8 day aggregate... Anyhoo...!!! You want a plot on your charts, or do you really want a scanner...??? And how far back do you want to look, 1 bar, 5 bars...???
 

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

I am looking for a plot or some type of indication (Preferably the up and down arrows) on my chart. As far as how far back i would like for it to work in real time if possible. If you mean like how how far back i can see the arrows i guess 30 days is sufficient.
 
I am looking for a plot or some type of indication (Preferably the up and down arrows) on my chart. As far as how far back i would like for it to work in real time if possible. If you mean like how how far back i can see the arrows i guess 30 days is sufficient.
Ok... So you use an 8EMA on your charts and want an arrow when the price is over $3 below average... Should be doable... Hold that thought...
 
do you litterly mean 8-day EMA or 8EMA??

the differenece is one is plotted against the daily timefraime and the other is plotted against your current charting timeframe... i would assume you mean 8EMA but i may be incorrect, you will have to specify.
 
I am talking about plotting against my current charting timeframe. So for example i want to be on the 5 minute chart of a stock and have an up arrow appear beneath the candle if it is 3 or more dollars beneath the 8EMA.
 
@rad14733 Thanks so much for this! I edited some stuff for this turns out +/- 3.50 works best for my strategy. I didn't now how to combine the Up arrow code with the down arrow code in one thinkscript so I ended up making 2 separate ones. One for the buying indicator and one for the seller indicator. Is it possible to have these thinkscripts work under a condition? like lets say the RSI has to be Above 65 or below 35?
 
Thanks so much for this! I edited some stuff for this turns out +/- 3.50 works best for my strategy. I didnt now how to combine the Up arrow code with the down arrow code in one thinkscript so i ended up making 2 separate ones. One for the buying indicator and one for the seller indicator. Is it possible to have these thinkscripts work under a condition? like lets say the RSI has to be Above 65 or below 35?
yes you just make a scan that scans for RSI above 60. that can be made easily from within thinkorswim desktop platforms scan wizard.
 
yes you just make a scan that scans for RSI above 60. that can be made easily from within thinkorswim desktop platforms scan wizard.
Thanks for the reply. I do know how to make the scanner for RSI. But i am talking about adding it into the thinkscript. For example i only want those arrows now to appear above / below the candles when the RSI is above / below certain points. Is that possible? I feel like that would be an "IF condition" just not sure how to add it in.
 
You can just make the RSI scan in the wizard and then add it to your existing code like this:

vu8XgDi.png


I just copied it from the wizard and pasted it into the code with the correct formatting and gave it a reference/syntax of "rsi_low". you can name it whatever you want.

Code:
def less_than_ma_minus_3 = close is less than or equal to MovAvgExponential("length" = 8)."AvgExp" - 3.00;
def rsi_low = RSI()."RSI" is less than 35 ;
plot data = rsi_low and less_than_ma_minus_3;
Data.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

or if its easier maybe this makes more sense:

Code:
def scan1 = close is less than or equal to MovAvgExponential("length" = 8)."AvgExp" - 3.00;
def scan2 = RSI()."RSI" is less than 35 ;
plot FINALSCAN = scan1 and scan2;
FINALSCAN.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

learn the wizard and you can keep adding more scans.
 
Last edited:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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