Using Trailing Stop Loss in TradingView Strategies (PineScript)

Using Trailing Stop Loss in TradingView Strategies (PineScript)

QuantNomad

4 года назад

33,203 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@PilgrimGutters
@PilgrimGutters - 01.12.2019 19:20

Loving all your videos bro. Helping me learn a lot!

Ответить
@shivamtas
@shivamtas - 15.01.2020 04:37

Loved the simplicity in your videos and they have quite helped me with Tradingview pinescript development.

I created a script using the above strategy.exit() with stop, trail_ponts and trail_offset and it is working flawlessly. So I wanted to create alert notifications.

Buy order notification is coming after certain conditions get satisfied and I'm creating an alert through alertcondition() function in study(), as follows


//Buy Condition
Buy = condition1 and condition2 and testrange
alertcondition(Buy, title = "Buy Signal", message = "Buy Signal Alert")


I'm stuck in the sell order alert notification as I'm using strategy.exit() which has stop, trail_points and trail_offset. So the strategy either hits stop-loss or it starts trailing from a certain percentage with an offset.


//Exit Strategy
strategy.exit("TP/SL", "Enter Long", stop=StopLoss * (1 - sl_inp),
trail_points = close * TrailPer / syminfo.mintick,
trail_offset = close * TrailOffset / syminfo.mintick)


So how can I set up an alert notification for the exit?


As I understand that for the sell order notification I need to create manual code for trailing stoploss which has a stop, trail_points and trail_offset, then create a condition with sell, and then finally use altercondition() in study() to send the sell order alert.

Ответить
@ryanjay13
@ryanjay13 - 19.01.2020 02:48

the issue about the bars and ticks you're speaking about at the end of the video, would ticking the "recalculate on every tick" under strategy properties fix this?

Ответить
@daichisugi
@daichisugi - 09.03.2020 10:16

Many thanks for the great videos!
Is it somehow possible to convert the trailing stop strategy into an indicator with alarm?

Ответить
@nzshareman
@nzshareman - 08.04.2020 22:49

yR vOICE SUX BRO

Ответить
@kreed1004
@kreed1004 - 09.07.2020 01:33

jesus speak up man

Ответить
@dicloniusN35
@dicloniusN35 - 19.07.2020 00:58

по русски бы))

Ответить
@matthewweller158
@matthewweller158 - 23.09.2020 12:44

Hey man, i was wondering if it is possible to program a partial take profit of say 50% of the position but without a full strategy programmed? i just want to place manual trades but when i hit my take profit i want 50% of the position to be left in with a trailing stop. is this possible if so could you help me please. thanks

Ответить
@SeniorCrespo
@SeniorCrespo - 27.09.2020 14:59

Very good videos :) How do you add trailing stop as an ATR ratio ?

Ответить
@VTOLKits
@VTOLKits - 06.10.2020 00:57

Thank, great video! Like!

Ответить
@evolv_85
@evolv_85 - 11.11.2020 14:34

I've been searching for a way to use trail offset as a percentage for a while and came across this. Brilliant stuff, thank you.

Ответить
@charlieabbot3649
@charlieabbot3649 - 24.12.2020 22:25

Do you have a trading group with Trade Setups and TAs?
Thanks

Ответить
@alex_chart3606
@alex_chart3606 - 31.12.2020 13:26

Hi ! Really nice work, How can I display the exit at a specific candlestick point, instead at close or open? (In this video your exit point is perfect) Thank you.

Ответить
@sedna16
@sedna16 - 17.01.2021 10:51

does anyone know how to translate the pinescript code into python pandas dataframe?

Ответить
@AntonioScherillo
@AntonioScherillo - 05.07.2021 17:57

hi!
how i can remove repaint from Trailing Stop Loss?
My strategy enters each candle without using a particular indicator and exits with a trailing stop loss. but i have a repaint problem

Ответить
@mucked4u
@mucked4u - 18.10.2021 20:51

Geez really pissed. Relatively new to trading... I want so much to implement the script etc but I found you extremely difficult to understand. However I think you have something very good to offer. Is there some way to just post the script

Ответить
@vickslee
@vickslee - 30.10.2021 17:19

Many thanks for the great video. How to have both stop loss and trailing stop loss at the same time ? i.e. if i want to protect the trade by setting the stop loss at the beginning but when the trade starts to get profit I will use trailing stop to exit the trade ? Thanks

Ответить
@danielarega6414
@danielarega6414 - 28.11.2021 20:33

Thanks alot man. You have improved a lot my strategy with this lesson.

Ответить
@dougamaral85
@dougamaral85 - 29.01.2022 03:20

Hi, sorry for my bad english... I'm from Brazil and my name is Doug.
Me and my brother are trying to write a trailing stop loss on Tradingview (pine script) and we're being successful.
Our idea is to reach a specific profit target and change the stop loss, for example:
1- When my profit reaches 5% my stop loss will be 0%
2- When my profit reaches 10% my stop loss will be 5%
3- When my profit reaches 20% my stop loss will be 10%
4- Etc... Etc... Etc...
I don't know if you could understand my idea, but that's what we're trying to do but we're not getting it.
Could you kindly help us?
Best regards my friend.

Ответить
@FahmiEshaq
@FahmiEshaq - 22.02.2022 00:13

Algeria is the best

Ответить
@NelsonMandela1million
@NelsonMandela1million - 13.04.2022 18:59

SPEAK UP

Ответить
@edwincalero7550
@edwincalero7550 - 29.04.2022 04:57

Is posible integrate to the chart a trailing stop lost strategy?

Ответить
@Elimperiodema
@Elimperiodema - 19.07.2022 14:22

hi, where I can used this pinescrip of your tutorial?

Ответить
@dhanushprakashj7375
@dhanushprakashj7375 - 08.10.2022 18:27

Is there any possibility to stop the repaint issue with trail_point and trail _offset method

Ответить
@obwanda9113
@obwanda9113 - 28.11.2022 17:54

Hey, I searched all over for a tutorial on writing a Trailing Stoploss based on price reached. All I could find is ATR or Percentage based Trailing Stoploss. My script takes Inputs of Pips for Stoploss and RR for Profit. I would like to move my Stoploss to Breakeven when a trade reaches 1.5R Profit and then move it to 1R when a trade reaches 2R Profit. Simple and Fixed values.

Ответить
@hplovecraftmacncheese
@hplovecraftmacncheese - 11.05.2023 06:34

There is no trailing stop loss feature built in to tradingview? You have to create a custom strategy with the Pine editor?

Ответить