Looking to move stop up large candles

greghoverstreet

New member
On a five minute chart, I am looking for large candles to go long and short with (bullish elephant bearish elephant). Once I am in a position, I want to move my stops up each large candle that prints bullish or bearish. So for instance, i see a large green 5 minute candle so i enter. My stop will be at the bottom of that candle. As the stock moves up, the next large elephant candle i want to move my stop up to. I am looking for an indicator to tell me where to move my stop up to as the new large candles form.

an elephant candle is a large candle

An elephant candle is bigger than atleast the previous 5 candles. preverable the body is 2x as large. The candle also is a full body candle generally with little to no wick.

thank you!
1696713287965.png
 
Last edited by a moderator:
Solution
On a five minute chart, I am looking for large candles to go long and short with (bullish elephant bearish elephant). Once I am in a position, I want to move my stops up each large candle that prints bullish or bearish. So for instance, i see a large green 5 minute candle so i enter. My stop will be at the bottom of that candle. As the stock moves up, the next large elephant candle i want to move my stop up to. I am looking for an indicator to tell me where to move my stop up to as the new large candles form.

thank you!

find big candles and draw a stop line from them
if close crosses the stop line, a yellow square is drawn


Code:
#elephant2_stops

# https://usethinkscript.com/threads/looking-to-move-stop-up-large-candles.16878/...
On a five minute chart, I am looking for large candles to go long and short with (bullish elephant bearish elephant). Once I am in a position, I want to move my stops up each large candle that prints bullish or bearish. So for instance, i see a large green 5 minute candle so i enter. My stop will be at the bottom of that candle. As the stock moves up, the next large elephant candle i want to move my stop up to. I am looking for an indicator to tell me where to move my stop up to as the new large candles form.

thank you!

find big candles and draw a stop line from them
if close crosses the stop line, a yellow square is drawn


Code:
#elephant2_stops

# https://usethinkscript.com/threads/looking-to-move-stop-up-large-candles.16878/
# on large candles, go long or short
# An elephant candle is bigger than at least the previous 5 candles.
#   preverable the body is 2x as large. 
# The candle also is a full body candle generally with little to no wick.

def na = Double.NaN;
def bn = barnumber();

def up = close > open;
def dwn = close < open;

def ht = high - low;
def body = BodyHeight();
def wicks = ht - body;

input elephant_bars = 5;
input elephant_size_ratio = 2.0;
input wicks_to_body_percent = 20.0;

def hihi = Highest(ht[1], elephant_bars);
def el_size = body >= (elephant_size_ratio * hihi);
def el_wicks = (100 * wicks / ht) <= wicks_to_body_percent;
def el = el_size and el_wicks;

def elup = el and up;
def eldwn = el and dwn;

def dir = if bn == 1 then 0
# else if el[-1] then 0
 else if elup then 1
 else if eldwn then -1
 else dir[1];

def stop = if bn == 1 then na
 else if el[-1] then na
 else if elup then low
 else if eldwn then high
 else stop[1];

plot z1 = stop;
#z1.setdefaultcolor(color.gray);
z1.AssignValueColor(if dir > 0 then color.green else if dir < 0 then color.red else color.gray);


input show_elephant_arrows = yes;
def y = 0.002;
plot zelup = if show_elephant_arrows and elup then low*(1-y) else na;
#zelup.SetPaintingStrategy(PaintingStrategy.POINTS);
zelup.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
#zelup.SetDefaultColor(Color.green);
zelup.SetDefaultColor(Color.cyan);
zelup.setlineweight(4);
zelup.hidebubble();

plot zeldwn = if show_elephant_arrows and eldwn then high*(1+y) else na;
#zeldwn.SetPaintingStrategy(PaintingStrategy.POINTS);
zeldwn.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
#zeldwn.SetDefaultColor(Color.red);
zeldwn.SetDefaultColor(Color.cyan);
zeldwn.setlineweight(4);
zeldwn.hidebubble();


input show_sell_squares = yes;
plot upstopsell = if show_sell_squares and dir > 0 and close crosses below stop then stop else na;
# upstopsell.SetPaintingStrategy(PaintingStrategy.boolean_ARROW_DOWN);
 upstopsell.SetPaintingStrategy(PaintingStrategy.squares);
 upstopsell.SetDefaultColor(Color.yellow);
 upstopsell.setlineweight(5);

plot dwnstopsell = if show_sell_squares and dir < 0 and close crosses above stop then stop else na;
# dwnstopsell.SetPaintingStrategy(PaintingStrategy.boolean_ARROW_up);
 dwnstopsell.SetPaintingStrategy(PaintingStrategy.squares);
 dwnstopsell.SetDefaultColor(Color.yellow);
 dwnstopsell.setlineweight(5);


input alerts = yes;
alert((alerts and dir < 0 and close crosses above stop), "crossed up" ,alert.BAR, sound.DING);
alert((alerts and dir > 0 and close crosses below stop), "crossed down" ,alert.BAR, sound.bell);


#-------------------------------
#AddVerticalLine(el, "-");

AddChartBubble(0, low * 0.994,
body + " b\n" +
hihi + " hi\n" +
el_size + "\n\n" +

ht + " ht\n" +
wicks + " w\n" +
(100 * wicks / ht) + " w%\n" +
el_wicks + "\n\n" +

el
, (if el then Color.YELLOW else Color.GRAY), no);

#

cyan arrows show when to buy or sell
a green or red line is drawn from big candle, as a stop
if close crosses the stop line, a yellow square is drawn
Nimb6SS.jpg
 
Solution

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
455 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