StartMonth = input.int(title="Start Month", defval=1, minval=1, maxval=12) StartDate = input.int(title="Start Date", defval=1, minval=1, maxval=31) Make input options that configure backtest date range Update 3: In case you want to restrict the backtest to certain dates, use this: Plot(0, color=scolor, style=plot.style_cross, linewidth=2) Plot(val, color=bcolor, style=plot.style_histogram, linewidth=4) Scolor = noSqz ? color.blue : sqzOn ? color.black : ay Val = ta.linreg(source - math.avg(math.avg(ta.highest(high, lengthKC), ta.lowest(low, lengthKC)), ta.sma(close, lengthKC)), lengthKC, 0)īcolor = val > 0 ? val > nz(val)? color.lime : een : val nz(val) and val > nz(val) and val = nz(val)) RangeToUse = useTrueRange ? ta.tr : (high - low) UseTrueRange = input.bool(true, title="Use TrueRange (KC)") Strategy(shorttitle = "SQZMOM_LB", title="Squeeze Momentum Indicator ", overlay=false) In real-life, I would probably go with whatever color the candle is close to close instead of waiting till the next List of all my indicators: It's probably checking the candle the next day, as the candle isn't known until after the close. I'm not sure if it's calculated daily or monthly.īased on the Buy-Sell indicators, it looks like it's buying and selling at the expected times, but delayed by one day. It seems like if your security does well, it will generally reduce the downturns at the expense of the return as well. I'm very new to Pine Script and backtesting on TradingView, so I might have gotten things wrong. Update 2: I managed to convert it from v1 to v5 and ran a backtest. Update: I found out about the Bar Replay feature. Plot(0, color=scolor, style=cross, linewidth=2) Plot(val, color=bcolor, style=histogram, linewidth=4) Scolor = noSqz ? blue : sqzOn ? black : gray Val = linreg(source - avg(avg(highest(high, lengthKC), lowest(low, lengthKC)),sma(close,lengthKC)), NoSqz = (sqzOn = false) and (sqzOff = false) SqzOn = (lowerBB > lowerKC) and (upperBB upperKC) UseTrueRange = input(true, title="Use TrueRange (KC)", type=bool) MultKC = input(1.5, title="KC MultFactor") Study(shorttitle = "SQZMOM_LB", title="Squeeze Momentum Indicator ", overlay=false) others in the group are welcome to join in the conversation On the face of it, it appears that if you buy on the second dark red bar or on the second light green bar, and sell on the second dark green bar or the second light green bar, you'd have a high probability of success. I found this indicator that appears to be so effective that it might be too good to be true.Īs you're a very experienced trader and I'm a newbie, I'd be grateful if you could help me out by analyzing it.ĭoes it look like the chart is using information that it's not supposed to be using, i.e., from the future? Are bars in the past being retroactively updated based on future days? if we come back to the chart after a month, would the previous bars remain the same color?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |