🚩 LESSON SOURCE CODE: courses.theartoftrading.com/pages/atr-trailing-stop-in-pine-script 🚩 My Socials & More Free Content: theartoftrading.com 🚩 FREE Pine Script Basics Course: courses.theartoftrading.com/courses/pine-script-basics-course 🚩 Pine Script Mastery Course: courses.theartoftrading.com/courses/pine-script-mastery 🚩 My Indicators & Strategies Course (Steal My Code!): courses.theartoftrading.com/courses/my-indicators 🔷 Create your FREE TradingView Account: www.tradingview.com/gopro/?offer_id=10&aff_id=15271
@Gimposai7 ай бұрын
Thank you for this Art of Trading! For those who are new to trailing stops (like myself), be careful with super low trailing stop values as it'll give you unrealistic exits (a 1 tick trailing stop will exit you out 1 tick away from the high or low). This is due to simulating intrabar price movement in straight lines. This is from the "Broker Emulator" section of the pine script user manual: Since the emulator can only use chart data, it makes assumptions about intrabar price movement. It uses a bar’s open, high, and low prices to infer intrabar activity while calculating order fills with the following logic: If the high price is closer to the opening price than the low price, it assumes that the price moved in this order on the bar: open → high → low → close. If the low price is closer to the opening price than the high price, it assumes that the price moved in this order on the bar: open → low → high → close.
@greekboydinos7 ай бұрын
amazing. i’ve been waiting for this for years
@GreenStickStrategies7 ай бұрын
Love videos that go back to basics. Thanks. Greetings from South America.
@bhupendraghanghoriya72637 ай бұрын
You are awesome! Thanks for all the knowledge you are giving free of cost without having any hidden agenda. Thanks Mate!
@Whiterabbitz427 ай бұрын
Great info as usual.. Thanks so much for sharing tyour info. Have been thinking about an exit strategy for any long entry written in pinescript.. so I came to the master. Setup input stop loss and profit taker % via input, set up max lots via input , setup max drawdown via input. 1) Enter trade under some condition ie macd cross up etc... 2) Set trail stop loss and profit taker 3)if stop loss hit close 4) if profit taker hit then don't close but make another buy and adjust stop loss and profit taker for the whole position. 5) rinse and repeat until stop loss is hit. The numbers for this strategy are very interesting , maybe set max drawdown or max number of positions.
@Acosta3607 ай бұрын
I gave up trying to get my trailing stop loss to work but I got it to work now. Thanks!
@calvinlm887 ай бұрын
Hi, your previous videos on Real Test are captivating. Nice if you can talk more on those applications. Cheers
@Matt_Pallardy6 ай бұрын
This is amazing, thank you! Do you have a video explaining how to use multiple potential exits? For example, I want to set a stop loss when I open the trade and then once I reach a certain level of profit, I want a trailing stop to kick in. Thank you again!
@dub4art7 ай бұрын
Can I suggest a topic for next lesson? Handling partials and stop loss in strategies that use strategy.entry to reverse the trade. In other words when trading condition changes from Sell to Buy (and vice versa) the strategy doesn't exit the trade (although there are some cases when it might, eg. during low or very high volatility conditions) but rather flips the trade in opposite direction. I found coding reliable SL and TPs very challenging in these circumstances.
@vikrantl18243 ай бұрын
Any coupon? for monthly plan?
@therealdonovanjones30663 ай бұрын
Can you just use the na(x) function?
@MrRocka124 ай бұрын
what are the conditions that makes this script take entires?
@only_trades6 ай бұрын
Hi there is it possible to create predetermined stop orders for both entry and exit strategies. This would mean that positions can be opened 'intrabar' as opposed to 'on candle close', creating a more dynamic entry system. The stop order would be the trigger for entry and after each candle close the stop order would be recalculated if an entry was not triggered. Similarly for exit positions, where stops are triggered as soon as price crosses threshold. I dont know if pinescript can do this?
@ezrakoper7 ай бұрын
Hi Matt. When using the some parts of your code, I was interested in to add a label with the trailing stop hit price and time when it occurred. So on bar close after calculating the trailing stop exit price (long only), I was checking if the close price is lower then the ATR I calculated. And if so, add a label and a log message. To my surprise I never get the log and nether the label. On the next line comes the ATR trailing stop that will cause the trade to exit. And this do happen. So my question is - do you have any idea why the log message and label are not executed?
@dumbcat6 ай бұрын
curious how your script managed to exit intra-bar when you did not tell it to do anything special. i've had trouble trying to get intra-bar exits. i don't see anything in your code that suggests the exit should happen immediately. thanks
@idrisifelana9747 ай бұрын
This is a nice stuff, how can I get the mql4 ver. of it.?
@thomasreinhardt36267 ай бұрын
I remember you had this atr trailing stop already a year ago. And in not moving markets, one can forget it.
@AlxTSLA7 ай бұрын
Hey, can you show an indicator for the COT data’s? Or a kind of forecast indicator?
@cakeprofits75897 ай бұрын
Dude, you are the best
@prakashrasania56375 ай бұрын
Great, Sir.
@MrRocka124 ай бұрын
Take profit?
@roystoncartwright56407 ай бұрын
thank you 😊
@her_limerence3 ай бұрын
What is the difference between strategy.exit and strategy.close?