High and Low Reversals Indicator + Intraday Strategy For ThinkOrSwim

Status
Not open for further replies.
@barbaros I would have put it at the thin red line, for a small loss, then traded the second breakout again this time with more successfully. It’s worth noting that since my stops are mental, it’s possible I may not here exited. I’m not sure how fast this was moving beings ticks and all but it’s possible I would have watched the price action a bit and stayed in the trade as it broke down again. Since it topped twice at the SL and then came back down.

As much as I love rules to a system sometimes experience and intuition guide your hand too.it was still in the bear zone and with not too much buying pressure. If that second peak had been higher (the body) than yeah I probably would have been out. Either way jumping back into the trade on the next breakdown would have more than made up for the loss if I had exited.
 

New Indicator: Buy the Dip

Check out our Buy the Dip indicator and see how it can help you find profitable swing trading ideas. Scanner, watchlist columns, and add-ons are included.

Download the indicator

@horserider
I get an error. (No Such Variable: ArrowDN at... etc.

I just have no clue other than picking a spot and pasting it.

@horserider
Here is my UPDATED (Pasted what you provided at the bottom) code:

input trailType = {default modified, unmodified};
input ATRPeriod = 5;
input ATRFactor = 3.5;
input firstTrade = {default long, short};
input averageType = AverageType.WILDERS;
Assert(ATRFactor > 0, "'atr factor' must be positive: " + ATRFactor);
def HiLo = Min(high - low, 1.5 * Average(high - low, ATRPeriod));
def HRef = if low <= high[1] then high - close[1] else (high - close[1]) - 0.5 * (low - high[1]); def LRef = if high >= low[1]
then close[1] - low
else (close[1] - low) - 0.5 * (low[1] - high);
def trueRange;
switch (trailType) {
case modified:
trueRange = Max(HiLo, Max(HRef, LRef));
case unmodified:
trueRange = TrueRange(high, close, low);
}
def loss = ATRFactor * MovingAverage(averageType, trueRange, ATRPeriod);
def state = {default init, long, short};
def trail;
switch (state[1]) {
case init:
if (!IsNaN(loss)) {
switch (firstTrade) {
case long:
state = state.long;
trail = close - loss;
case short:
state = state.short;
trail = close + loss;
}
} else {
state = state.init;
trail = Double.NaN;
}
case long:
if (close > trail[1]) {
state = state.long;
trail = Max(trail[1], close - loss);
} else {
state = state.short;
trail = close + loss;
}
case short:
if (close < trail[1]) {
state = state.short;
trail = Min(trail[1], close + loss);
} else {
state = state.long;
trail = close - loss;
}
}
plot BuySignal = if Crosses(state == state.long, 0, CrossingDirection.ABOVE) then low else Double.NaN;
BuySignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
plot SellSignal = if Crosses(state == state.short, 0, CrossingDirection.ABOVE) then high else Double.NaN;
SellSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
plot TrailingStop = trail;
TrailingStop.SetPaintingStrategy(PaintingStrategy.POINTS);
TrailingStop.DefineColor("Buy", GetColor(0));
TrailingStop.DefineColor("Sell", GetColor(1));
TrailingStop.AssignValueColor(if state == state.long
then TrailingStop.Color("Sell")
else TrailingStop.Color("Buy"));
Alert(BuySignal, "Trail Stop Long Entry", Alert.BAR, Sound.RING);
Alert(SellSignal, "Trail Stop Short Entry", Alert.BAR, Sound.RING);

AddChartBubble(BuySignal == BuySignal , BuySignal , "Buy", Color.GREEN,no);
AddChartBubble(SellSignal == SellSignal , SellSignal , "Sell", Color.RED, yes);


# End Code
 
Last edited by a moderator:
@J-Fearless Thank you for your comments. I agree to watch the price action. Here is another example for April 24th. It opened bearish. However, it reversed and gone the other direction.

GzifRXq.png
 
@fjr1300 Please explain what you wish coded in better detail. Those bubbles were for the hi lo study.
Now that you displayed the code it is easier to help.

Erase what you pasted before and then at the bottom of all the code you can paste this;

AddChartBubble(BuySignal == BuySignal , BuySignal , "Buy", Color.GREEN,no);
AddChartBubble(SellSignal == SellSignal , SellSignal , "Sell", Color.RED, yes);
 
@horserider
I get an error. (No Such Variable: ArrowDN at... etc.

I just have no clue other than picking a spot and pasting it.

@horserider
Here is my UPDATED (Pasted what you provided at the bottom) code:

input trailType = {default modified, unmodified};
input ATRPeriod = 5;
input ATRFactor = 3.5;
input firstTrade = {default long, short};
input averageType = AverageType.WILDERS;
Assert(ATRFactor > 0, "'atr factor' must be positive: " + ATRFactor);
def HiLo = Min(high - low, 1.5 * Average(high - low, ATRPeriod));
def HRef = if low <= high[1] then high - close[1] else (high - close[1]) - 0.5 * (low - high[1]); def LRef = if high >= low[1]
then close[1] - low
else (close[1] - low) - 0.5 * (low[1] - high);
def trueRange;
switch (trailType) {
case modified:
trueRange = Max(HiLo, Max(HRef, LRef));
case unmodified:
trueRange = TrueRange(high, close, low);
}
def loss = ATRFactor * MovingAverage(averageType, trueRange, ATRPeriod);
def state = {default init, long, short};
def trail;
switch (state[1]) {
case init:
if (!IsNaN(loss)) {
switch (firstTrade) {
case long:
state = state.long;
trail = close - loss;
case short:
state = state.short;
trail = close + loss;
}
} else {
state = state.init;
trail = Double.NaN;
}
case long:
if (close > trail[1]) {
state = state.long;
trail = Max(trail[1], close - loss);
} else {
state = state.short;
trail = close + loss;
}
case short:
if (close < trail[1]) {
state = state.short;
trail = Min(trail[1], close + loss);
} else {
state = state.long;
trail = close - loss;
}
}
plot BuySignal = if Crosses(state == state.long, 0, CrossingDirection.ABOVE) then low else Double.NaN;
BuySignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
plot SellSignal = if Crosses(state == state.short, 0, CrossingDirection.ABOVE) then high else Double.NaN;
SellSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
plot TrailingStop = trail;
TrailingStop.SetPaintingStrategy(PaintingStrategy.POINTS);
TrailingStop.DefineColor("Buy", GetColor(0));
TrailingStop.DefineColor("Sell", GetColor(1));
TrailingStop.AssignValueColor(if state == state.long
then TrailingStop.Color("Sell")
else TrailingStop.Color("Buy"));
Alert(BuySignal, "Trail Stop Long Entry", Alert.BAR, Sound.RING);
Alert(SellSignal, "Trail Stop Short Entry", Alert.BAR, Sound.RING);

AddChartBubble(BuySignal == BuySignal , BuySignal , "Buy", Color.GREEN,no);
AddChartBubble(SellSignal == SellSignal , SellSignal , "Sell", Color.RED, yes);


# End Code

@horserider - Awesome That works. Great Job.
 
@fjr1300 Please explain what you wish coded in better detail. Those bubbles were for the hi lo study.
Now that you displayed the code it is easier to help.

Erase what you pasted before and then at the bottom of all the code you can paste this;

AddChartBubble(BuySignal == BuySignal , BuySignal , "Buy", Color.GREEN,no);
AddChartBubble(SellSignal == SellSignal , SellSignal , "Sell", Color.RED, yes);


@horserider Exactly what I was looking for. Thank you.
 
@Thomas @J-Fearless this looks pretty powerful. I'm still having a hard time nailing down the full understanding though. Do you put order in when breaks below RO? Should this be used in combination with other indicators to confirm? How should you trade around Risk On and Risk Off?
Use alert......or place buy above price
 
OMG - Thomas hi!!!!!

I've been messing with the ORBV4 yesterday after close and this morning ran 5 live option trades with it (short) and all printed. AAPL even made it down to T5 before I hit my trailing stop. I'm not sure if I'm using it correctly at all though. Not sure what most of the acronyms mean (RO? for example).

Is there a thread somewhere that explains the features at all? I tried searching ORB but it's too short and ORBV4 brought up nothing. I'd love to understand it better and see what's going on under the hood.

Would very much appreciate a link to a thread or a quick explanation if that's not possible.

Appreciate your time.

Thx -J
Here's a very I have set up on futures,......note color change.....https://tos.mx/r4GGvMT
 
Hi Barbaros,

I used this today to devastating effect on a 1m chart. 10 wins, 1 loss. It even caught the Airlines rallying which was very nice. I personally put orders in as soon as it broke out of the opening range, and set the RO as my first profit target. Sometimes they were too close so I was in after it broke RO. Then I scaled out at each level and adjusted trailing stops to the previous level, leaving a runner at the end where I just observed price action till it looked like it was cratering and exited. If you'd like some other indicators to help confirm, ATRTrailingStop can help, but I found it counterproductive. SuperTrend probably better. Personally I can trade using morning levels without any indicators at all, but this is nice since it adds realistic targets and saves me the effort of drawing levels. Second day using and don't feel like I needed additional confirmations. Only thing I will add, is if the break up or down is counter to the morning trend (the vertical dots), then I removed all contracts at the first target, since I figure it's a weaker break.

Hope that helps and keep in mind I only loaded this up 3 days ago and just played with it for the first day. It spoke to me because it simplifies what I already do in my regular trading strat.

best
-J
Yes,....you must study how this trades,...how it works, what to look for, trailstop, etc.....Mobius mentioned the only thing he trades,....targets, etc....observe it if you are unsure.....enter a feeler trade.....
 
@Chenthy73 Amazing analysis. That's correct and I agreed with you. I use this for SPY and other big tech names. I would avoid day trading anything with a wide spread altogether.
Hello Ben, I see the above script is for Regular Trading Hours to find High and Low Reversals.
Can you kindly help to find the High and Low reversal during extended hours too, so it can be used for Futures trading too and used as custom scan.
Thanks so much!
 
@Deepa This indicator will only work during market hours. You may have to modify the code. Even then, I don't know if it will work for the futures market.
 
Saved these scanners as a watchlist, but it seems to only trigger on Down Arrows. I have extended hours turned on for all charts. Is there a scanner for Up Arrows?
@BenTen : yes, even I tested this, and seeing alerts only for Down arrows. Can you kindly share the scan that includes alerts for up arrows too.
 
@gbears96 @Deepa Up arrows are only visible if you have extended hours enabled on your chart. Use the code posted on page #1 and watch the video from this thread.
@BenTen The issue is getting the watchlist to alert you when an ArrowUP stock is added to the list. As of now, it only alerts on ArrowDN. This is not the same as the getting the up arrows to show up on the charts with the Extended Hours turned on. There are no issues seeing the arrows. I just need an alert that triggers when one of the stocks in my watchlist triggers an ArrowUP. Can you help?

@Tesh01 Here is the scanner

5min: https://tos.mx/7LPlbl

15min: https://tos.mx/NqObqK
@BenTen In the scanner filter, there is this line of code:

hiloreversal()."ArrowDN" is true within 3 bars

For some reason, it won't let me even save it once I opened the source code. The "OK" button is grayed out. Any idea as to why?
 
Last edited by a moderator:
Status
Not open for further replies.

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