XaviZ

RePaNoCHa V4 [Alerts]

Script for automatic trading with Alerts.

LG --> Long (green: not confirmed) (lime: confirmed)
ST --> Short (maroon: not confirmed) (red: confirmed)
TS --> Trailing Stop
xL --> Close Long Position
xS --> Close Short Position
SL --> Stop Loss

The trailing stop closes the trade if the price changes direction by a specified percentage or offset. There is no ideal distance because markets and price are always changing and we know that is impossible to exit on the top or bottom. This script interpolate the trailing Stop Offset with profit, higher profit --> higher Trailing Stop Offset. Despite this, it's difficult to catch the price but not impossible. It has a TS delay too. It take a snapshot every X seconds, if the TS is activated the alert is triggered, otherwise the price keeps fluctuating until a new snapshot.

It can be easily converted to Backtest. Just delete "//" on the corresponding part.

Default settings for XBT:USD at 1H.
Phát hành các Ghi chú: Added RSI and MACD
Phát hành các Ghi chú: Repeated part deleted
Phát hành các Ghi chú: Stop Loss bug fixed
Added option for activate not confirmed signals (better profit but high risk)
Phát hành các Ghi chú: Xlong & Xshort fixed
Phát hành các Ghi chú: Now the Trailing Stop can be triggered even if price is lower than the activation limit just like the strategy or backtest script.
Gỡ bỏ khỏi Script Ưa thích Thêm vào Script Ưa thích
Thanks XaviZ, this strategy looks really really good. I've been testing it with 3commas, and I can confirm that sometimes the strategy change from long to short, or short to long, without taking profit. Using it with one account, or testnet (I'm trying the bybit testnet), it's impossible to use, because you cannot open a new position if the previous one is open. So if I have a short open, and the strategy wants to turn long, it can't, and I remain in the short position losing money. It's a pity. Now I patch the problem using 2 different testnet and an alert that when the long is fired, it says to the short bot to close deals, and viceversa. Do you have any idea of how to solve this directly in the alert script?

cheers!
Phản hồi
I see the same problem also...
Phản hồi
Thank you for your great job.
But I have some problems..
When I use TV alert, sometime alert doesn't work.
How can I fix it?
Phản hồi
thinku2 thinku2
@XaviZ , Today I got 4 entry signals and 4 TS signals and I use TV alert use "once per bar"
But 2 signals(entry 2, TS 2) didn't work. Some signals can't trigger TV alerts.
I think that is not the problem of TV but I can't find error in your script.
Do you have experience that kind of problem?
Phản hồi
Gracias por compartir! Gran trabajo.

Probando los resultados del backtest y comparándolos con la reproducción se ve que los resultados no concuerdan, es mas, son muy distintos.

Pasando de +35% en agosto en backtest de tv a un - 10% en live.

Como calculas esas salidas en tp o tsl en el backtest?
Porque veo que muchas veces pone que la salida estaría en la mecha superior de la vela y eso no creo pueda ser posible en live.

Ahora tengo alarmas para después verificar manualmente el backtest.

Gracias por responder! Buenos códigos haces!
Phản hồi
XaviZ chusoooo
@chusoooo, Hola, gracias a ti por comentar.
Sabemos que el TS que calcula el Backtest de TradingView es demasiado bueno porque lo hace siempre en lo más alto o más bajo de la vela, y en la realidad, esto no es así porque el precio fluctua. De hecho lo explico un poco arriba. Por tal motivo y con buenas intenciones, se me ocurrió ponerle el Dynamic TS y un Delay.
Yo he tenido profit utlizando ordenes limit en las entradas de esta manera las fees serían: -0.025 + 0.075 / 2 = 0.025. Esto ayudaría mucho ya que es un script arrollador, tiene demasiadas transacciones. Lo que menos me gusta es cuando hay un cambio de tendencia que te hace perder demasiado a veces.
Phản hồi
Hola Xavi, ¡muchas gracias por compartir tu trabajo! ¡Parece muy interesante! Una pregunta: me parece, que en el casos de SL, TS y XS, el escripto manda solo un mismo tipo de alerto. ¿Es verdad? Si es así, sería estupendo si se pueden recibir los distintos tpos de alertos en cado uno de estos casos. ¿Se puede hacer esto?

¡Saludos!
Phản hồi
XaviZ pastet89
@pastet89, Hola, you're welcome.
Lo hice así para ahorrar alertas pero tu mismo puedes dividirlas creando las que quieras a partir del comando alertcondition()
Phản hồi
Hi, thank you for the work again.
But, even though your release on Aug 22, Trailing Stops sometimes do not show up.
Phản hồi