Merhaba aşağıdaki tradingview kodunun Matriks iq uyarlanmış halini yazabilirmisiniz.Desteğiniz için şimdiden teşekkür ederim.
//@version=4
//Developed by Serhat
strategy("STRATEJI", overlay=false, pyramiding=0, default_qty_type = strategy.cash, default_qty_value = 100, commission_value=0.075, initial_capital=100, currency=currency.USD)
length = input(20,"Length")
smooth = input(100,"Smooth")
src = input(hl2, "Source", type = input.source)
esc= ema(rsi(src,length),smooth)
ustdeger = input(60, "USTDEGER")
altdeger = input(40, "ALTDEGER")
al = crossover(esc, altdeger)
sat = crossunder(esc, ustdeger)
longLossPerc = input(title="Stop Loss Long(%)", type=input.float, minval=0.0, step=0.1, defval=1.5) * 0.01
shortLossPerc = input(title="Stop Loss Short(%)", type=input.float, minval=0.0, step=0.1, defval=1.5) * 0.01
longStopPrice = strategy.position_avg_price * (1 - longLossPerc)
shortStopPrice = strategy.position_avg_price * (1 + shortLossPerc)
longtakePerc = input(title="Take Profit Long(%)", type=input.float, minval=0.0, step=0.5, defval=9.5) * 0.01
shorttakePerc = input(title="Take Profit Short(%)", type=input.float, minval=0.0, step=0.5, defval=9.5) * 0.01
longExitPrice = strategy.position_avg_price * (1 + longtakePerc)
shortExitPrice = strategy.position_avg_price * (1 - shorttakePerc)
entry_long = al
entry_short = sat
exit_long = sat
exit_short = al
///// BACKTEST PERIOD ///////
testStartDay = input(1, "Backtest Start Day")
testStartMonth = input(5, "Backtest Start Month")
testStartYear = input(2021, "Backtest Start Year")
testPeriodStart = timestamp(testStartYear,testStartMonth,testStartDay,0,0)
testStopDay = input(31, "Backtest Stop Day")
testStopMonth = input(12, "Backtest Stop Month")
testStopYear = input(2021, "Backtest Stop Year")
testPeriodStop = timestamp(testStopYear,testStopMonth,testStopDay,0,0)
testPeriod() =>
time >= testPeriodStart and time <= testPeriodStop ? true : false
if testPeriod()
if strategy.position_size == 0 or strategy.position_size > 0
strategy.entry(id="long", long=true, when = entry_long, comment="ENTER-LONG")
strategy.close(id="long", when=exit_long, comment = "EXIT-LONG")
strategy.exit(id="STOP-L", stop=longStopPrice, limit = longExitPrice, comment = "EXIT-LONG")
if strategy.position_size == 0 or strategy.position_size < 0
strategy.entry(id="short", long=false, when = entry_short, comment="ENTER-SHORT")
strategy.close(id="short", when=exit_short, comment = "EXIT-SHORT")
strategy.exit(id="STOP-S", stop=shortStopPrice, limit = shortExitPrice, comment = "EXIT-SHORT")
///////////////