This is my favorite for Tradingview.

Please use other indicators to find good entry and good exit. This is why this publication has so many indicators. A good indicator will find good results even on line chart. Feel free to try on "Heiken Ashi" but understand that "line" chart is much more realistic
Due to tradingview's crappy auto resize, the best way to view this script is to click on the share button and "Make it Mine".

Then you can see why my other indicators are "PRESENT"

Note di rilascio: This strategy calculates the last high or the last low of a lookback period. If the previous high or low is breached, a signal to enter market is given. This new version adds safety check formula to try to catch potential fake-outs.

Remember that Heiken Ashi do not provide true backtest results because bars are "averaged".

However, this strategy works well with regular candles and line charts if you find the right settings and chart time frame

Note di rilascio: Apologies - Changed version number from 1 to 4
Note di rilascio: Updated to show back test on line chart on 8H BTCUSD
Script open-source

Nello spirito di condivisione promosso da TradingView, l'autore (al quale vanno i nostri ringraziamenti) ha deciso di pubblicare questo script in modalità open-source, così che chiunque possa comprenderlo e testarlo. Puoi utilizzarlo gratuitamente, ma il riutilizzo del codice è subordinato al rispetto del Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.

Vuoi usare questo script sui tuoi grafici?


Epic Results on a "LIne" Chart on 8H BTCUSD!!!!!!!!!!!

Make settings to: close, 41, 10, 1
+2 Rispondi
BruceZou Craig_Claussen
@Craig_Claussen, Can you write it in full
+1 Rispondi
doesnt work ?
Hello sir
I'm trying to learn Pine script.
How do we code a strategy based on the following conditions:
1. BUY if price breaks the highest of the previous (10) bar up
2. SELL if price breaks down the lowest of the previous (10) bar.
3. 3% STOP in both
4. 3% trailing stop for both
Craig_Claussen YatirimciTemel
@YatirimciTemel, Try researching CryptoRox script on stops, takeprofit, and trailstops
YatirimciTemel Craig_Claussen
thank you for your attention.
Does it repaint?
@dpanday, Yes it does. I wonder how much.
settings: ohlc4, 47,23,1

back test results for December 16th.

Net Profit 5.69 %
Max Draw down 0.64 %
Profit Factor 4.118
Total Closed Trades 18
Percent Profitable 61.11 %
Here is script in "Study" format to create alerts

study(title="HIGHER HIGH LOWER LOW STUDY", shorttitle="HH LL STUDY", overlay=true)


//Higher High or Lower Low Entry Inputs
price = input(ohlc4)
LookBack = input(22)
Highest = highest(LookBack)
Lowest = lowest(LookBack)

long = price > Highest
short = price < Lowest

//Safety Confirmation Inputs - Helps to thin out false breakouts or break downs
length = input(2)
High_Guard = highest(length)
Low_Guard = lowest(length)
length2 = input(1)

long1 = long == 1 and Highest > High_Guard
short1 = short == 1 and Lowest < Low_Guard

plotshape(long1, style=shape.triangleup,, size=size.small,
plotshape(short1, style=shape.triangledown, location=location.bottom, size=size.small,

alertcondition(long1, "LONG BTCUSD 15M HHLL", "LONG BTCUSD 15M HHLL")
alertcondition(short1, "SHORT BTCUSD 15M HHLL", "SHORT BTCUSD 15M HHLL")