How to make a TRAILING STOP in Pine Script

  Рет қаралды 10,720

The Art of Trading

The Art of Trading

Күн бұрын

Пікірлер: 27
@TheArtOfTrading
@TheArtOfTrading 7 ай бұрын
🚩 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
@Gimposai
@Gimposai 7 ай бұрын
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.
@greekboydinos
@greekboydinos 7 ай бұрын
amazing. i’ve been waiting for this for years
@GreenStickStrategies
@GreenStickStrategies 7 ай бұрын
Love videos that go back to basics. Thanks. Greetings from South America.
@bhupendraghanghoriya7263
@bhupendraghanghoriya7263 7 ай бұрын
You are awesome! Thanks for all the knowledge you are giving free of cost without having any hidden agenda. Thanks Mate!
@Whiterabbitz42
@Whiterabbitz42 7 ай бұрын
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.
@Acosta360
@Acosta360 7 ай бұрын
I gave up trying to get my trailing stop loss to work but I got it to work now. Thanks!
@calvinlm88
@calvinlm88 7 ай бұрын
Hi, your previous videos on Real Test are captivating. Nice if you can talk more on those applications. Cheers
@Matt_Pallardy
@Matt_Pallardy 6 ай бұрын
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!
@dub4art
@dub4art 7 ай бұрын
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.
@vikrantl1824
@vikrantl1824 3 ай бұрын
Any coupon? for monthly plan?
@therealdonovanjones3066
@therealdonovanjones3066 3 ай бұрын
Can you just use the na(x) function?
@MrRocka12
@MrRocka12 4 ай бұрын
what are the conditions that makes this script take entires?
@only_trades
@only_trades 6 ай бұрын
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?
@ezrakoper
@ezrakoper 7 ай бұрын
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?
@dumbcat
@dumbcat 6 ай бұрын
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
@idrisifelana974
@idrisifelana974 7 ай бұрын
This is a nice stuff, how can I get the mql4 ver. of it.?
@thomasreinhardt3626
@thomasreinhardt3626 7 ай бұрын
I remember you had this atr trailing stop already a year ago. And in not moving markets, one can forget it.
@AlxTSLA
@AlxTSLA 7 ай бұрын
Hey, can you show an indicator for the COT data’s? Or a kind of forecast indicator?
@cakeprofits7589
@cakeprofits7589 7 ай бұрын
Dude, you are the best
@prakashrasania5637
@prakashrasania5637 5 ай бұрын
Great, Sir.
@MrRocka12
@MrRocka12 4 ай бұрын
Take profit?
@roystoncartwright5640
@roystoncartwright5640 7 ай бұрын
thank you 😊
@her_limerence
@her_limerence 3 ай бұрын
What is the difference between strategy.exit and strategy.close?
How to detect PULLBACKS in Pine Script
22:52
The Art of Trading
Рет қаралды 13 М.
How to code a TRAILING STOP LOSS in Pine Script
26:51
The Art of Trading
Рет қаралды 37 М.
Lamborghini vs Smoke 😱
00:38
Topper Guild
Рет қаралды 22 МЛН
Увеличили моцареллу для @Lorenzo.bagnati
00:48
Кушать Хочу
Рет қаралды 8 МЛН
Чистка воды совком от денег
00:32
FD Vasya
Рет қаралды 3,7 МЛН
Lazy days…
00:24
Anwar Jibawi
Рет қаралды 7 МЛН
ChatGPT made these TradingView strategies
31:38
The Art of Trading
Рет қаралды 73 М.
The MATH OF WINNING in trading
32:34
The Art of Trading
Рет қаралды 569 М.
ChatGPT inside your Pine Script EDITOR!
13:23
The Art of Trading
Рет қаралды 34 М.
A Simple Moving Average Cross Strategy (& how to use valuewhen)
19:11
The Art of Trading
Рет қаралды 14 М.
Pine Script version 6 is here! This is what you need to know...
20:53
The Art of Trading
Рет қаралды 4,6 М.
How to REDUCE drawdowns in trading
42:41
The Art of Trading
Рет қаралды 25 М.
Understanding & ELIMINATING REPAINTING in Pine Script
27:43
The Art of Trading
Рет қаралды 29 М.
Bitcoin Momentum Strategy: +15,000% GAIN
25:50
The Art of Trading
Рет қаралды 9 М.
PINE SCRIPT: 75% Win Rate on a Simple Pullback Strategy
36:28
The Art of Trading
Рет қаралды 235 М.
Automate your Pine Script Strategies with PineConnector v3!
12:20
The Art of Trading
Рет қаралды 9 М.
Lamborghini vs Smoke 😱
00:38
Topper Guild
Рет қаралды 22 МЛН