PineScript has gone a long way, from very simple and little-capable scripting language to a robust coding platform with reliable execution endpoints. However, this one small intuitivity glitch is still there and is likely to stay, because it is traditionally justified and quite intuitive for significant group of traders. I'm sharing this workaround in response to...
"How to code moving stop-loss mechanism", is one of the most often repeating questions in private messages I receive, so just to focus on this mechanism, I made a spin-off from my previous script: TradingView-Alerts-to-MT4-MT5-dynamic-variables-NON-REPAINTING . The logic here moves the stop-loss each time a trade is running and a new pivot high/low is detected....
This strategy uses simple moving average cross for entry signals, but it can be customized with 3 cases: 1- exit at take profit and stop loss; 2- exit when distance between close and moving average is above a user defined minimum; 3- use Renko candles to calculate the moving average without changing the graph candles. The third case is the one with better...