TradingView
kitoboynaya
23 Jul 2020 pukul 06.54

Best strategy for TradingView (fake) 

Bitcoin / TetherUSBinance

Huraian

Hello everyone! I want to show you this strategy so you don't fall for the tricks of scammers. On TradingView, you can write an algorithm (probably more than one) that will show any profit you want: from 1% to 100,000% in one year (maybe more)! This can be done, for example, using the built-in linebreak () function and several conditions for opening long and short.

I am sure that sometimes scammers show up on TradingView showing their incredible strategies. Will a smart person sell a profitable quick strategy? When a lot of people start using the quick strategy, it stops working. Therefore, no smart person would sell you a quick strategy. It is acceptable to sell slow strategies: several transactions per month - this does not greatly affect the market.

So, don't fall for the tricks of scammers, write quick strategies yourself.

About this strategy, I can say that the linebreak () function does not work correctly in it. Accordingly, the lines are not drawn correctly on the chart. They are drawn in such a way as to show the maximum profit. I watched this algorithm on a 1m timeframe - no lines are drawn in real time. This is a fake!

Komen
PineCoders
Thanks for your publication. You are correct in saying that many authors publish misleading strategy results with their scripts. Our many interactions with authors when moderating scripts, which includes strategies producing unrealistic results, point to a lack of knowledge of trading, Pine or backtesting as the most frequent cause. In other instances, as you say, authors are intentionally misleading, and this occurs most frequently with invite-only scripts, where because the source is closed, many cheating techniques can be used to trick unsuspecting traders.

In your specific example, the mere use of `linebreak()` isn't the culprit. The causes for the unrealistic results your script produces can be traced to:

1. The strategy parameters used. A compounding strategy where 100% of equity is used for position sizes does not reflect real-world situations. Your strategy starts with a 100,000 USD position size and by the last trade it is trading a ~20,503,465,543 USD position. The solution is to use a more realistic 5% of equity. You don't specify any slippage either, which is not realistic when your strategy is using market orders, as it does. With a 5% of equity position size and 50 ticks (50¢) of slippage, your strat's net profit will go from 20,746,077% to 86%.

2. Your code doesn't allow for no-repainting, which is what typically would be used in the real world. You can see by activating no-repainting that the same 86% net profit will become -24%, a net loss.

3. The strat is tested on BTC, which tends to produce great results. It will typically produce worse results on other markets.
PineCoders
Here is code that will allow you to test repainting/no-repainting:
//@version=4 strategy("Line break strategy", "LBS", default_qty_type = strategy.percent_of_equity, default_qty_value=100, currency="USD", commission_type=strategy.commission.percent, commission_value=0.07) i_repaint = input(true) f_getLinebreakOHLC(_repaint) => _lb_t = linebreak(syminfo.tickerid, input(3, 'break', input.integer)) float _lb_open = na float _lb_high = na float _lb_low = na float _lb_close = na [_lb_open0, _lb_high0, _lb_low0, _lb_close0] = security(_lb_t, timeframe.period, [open, high, low, close], barmerge.gaps_on) [_lb_open1, _lb_high1, _lb_low1, _lb_close1] = security(_lb_t, timeframe.period, [open[1], high[1], low[1], close[1]], barmerge.gaps_on, barmerge.lookahead_on) if _repaint _lb_open := _lb_open0 _lb_high := _lb_high0 _lb_low := _lb_low0 _lb_close := _lb_close0 else _lb_open := _lb_open1 _lb_high := _lb_high1 _lb_low := _lb_low1 _lb_close := _lb_close1 [_lb_open, _lb_high, _lb_low, _lb_close] [lb_open, lb_high, lb_low, lb_close] = f_getLinebreakOHLC(i_repaint) plotcandle(lb_open, lb_high, lb_low, lb_close, color = lb_close >= lb_open ? color.green : color.red) if lb_close > lb_open strategy.entry("Long", true) else strategy.close("Long") if lb_close < lb_open strategy.entry("Short", false) else strategy.close("Short")
PineCoders
The takeaways from all this for coders would be:
1. Learn about repainting and how to avoid it. We have published scripts to help you with this.
2. Structure your strategy parameters so your backtests use realistic trade positions, slippage, and other assumptions.

For traders, the takeaways should be:
1. NEVER rely on ANY single backtest results published with ANY strategy. Period. This is plain common trading sense—not TV-specific.
2. NEVER pay for an invite-only strategy on the basis of its published results on one market/timeframe, even if past results look good—especially if they look really good.
3. NEVER pay for an invite-only strategy which you cannot test for some time.
kitoboynaya
@PineCoders, you're right! With this strategy, I wanted to show the most unrealistic results. If you use a smaller position size, slippage, etc., you can get results like 5000-10000%. Such results can seduce anyone, but they are also fake. With these strategies, scammers can show any kind of results.
waynexco
@kitoboynaya, @PineCoders
Now I finally know why it is repainting.As candle bar generates, the linebreak() function will check if crieria are met to form a linebreak bar. So you will see this linebreak bar repaints to located at the newest candle for a couple candble bars.
And for a blank candle "else strategy.close("Long") " creates bias on future data peeks.
ZombieStar
@PineCoders, how do I tell if my strategy is repainting? I set it to buy 5 contracts and exit after 50 ticks. No slippage because it's forced to hang out until it gets 50 ticks profit.
thnrich
@ZombieStar, Can this method avoid repainting?
ccrjared
@ZombieStar, I have found that if you simply add alerts on any strategy script you are trying to trade you will get a pop up message from trading view stating as such. When this happens I just delete the script and move on to something else to avoid the losses with a repainting script. Or you can test it on the 1 min and just watch the signals to see if they repaint.
waynexco
@PineCoders, can you please give out the detailed algorithm for function linebreak()? We are trying to fix this repainting issue. @kitoboynaya
AnnaCrude
Timely CAUTION. Thanks
Lebih