//@version=2

strategy("Mesut Day Compare strategy", shorttitle="Mesut Day Close Stg", overlay=false)

 

threshold = input(title="Price Difference Threshold", type=float, defval=0, step=0.001)

getDiff() =>

    yesterday=security(tickerid, 'D', close[1])

    today=security(tickerid, 'D', close)

    delta=today-yesterday

    percentage=delta/yesterday

   

closeDiff = getDiff()

 

buying = closeDiff > threshold ? true : closeDiff < -threshold ? false : buying[1]

 

bgcolor(buying ? green : red, transp=25)

plot(closeDiff, style=area, transp=75)

plot(closeDiff, color=aqua, title="prediction")

 

longCondition = buying

if (longCondition)

    strategy.entry("Long", strategy.long)

 

shortCondition = buying != true

if (shortCondition)

    strategy.entry("Short", strategy.short)

 

bu stratejiyi matriks te kulalnılacak şekilde düzenleyebilirmisiniz