Build a Moving Average Pullback Backtester in 35 Minutes

  Рет қаралды 5,885

TOS Indicators

TOS Indicators

Күн бұрын

Пікірлер: 37
@justtrade9903
@justtrade9903 2 жыл бұрын
I'm speechless. This is incredible. I'll be having lots of fun playing it with several tickers and actually reduce the time frame to start from early this year when we started to have the reversal to see how SPY, etc., are now reacting to the EMAs. Thank you!!
@TOSIndicators
@TOSIndicators 2 жыл бұрын
My pleasure, and sounds like an awesome backtest idea! I'd be curious to learn any insights you find along the way.
@DA33_718
@DA33_718 Жыл бұрын
great stuff teacher 🙂
@MrWetnutz
@MrWetnutz 2 жыл бұрын
Thank you Thank you Thank you. I have been struggling for so long to get TOS to "capture" price at the time of purchase for exits. This is a tremendous help.
@TOSIndicators
@TOSIndicators 2 жыл бұрын
My pleasure! Glad to hear it helped.
@lorensaunders5772
@lorensaunders5772 2 жыл бұрын
Holy shit this is one of your best videos ever and shows the true power of the TOS feature set. So nicely explained thank you. This is exactly what I was looking for as well... so I can build my own backtester for a strategy I'm working on. Thank you thank you thank you.
@TOSIndicators
@TOSIndicators 2 жыл бұрын
Thanks Loren! I'm glad you found it helpful for your own strategy, as well... that's awesome.
@scottellsworth284
@scottellsworth284 2 жыл бұрын
I accidentally stumbled upon your video googling strategies. Absolutely amazing video! Thank you!
@TOSIndicators
@TOSIndicators 2 жыл бұрын
Welcome Scott! And thank you, I appreciate the kind words.
@GrimmReapa
@GrimmReapa 2 жыл бұрын
Thanks for all you do especially The How To Thinkscript. To this day, I stare at the VWAP script and don’t understand it or how to make a copycat if possible. Keep up the Great Work!
@TOSIndicators
@TOSIndicators 2 жыл бұрын
Thanks Tyronne! I'm sure you're much better than you think you are at thinkScripting.
@darckfire
@darckfire 2 жыл бұрын
This is Magnificent !
@TOSIndicators
@TOSIndicators 2 жыл бұрын
Thanks Abisai!
@RangesRider
@RangesRider 2 жыл бұрын
Thank you so much! Always love to see your videos, very helpful.
@TOSIndicators
@TOSIndicators 2 жыл бұрын
Thanks Imran! Hope you're doing well.
@abrahamfriedman4320
@abrahamfriedman4320 2 жыл бұрын
Good stuff - love the back testers
@TOSIndicators
@TOSIndicators 2 жыл бұрын
Thanks Abraham! They're usually the most fun to tinker with, as well.
@abrahamfriedman4320
@abrahamfriedman4320 2 жыл бұрын
@@TOSIndicators agreed - I'm your biggest fan
@abdulmohsen7132
@abdulmohsen7132 2 жыл бұрын
hi bro thanks for these videos it helps us can you please explain how to create scanner for breakout and retest strategy thank you for your time.
@TheJustinjet
@TheJustinjet 2 жыл бұрын
You guys are great!
@TOSIndicators
@TOSIndicators 2 жыл бұрын
Thanks Dan! Appreciate your kind words.
@peterneckermann1494
@peterneckermann1494 2 жыл бұрын
good stuff! with the retracement though, it seems like the buy/sell to open price is being retrieved within the signal candle itself at the retracement level rather than at the next instance of retracement.., am i missing something here?
@TOSIndicators
@TOSIndicators 2 жыл бұрын
Hi Peter - I think you have it correct; the backtester will take an entry at the first pullback to the chosen EMA. If you'd like it to be the next instance, you would need to create a variable that stores the appropriate EMA price value, which you can then reference (and update, if necessary) for future candles.
@peterneckermann1494
@peterneckermann1494 2 жыл бұрын
@@TOSIndicators thanks for the reply. yes, that makes perfect sense... only, its beyond my current skill level at present! Any chance you have another backtester from which i could copy such an expression?
@TOSIndicators
@TOSIndicators 2 жыл бұрын
Hi Peter - don't have anything you can copy/paste, but you can find examples of creating a variable that stores a value for future reference in our Opening Range Breakout indicator tutorial: tosindicators.com/indicators/opening-range-breakout
@peterneckermann1494
@peterneckermann1494 2 жыл бұрын
@@TOSIndicators brilliant, thank you so much!
@SRUSeal
@SRUSeal 2 жыл бұрын
Looking forward to playing around with this. Is there a way to combine it with the Squeeze back tester? For example, positive stacked EMAs + squeeze + pullback = entry. Might reduce trade triggers but would be great to determine ATR targets/stops for squeezes in different markets.
@TOSIndicators
@TOSIndicators 2 жыл бұрын
Hi Jesse - We have something similar already built -- our Slingshot Squeeze and Squeeze Signals backtesters, with incorporates squeeze conditions and more robust entry/exits. You can find both of them here: www.tosindicators.com/squeeze-course
@SRUSeal
@SRUSeal 2 жыл бұрын
@@TOSIndicators I really dig those backtesters actually. I noticed however that when those populate the price has usually already started it's move (great for last minute entries). I was mainly asking because a pullback for a squeeze usually means getting a "better" entry as long as the price doesn't consolidate forever. I got bored at work and did some playing around with the Squeeze and Pullback backtesters and I was able to create a strategy that looks for entries at the EMA pullback after a five bar squeeze and the EMAs a stacked appropriately for the direction of the play. Since I also use ATR for my exits I took that from the Pullback Backtester as well for the Squeeze. Thanks for these videos! I never would have thought I'd get into coding. If you'd like to take a look at what I was able to jumble together let me know...it's only my second attempt at coding however.
@markkennedy5955
@markkennedy5955 2 жыл бұрын
If you find through the back tester a list of stocks that work well, can you apply this as a working strategy to a watchlist that gives you signals to take real trades?
@TOSIndicators
@TOSIndicators 2 жыл бұрын
It should be possible, but you would need to adapt the code a bit, removing the AddOrder function, exit signals, etc., and only output the entrySignals as your label output.
@neuvocastezero1838
@neuvocastezero1838 2 жыл бұрын
This is great, but I don't understand why it's necessary to add another "entry price" parameter between the conditional statement and order quantity in the exit orders.
@TOSIndicators
@TOSIndicators 2 жыл бұрын
Hi there, the entryPrice() function lets you reference the price used by the backtester for the entry, and is useful for exit orders (ie. target 5% gain from entry or 2% stop from entry).
@neuvocastezero1838
@neuvocastezero1838 2 жыл бұрын
@@TOSIndicators OK, Thanks for the reply!
@57Carlibra
@57Carlibra 2 жыл бұрын
Can you see any errors? I followed you as meticulously as I could but I'm still getting red lettering when I get back to the "Added Studies and Strategies" area, meaning the scroll script has errors. Ideally, all your code could be put under the "More" area, so that I wouldn't have to follow along and playback the video repeatedly to type what you've just done. Sort of a frustrating 2 hours for me here. Hope you can spot the error. I tried to go to the link you gave but that's a zip file and I really don't see why a couple of lines of code would need to be in that format and zip files make me a bit suspicious. Here's the code I believe you taught. If I try to open up the sprocket to change the variables, nothing appears as shown in your version. input longEntries = yes; input shortEntries = no; input entryMA = {default EMA8, EMA21, EMA34, SMA50, SMA200}; input sentryType = {default pullbackOnly, Confirmation}; input targetMultiplier = 2; input stopMultiplier = 1; input quantity = 10; def EMA8 = ExpAverage(close, 8); def EMA21 = ExpAverage(close, 21); def EMA34 = ExpAverage(close, 34); def SMA50 = SimpleMovingAvg(close, 50); def SMA200 = SimpleMovingAvg(close, 200); def entryPullbackMA; switch (entryMA){ case EMA8: entryPullbackMA = EMA8; case EMA21: entryPullbackMA = EMA21; case EMA34: entryPullbackMA = EMA34; case SMA50: entryPullbackMA = SMA50; case SMA200: entryPullbackMA = SMA200; } def bullishStackedMAs = EMA8 > EMA21 and EMA21 > EMA34 and EMA34 > SMA50 and SMA50 > SMA200; def bearishStackedMAs = EMA8 < EMA21 and EMA21 < EMA34 and EMA34 < SMA50 and SMA50 < SMA200; def bullEntrySignal; def bullEntryPrice; def bearEntrySignal; def bearEntryprice; switch (entryType){ case pullbackOnly: bullEntrySignal = bullishStackedMAs and low = entryPullbackMA; bearEntryprice = entryPullbackMA; case Confirmation: bullEntrySignal = bullishStackedMAs and Lowest (low, 2) high[1]; bullEntryPrice = close; bearEntrySignal = bearishStackedMAs and Highest (high, 2) >= entryPullbackMA and close < low[1]; bearEntryprice = close; } def ATRvalue = if (bullEntrySignal and !bullEntrySignal[1] or (bearEntrySignal and !bearEntrySignal[1] then ATR(14) else ATRvalue[1]; AddOrder(OrderType.BUY_TO_OPEN, longEntries and bullEntrySignal, bullEntryPrice, quantity); AddOrder(OrderType.SELL_TO_CLOSE, high >= EntryPrice() + targetMultipler * ATRValue, EntryPrice() + targetMultiplier * ATRValue, quantity); AddOrder(OrderType.SELL_TO_CLOSE, low
@TOSIndicators
@TOSIndicators 2 жыл бұрын
You can download the backtester from our website and compare with your version. Looks like you have open paranthesis, without a closed one. Here are instructions on how to unzip a ThinkOrSwim file and import into your platform, if you need help with the process: tosindicators.com/thinkscript/how-to-import-thinkorswim
@57Carlibra
@57Carlibra 2 жыл бұрын
@@TOSIndicators I appreciate your reply.
Build a Extreme $TICK Counter in ThinkOrSwim
9:47
TOS Indicators
Рет қаралды 6 М.
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН
277% Gain in 2021 | Interview with Mark Minervini | Market Wizard
56:23
Build a Moving Average Crossover Backtester in 20 Minutes
20:48
TOS Indicators
Рет қаралды 22 М.
Tale Of Two Markets: Are The Best Of Times Still Ahead? | SwingTrader Status Update
47:54
Build a SMARTER MACD Indicator in 20 Minutes (Free Download)
22:35
TOS Indicators
Рет қаралды 4,8 М.
“Train your Mind to Make Money!” - Rande Howell | Trading Psychology
49:50
Etienne Crete - Desire To TRADE
Рет қаралды 416 М.
How to Add a Label in ThinkOrSwim (Beginner-Friendly)
23:18
TOS Indicators
Рет қаралды 17 М.
Moving Average Crossover Pullback Strategy ☑️
5:25
UKspreadbetting
Рет қаралды 7 М.