How it works:
The strategy tracks the highest and lowest price over the last X number of bars (you select the look-back period). The highest price line is plotted in green and the lowest price line is potted in red. If the price crosses over the lowest price in the last X number of bars, then a buy signal is generated. Exit options include a take-profit % or selling when the price crosses over the highest price in the last X amount of bars. I.e. “Buy low, sell high.” An is also plotted as a blue , and there is an option to only trade if the price is above the .
Disclaimer: Open source scripts I publish in the community are largely meant to spark ideas that can be used as building blocks for part of a more robust trade management strategy. Even though this example script beats buy and hold over the back-test time-frame, I wouldn't advise using it as a stand-alone strategy without significant additions/modifications to the strategy and risk management functions. In this example the script is being used as a medium-term strategy with just 10% leverage over account equity, a $25k start balance, and back-testing 10+ years. Modifiable slippage and commissions are included in the model.
Green line = Highest price in the look-back period
Red line = Lowest price in the look-back period
Blue line = Trend
Hire me to code or automate your trading strategy, or schedule a free consultation at:
Dentro do verdadeiro espírito TradingView, o autor deste script publicou ele como um script de código aberto, para que os traders possam compreender e checar ele. Um viva ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.