Tâche terminée
Spécifications
Hello
Im using a indicator in Tradeview and i like to trade with it. Looking to make it work on MT5 and MT4. Not sure price but tell me thoughts and time frame
I would like it built identical as well as add some other things to the expert. Below are some add ons i would like
If possible i would like a trailing stop / Breakeven
so input -
Breakeven - in Pipis
Trailtrigger - Pips
trailing distance - pips
trailing step - pipis
filters to trade different sessions to have true or false / on and off
Like to have
monday - sunday and to be able to have certain days on or off for trading
if i want a pause and stop trading time frame to have that option for example the last hour of the NY session because of not wanting to hold trade over night
i have some other ideas however if we can get started on this and can add more later......
is there a way to also have Volume play a roll in if it takes a trade or not as well?
Below is the PINE SCRIPT.
strategy(shorttitle="SSL EMA strat", title="ssl ema", overlay=true)
// Moving average
hma(src, len) =>
wma(2 * wma(src, len / 2) - wma(src, len), round(sqrt(len)))
ma = input(title="MA type", defval="EMA", options=["EMA", "SMA", "Hull", "WMA"])
MA(price, length) =>
current = if ma == 'EMA'
ema(price, length)
else
if ma == 'SMA'
sma(price, length)
else
if ma == 'WMA'
wma(price, length)
else
hma(price, length)
current
price = input(close, title='Price')
maFast = MA(price, input(50))
maSlow = MA(price, input(100, title='MA Slow'))
maTurtle = MA(price, input(200, title='MA Turtle'))
viewCrossFlag = input(false, title='View MA Slow/Turtle crossover')
plot(maTurtle, title="MA Turtle", style=plot.style_circles, linewidth=4, color=maFast >= maSlow ? #CCCCCC : #222222)
plot(maFast, title="MA Fast", style=plot.style_circles, linewidth=4, color=color.yellow, transp=0)
plot(maSlow, title="MA Slow", style=plot.style_circles, linewidth=4, color=color.purple, transp=0)
//plotchar(viewCrossFlag and crossunder(maSlow, maTurtle), char='✜', color=red, location=location.top, transp=0, size=size.tiny)
//plotchar(viewCrossFlag and crossover(maSlow, maTurtle), char='✜', color=green, location=location.bottom, transp=0, size=size.tiny)
period = input(title="Period", defval=10)
len = input(title="Period", defval=10)
smaHigh = sma(high, len)
smaLow = sma(low, len)
Hlv = int(na)
Hlv := close > smaHigh ? 1 : close < smaLow ? -1 : Hlv[1]
sslDown = Hlv < 0 ? smaHigh : smaLow
sslUp = Hlv < 0 ? smaLow : smaHigh
plot(sslDown, linewidth=2, color=color.red)
plot(sslUp, linewidth=2, color=color.lime)
// rsi
length = input( 14 )
overSold = input( 50 )
overBought = input( 50 )
pricev = close
tp = input(200)
sl = input(100)
vrsi = rsi(pricev, length)
co = crossover(vrsi, overSold)
cu = crossunder(vrsi, overBought)
plotchar(crossunder(sslUp, sslDown) and cu and maTurtle > maSlow and maSlow > maFast and maFast > close , char='✜', color=color.red, location=location.top, transp=0, size=size.tiny)
plotchar(crossover(sslUp, sslDown) and co and maTurtle < maSlow and maSlow < maFast and maFast < close , char='✜', color=color.green, location=location.bottom, transp=0, size=size.tiny)
strategy.entry("short",strategy.short, when= crossunder(sslUp, sslDown) and maTurtle > close and cu)//,and maTurtle > maSlow and maSlow > maFast and maFast > close )
strategy.exit("tp/sl", profit=tp, loss=sl)
strategy.close("short", when = crossover(sslUp, sslDown) ,comment="exit_cond")
strategy.entry("long",strategy.long, when= crossover(sslUp, sslDown) and maTurtle < close and co)//, and maTurtle < maSlow and maSlow < maFast and maFast < close )
strategy.exit("tp/sl", profit=tp , loss=sl )//when = crossunder(sslUp, sslDown),comment="exit_cond")
strategy.close("long", when = crossunder(sslUp, sslDown) ,comment="exit_cond")
//alertcondition(crossunder(maFast, maSlow), title='MA cross sell', message='We have a MA sell signal!')
//alertcondition(crossover(maFast, maSlow), title='MA cross buy', message='We have a MA buy signal!')
// Remember to use SMA 50 and SMA 200 on daily frame to get valid Golden and Death cross signals.
//alertcondition(crossunder(maSlow, maTurtle), title='Death cross', message='Death cross. We have a MA slow crossing under the Turtle. Generally a strong sell signal!')
//alertcondition(crossover(maSlow, maTurtle), title='Golden cross', message='Golden cross. We have a MA slow crossing over the Turtle. Generally a strong buy signal!')