TradingView
RafaelZioni
19 Ara 2020 21:50

Pyramiding BTC 5 min no security 

Bitcoin / TetherUSBinance

Açıklama

Since some say that the script with the security is repaint and the results too preety
i decided to run the same script without it. still the best is when security set to 1 min but without the difference not so much.
it just to show the concept of the strategy that based on linear regression cross hull as buy signal
and the the take profit target. so maybe now its also repaint?:)
tradingview.com/script/9eVcc7MB-Pyramiding-BTC-5-min/

based
tradingview.com/script/7NNJ0sXB-Pyramiding-Entries-On-Early-Trends-by-Coinrule/
Yorumlar
RafaelZioni
diffrent settup for 5 min, put 500 on fast ,250 on slow filter exit at 20% take profit (it look nicer:)
onurkarabag
thank you Rafael.. This is only long , also Have for short
zhiming
这个和之前的BTC 5min脚本的区别在哪里?
Trendoscope
Few interesting things in the script.

1. Does profit ticks and loss ticks keep changing with close price? I never used profit and loss ticks for same reason. Will try to experiment a bit.
2. With default pyramiding configuration in place, do we need multiple entry and exit lines or is it just to mark it with different label?

Thanks for the script. Few things to learn :)
kurtsmock
@HeWhoMustNotBeNamed, Great questions =) I was thinking the same thing about the default pyramiding vs the way Rafael has it written.
I personally have never thought to use strategy.opentrades though as a mechanism for pyramiding.

I believe the profit ticks and loss ticks are reliable and don't change unless the referencing variable changes. Here's a chunk from my strategy tester:

// Take Profit Short
tpPrice_S = 0.0
tpPrice_S := if strategy.position_size < 0 and c_tpType == tp1
tpPrice_S := strategy.position_avg_price * (1 - i_pctTP)
else if strategy.position_size < 0 and c_tpType == tp2
tpPrice_S := strategy.position_avg_price - (syminfo.mintick * i_tickTP)
else if strategy.position_size < 0 and c_tpType == tp3
tpPrice_S := strategy.position_avg_price - (atr(i_atrLength) * i_atrMult)
else if strategy.position_size < 0 and c_tpType == tp4
tpPrice_S := lowerBand
else if strategy.position_size < 0 and c_tpType == tp5 and c_tpType != st7
tpPrice_S := strategy.position_avg_price - ((rrStop_S - strategy.position_avg_price) * i_rrMult)
else
tpPrice_S := 0

strategy.exit("Exit Short", from_entry = "Short", qty_percent = 100, limit = tpPrice_S, stop = stopPrice_S)

Some of those are dynamic and some are static. And they all fire correctly using the limit/stop arguments.
It does calculate on each bar, so if the value doesn't change the stop level doesn't change, if the value does change, however, it will change.
Trendoscope
@kurtsmock, Thanks for the response.

Calculation used in the script use close (as below):

Profit_Ticks = close * (ProfitTarget_Percent / 100) / syminfo.mintick

Close changes on every bar. Hence, calculation of ticks should change too?
kurtsmock
@HeWhoMustNotBeNamed, From what I can tell yes, it does change the calculation since the close price is used. But, since its based on the entry price, it can wobble around, but can't run away. I just did a quick and dirty plot of the TP lines. Its not accurate because I don't have exact entries calculated, I just used strategy.position_avg_price But its close enough to show us what's going on there. We would need to do some more work to actually capture the exact entry price of each position and calculate each individual positions stop, because they are not all equal, then it would line up dead on. Using average price is insufficient because its collating the prices of the entries together and the strat is taking them individually.
Trendoscope
@kurtsmock, Thanks very much. I probably stick to setting stop - which seems much safer and cleaner :)
kurtsmock
@HeWhoMustNotBeNamed, Yea all good. There are other ways of doing it for sure that give you a consistent, precise stop.
Daha Fazla