Psychological for Strategy testing

有名なサイコロジカルラインのストラテジーテスターの数値変化による、勝率等の分析を容易にするために、各パラメーターと連動して作成しました。

Hello everyone
I’ve made Psychological to be able to adjust some variables for strategy.
When you adjust each parameter of the settings, the strategy tester also comes to work in conjunction with.
so please find your best parameter! ^^

//@version=4
strategy(title="Psychological for strategy", shorttitle="PL+", precision=1)

up = input(type=input.integer, title="Upper line", defval=85)
bot = input(type=input.integer, title="Botom line", defval=15)
pro = input(type=input.integer, title="profit", defval=50)
los = input(type=input.integer, title="loss", defval=250)


calcSource = input(type=input.source, title="Source", defval=close)
days = input(type=input.integer, title="Days", defval=10, minval=1)
transparent = color.new(color.red, 100)

isUp(series) =>
    series[1] < series[0] ? 1 : 0

CalcPsycholo(isUp, length) =>
    sum(isUp, length) / length * 100
Psycho = CalcPsycholo(isUp(calcSource), days)
hline(50, linestyle=hline.style_dashed, color=color.gray, linewidth=1)
minLine = hline(0, linestyle=hline.style_dashed, color=transparent)
maxLine = hline(100, linestyle=hline.style_dashed, color=transparent)
downLine = hline(bot, linestyle=hline.style_dashed, color=color.blue)
upLine = hline(up, linestyle=hline.style_dashed, color=color.red)
fill(minLine, downLine, color.blue)
fill(maxLine, upLine, color.red)
plot(Psycho, style=plot.style_line, color=color.white, linewidth=1)


if Psycho < bot
    strategy.entry("longEnt", strategy.long)
    strategy.exit("Exit Long", profit=pro, loss=los)
if Psycho > up
    strategy.entry("ShortEnt", strategy.short)
    strategy.exit("Exit Short", profit=pro, loss=los)

0
Author: ユウスケ

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です