TradingView
guz12
27 de Sep. de 2021 17:57

%-[Guz] Vortex Indicator Custom 

Binance Coin / TetherUSBinance

Descripción

// [Guz] Custom Vortex Strategy (backtester)
// Custom version of the Vortex indicators that adds many features:
// -Triggers trades after a threshold is reached instead of the normal vortex lines cross (once the difference between the 2 lines is important enough)
// -Smooths the Vortex lines with an EMA
// -Adds Take Profit and Stop Loss selection
// -Adds the possibility to go Long only, Short only or both of them
// ! notice that it uses 10% position size and 0.04% trade fee, found on some crypto exchanges futures contracts
// Allows testing leverage with position size modification (values above 100% position size, to be done with caution)
// Not an investment advice

Notas de prensa

Added the underlay plotting of the indicator for it to be visible under the chart, 2 vortex lines + threshold line.
The Long and Short opening correspond to the blue line and the red line crossing over the threshold respectively.
Close with Take Profit / Stop Loss or blue line crossing red line.
Comentarios
MROXIC
Very nice! a cross over alert would bring it to the next level :) Thank you for taking the time to create and share.
dos32101
No me funciona
Que hago mal
guz12
@dos32101, what do you want to do ? the setup works for backtesting (not alert generation) and on another products (for example company equity or Forex) you may need to try very different values for the threshold (generally works for values between 5 and 25 but not sure). Also if you want to see the plots (indicator curve) you need to uncomment (remove //) in front of
//plot(VIP, title="VI +", color=#2962FF)
//plot(VIM, title="VI -", color=#E91E63)
and pass the overlay parameter to false instead of overlay = true : in the first line replace with
strategy(title="%-[Guz] Vortex Indicator Custom", shorttitle="%-[Guz] Vortex Indicator Custom", overlay=false, calc_on_order_fills = false, calc_on_every_tick = false, commission_type=strategy.commission.percent, commission_value=0.04, default_qty_type = strategy.percent_of_equity, default_qty_value = 10, initial_capital = 10000, margin_long=1, margin_short=1)
guz12
@dos32101, now it should be better but you can ask me
guz12
trades on a 9 days period from 18sept21 to 27sept21 which would be around 9% profit with 100% position size (0.88% with 10% position size)
guz12
sorry for one mistake: it it better with overlay = false as the vortex is generally not plotted (drawn) right above the chart but bellow it, and you can uncomment the following part to see how the vortex is going:
//plot(VIP, title="VI +", color=#2962FF)
//plot(VIM, title="VI -", color=#E91E63)
Más