Welcome to the BEST forum for traders

Did you know we're sharing tons of exclusive content here?
Our community is growing quickly. Take a look around and say "Hello".

trailing stop

Jan 27, 2021 - 4:53 PM

Viewed 893 times

https://best-trading-indicator.com/community/bti/forums/4180/topics/22593 COPY
  • Hi, I follow your scripts a lot. For a few days I have been looking for a solution to a problem and I would like to ask you for help. It's about the trailing stop. Sorry for my English. I hope you will understand me. I write a practical example:

    • I execute a long trade at price 100.
    • I therefore insert a trailing stop at 10%. Consequently, the trailing stop will be positioned at price 90.

    What I saw on Trading view and Pine Script is that:

    • if the price rises to 101 (therefore + 1%), also the trailing stop will consequently move to 90.9 (+ 1%).

    There is therefore a 10% trailing stop, but every 1% price increase also the trailing stop will move to + 1%. I will call it: 1% step

    There are some brokers, however, that have different and customizable steps.
    For example, you can enter a 10% trailing stop (as above), but a 5% step.

    In this case, then, this happens:

    • I execute a long trade at price 100.
    • I therefore insert a trailing stop at 10%. Consequently, the trailing stop will be positioned at price 90.
    • if the price rises to 101 (therefore + 1%), the trailing stop this time will not move to 90.9 but will remain stationary at 90.
    • when the price rises to 105 (therefore + 5%), the trailing stop will move to 94.5 (+ 5%).
    • when the price rises to 110 (therefore + 10%), the trailing stop will move to 99 (+ 10%)

    If I have been able to explain myself, in all cases you can choose a trailing stop at 10%. What changes is the percentage price increase that determines the movement of the trailing stop (the steps I mentioned above). It can move whenever the price rises to + 1% (1% step). It can move whenever the price rises to + 2% (2% step). And so on.

    To facilitate understanding, I am attaching an image taken by a broker where there is the possibility to configure the step. In this broker the minimum step is 5 points (or 0.05% on the Eur / Usd exchange) and it is customizable. On another broker (always on the Eur / Usd exchange) the step is instead of 0.001%, not customizable. In my strategy, which I sent you, on Tradingview's Pine Script (for example in the Eur / Usd exchange) the step is 0.01%

    Each broker has different characteristics in the trailing stop and it is necessary to customize the step on Pine script.

    I thought that among the values ​​I enter to configure the trailing stop (for example: the tick, the input or the trail_points) they could also configure this aspect. An aspect that is fundamental to test my future strategies with Tradingview and Pine Script but which, despite numerous searches, I am unable to configure.

    Configuring the value of the step is necessary so that the strategy on pine script reflects, as far as possible, the real operation with brokers.

    Can you help me understand how to configure this aspect?

    %22step%22.png

    0
  • Thank you for your post

    I understood exactly what you want.
    But, this will require some custom coding with your broker or with TradingView

    You can either:

    1) try to code it with Pinescript yourself

    2) Hire me or someone else for doing this project

    3) I already developed a TradingView utility to simulate the trailing-stop as you described (and much more...)
    It's an indicator to be plugged to another indicator/strategy, displaying real-time analytics data and with configurable stop-loss, trailing stop-loss, take-profit, trailing take-profit, ...

    Link: https://best-trading-indicator.com/collections/indicators/products/tradingview-trade-manager

    0

    Dave - Helping traders becoming the best version of themselves
CONTENTS