Need help figuring out pullback study

nextpotato

New member

I'm working on a script to backtest a simple pullback strategy for daytrading, but I'm not sure how to fully implement this in Thinkscript.

The image shows high and low swings indicated by pink and white arrows.

The general idea is to enter a Long position after a pullback to (hopefully) catch the next run up, and attempt to exit somewhere near the top. How I want the script to behave is to enter the trade at the second white arrow during the trading day if the closing price is above the first white arrow. The second white arrow must come after a pink arrow (if there is no pink arrow between the white arrows, then no entry).

Where I need help with is figuring out how to make the script enter the trade in Think Script. I think I need a way to store and recall the closing price at each arrow so that I can compare the price between arrows. And a way to check if there's been a pink arrow between the two white arrows. I should be able to figure out the exit conditions without too much trouble :)
 
Last edited:

rad14733

Well-known member
VIP
@nextpotato All indicators are based on conditional criteria logic, not colors... I say that for a reason... You need to know what determines the color of a candle in order to write the code you want... That being said, in the picture above the pink candles are down candles, meaning the closing price is lower than the opening price for that candle... The green candles close higher than they open... You see, it's logic, not colors... No more talk about colors, ok...??? We're talking about price trends...

Now, what you have depicted in the image is what we call trend reversal... However, the problem with trend reversals, as you are describing, is that without any other confirmations you never know whether what you think is the bottom is really the bottom... We have many trend reversal scripts here already and, unfortunately, many of them repaint which results in false signals... The Trend Reversal Indicator with Signals is a prime example... And Studies and Strategies that work virtually the way you are describing already exist... Reliability is the issue... As mentioned, the trend reversal itself is worthless without adequate confirmation...

You aren't describing anything new... Take the time to do ample research based on what I have explained... It would do no good to attempt to reinvent the wheel by writing inadequate code that already exists... Once you know about how to best recognize and act upon trends, such as combining with momentum, volume, convergence/divergence, candlestick action, or any of a number of other criteria, only then will you know what you want to code... As of right now you're stuck at the very basic concept that all too many new traders fixate on... It's not the reversal, it's the momentum for continuance that counts... Ever heard the term "dead cat bounce"...??? That's something that happens that fools many traders that focus on trend reversals alone...

While perhaps not the answer you wanted to hear I feel that it's the answer you needed to hear... If it was as simple as you've imagined and described, we'd all be filthy rich... And the reason we don't trade that way is because the concept in its simplest form is fundamentally flawed...

Do your research and see why I'm giving you this advice... You'll be glad I did in the end, and you won't have to suffer major losses to your trading account... You don't have to walk down that same path that so many others have trodden before you...
 

nextpotato

New member
@rad14733

I appreciate your advice.

I came in knowing that this is a very rudimentary "strategy" that has been done over and over, so I understand your point. I also understand that the indicators in the image are based on future information, so yes, there needs to be more variables for this to be effective in real time.

I don't expect this script to be effective at all. I just want to figure out how to make this script that behaves in the way I described. Partially out of curiosity, and also in hopes to build upon it when I'm armed with more knowledge.

Any help in figuring out how to script this is appreciated.
 
Last edited:

nextpotato

New member
You're just trying to quantify buying at the bottom and selling at the top?
I was curious to know how common it is for prices to go up after a pullback that stays above the previous swing low, and wanted to quantify the probability of price going up beyond previous swing high based on severity of the pullback, etc.
 

rad14733

Well-known member
VIP
@nextpotato Don't confuse the term "pullback" with "trend reversal" as there is a vast difference... A "pullback" is merely a small dip in an ongoing trend that ends up continuing in the trending direction and not a true reversal... A "pullback" can be considered an opportunity to increase position size at reduced value... I think your lack of understanding of proper terminology is impeding your ability to find what you are looking for... Hence my advice to do ample research... Keep at it and you'll get the hang of things...
 

nextpotato

New member
@nextpotato Don't confuse the term "pullback" with "trend reversal" as there is a vast difference... A "pullback" is merely a small dip in an ongoing trend that ends up continuing in the trending direction and not a true reversal... A "pullback" can be considered an opportunity to increase position size at reduced value... I think your lack of understanding of proper terminology is impeding your ability to find what you are looking for... Hence my advice to do ample research... Keep at it and you'll get the hang of things...
Ah you're right, the price action in the image I posted is too severe to be called a pullback, and the overall trend isn't upwards. Thank you for enlightening me.
 

MerryDay

Well-known member
VIP
@nextpotato If you search Buy The Dip on the internet, it will round out the information that @rad14733 has given.
This forum has a VIP-only Buy The Dip indicator. You should have a good grasp of the complexities before starting to trade this strategy.
The majority of the investors that fail at this strategy is because they don't grasp that the equity must first have a trend before you can trade the pullback.
 

rad14733

Well-known member
VIP
@nextpotato As if by destiny, earlier this evening I had YouTube auto-playing videos and THIS video started playing... I went back into my video history and grabbed the link to share with you... It explains pullbacks and pullback strategies... Mind you, these are actual pullbacks rather than reversals... Just some good information for you to learn if you are so inclined...
 

SismiqueJ

New member
Yes! So there's a guy who I follow on YouTube who has a strategy scalping trends utilizing pullback zones. He bases his pullback zones off of previous candle bodies/wicks on 5/10 minute candles. I figured your indicator tweaked to match his strategy would be insanely powerful. He is very accurate with his zones.
 

nextpotato

New member
I'll have a look. I don't think I'll be working on this right away, but I will keep you in the loop if I make any successful updates to my indicator. Thanks for letting me know about this.
 

Similar threads

Top