Dynamic StopLoss following an indicator

Dynamic StopLoss following an indicator

Hi everybody!

In this example we are following a position with Parabolic SAR indicator.

Each new candle will be updating STOPLOSS to the new Parabolic SAR position.

 

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. gm74 • 04/28/2016 #

    This has changed my life. Thank you!!!!!

  2. gm74 • 04/28/2016 #

    I might have spoken too soon. Could you possibly shed some light? I am wanting to set dynamic stop losses based on my profit. In effect a highly customisable trailing stop.Take the following for example. if the trade is 250 points in profit, I would like to set a stop loss at 100 points profit. Look at the following example for if I were in a short trade:
    //Current trade points in profit profits=positionperf*tradeprice

    if shortonmarket then
    if profits>250 then
    exitshort at tradeprice-100 stop
    endifif profits>400 thenexitshort at tradeprice-350endifendif
    However, this does not give me the desired result. Do I also have to open the short in the same way? As I am currently opening the short as follows: 
    sellshort at market
    I do not wish to use trailing stops, as I want the freedom to adjust the stop trailing steps at various intervals. Ie, if 250 points in profit, exit if drop to 100 BUT if 400 points in profit, exit if drop to 350.
     
    Any help would be appreciated. 

  3. Madrosat • 04/28/2016 #

    Quelqu’un pourrait il répondre à cette question restée sans suite???

  4. denmar • 04/28/2016 #

    Hi

    Could somebody please enlighten me how this code operates. I wish to use the code (is this an indicator?) as a mechanism to automatically adjust my stop once in a trade. Can one invoke this once one has opened a position manually? If so, how is this done. Is it simply a matter of attaching the “indicator” [My experience is limited to Metatrader where there was a difference between indicator and things called scripts] This being the case could I split the code and have one for long – including lines 19 -27 and one for short – including lines 29-37.

    Thank you

  5. denmar • 04/28/2016 #

    Testing email notification to Denmar

  6. David Black • 04/28/2016 #

    #gm74 Did you ever get this figured out?

    gm74

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
MauroPro It is possible to apply this indicator ON the chart , because when I try to apply the formul...
Nicolas Yes, just apply it on the price chart by using the wrench on the left upper side of your pri...
MauroPro Hi Nicolas, thanks for the reply, I managed to apply the indicator on the chart.
Caribeengeek Bonjour j’avais vu que vous proposiez d’écrire des codes pour ceux qui s’y connaisse pas Mai...
Caribeengeek Les devises unité
Nicolas Merci d'utiliser le forum pour les demandes de programmation personnalisée
jebus89 Big thanks for sharing this :) Seems to work as expected, good stuff.
GraHal Please forgive the daft question, but why is 3-bars-trailing-stop-williams-3.itf included a...
Kris75 Hi, Seems great but what would be the code for a stock ? Thanks, Chirs
oakenstream Paul, what is the best way in your opinion to know if I have over optimized?
Mr_Balagan Bonjour, j'ai quelques questions concernant cette combinaison d'indicateurs qui à l'air inté...
larouedegann STE : Fonction statistique "erreur standard" de séries temporelles de N périodes pour le pri...
Mr_Balagan Merci pour ces informations précieuses larouedegann. J'y vois plus clair. Encore joli boulot
Kris75 Hi Gabri I launched a very simple strategy based on the 3 bars trailing stop that you cre...
TimDeCat Hi. Has anyone coded a version that you could alter it to say 5 bar trailing stop? ie make ...
Nicolas Please open a new topic in forums so we can code it there, thanks.
Nicolas
7 years ago
Loop Hi All! Would it be possible to have the same indicator with the MACD calculated with the DE...
Nicolas Why not, but do you think it would make such a noticeable difference?
Loop Good question Nicolas! That's why I was curious to check it! MACD based on DEMA is usually m...
Nicolas Rien, il faut l'appliquer sur la charte. Soit le mettre sur le graphique du prix, à l'aide d...
signorini Merci pour votre réponse. Je l'applique sur la charte, j'utilise la petite clé pour effacer ...
signorini Je vous remercie, Nicolas. C'est fixé. Très bon week-end.
Guibourse Hi ! I am asking once again for your help : would it be possible to use the ATR as a "take p...
Tradingrob Many thanks for the indicator, however if the price is below the indicator, then the indicat...
aldtrading Merci pour ton travail ! J'ai de bons résultats en utilisant cet indicateur
eisi If i switch between different Markets, the Backgroundcolour will appear where it should not...
datageek How can I get alerts on colour change?
NAMBO40 Hello, I would like to add a 25 period SMA moving average. It's possible?
Adolfo Onrubia Ups! Sorry. Variable "S" is to set an specific Spread if needed. Could be "0", or the distan...
GraHal Hi Adolfo, big thank you for your code, but I am a bit confused. Spread is the difference b...
Meta Signals Pro Hi, For me there is a mistake here L32 maxriesgo = round(equity*riesgo) => round(equ...
Investment Account Wow great thanks ... looks good! Do I set the colour shades up from within the indicator 's...
avatar
Anonymous Thanks for your comments and yes, that is exactly how I set up the colour levels.
Vish Thanks I have added this in my watch list. Has anyone tried it yet ? Does it work on currenc...
GraHal Hi Nicolas I like this and would like to understand it fully so please forgive the (maybe) d...
Nicolas Hi GraHal, the Factor parameter is only a multiplier of the ATR that is added or subtracted ...
GraHal Nicolas, thank you for your useful and informative response. Yes I optimise using ProBackte...
sr021 Hi I tried to copy and paste the code, but recieve the message  : Syntax error:The followi...
Nicolas Hello, of course. You have 3 options : 1/ you download the file and import it into your plat...

Top