VertMT

[MT] Strategy Backtest Template

| Initial Release | | EN |

An update of my old script, this script is designed so that it can be used as a template for all those traders who want to save time when programming their strategy and backtesting it, having functions already programmed that in normal development would take you more time to program, with this template you can simply add your favorite indicator and thus be able to take advantage of all the functions that this template has.

🔴Stop Loss and 🟢Take Profit:
  • No need to mention that it is a Stop Loss and a Take Profit, within these functions we find the options of: fixed percentage (%), fixed price ($), ATR, especially for Stop Loss we find the Pivot Points, in addition to this, the price range between the entry and the Stop Loss can be converted into a trailing stop loss, instead, especially for the Take Profit we have an option to choose a 1:X ratio that complements very well with the Pivot Points.

📈Heikin Ashi Based Entries:
  • Heikin Ashi entries are trades that are calculated based on Heikin Ashi candles but their price is executed to Japanese candles, thus avoiding false results that occur in Heikin candlestick charts, this making in certain cases better results in strategies that are executed with this option compared to Japanese candlesticks.

📊Dashboard:
  • A more visual and organized way to see the results and necessary data produced by our strategy, among them we can see the dates between which our operations are made regardless if you have activated some time filter, usual data such as Profit, Win Rate, Profit factor are also displayed in this panel, additionally data such as the total number of operations, how many were gains and how many losses, the average profit and loss for each operation and finally the maximum profits and losses followed, which are data that will be very useful to us when we elaborate our strategies.

Feel free to use this template to program your own strategies, if you find errors or want to request a new feature let me know in the comments or through my social networks found in my tradingview profile.


| Update 1.1 | | EN |

➕Additions:'
  • Time sessions filter and days of the week filter added to the time filter section.
  • Option to add leverage to the strategy.
  • 5 Moving Averages, RSI, Stochastic RSI, ADX, and Parabolic Sar have been added as indicators for the strategy.
  • You can choose from the 6 available indicators the way to trade, entry alert or entry filter.
  • Added the option of ATR for Take Profit.
  • Ticker information and timeframe are now displayed on the dashboard.
  • Added display customization and color customization of indicator plots.
  • Added customization of display and color plots of trades displayed on chart.

📝Changes:
  • Now when activating the time filter it is optional to add a start or end date and time, being able to only add a start date or only an end date.
  • Operation plots have been changed from plot() to line creation with line.new().
  • Indicator plots can now be controlled from the "plots" section.
  • Acceptable and deniable range of profit, winrate and profit factor can now be chosen from the "plots" section to be displayed on the dashboard.
  • Aesthetic changes in the section separations within the settings section and within the code itself.
  • The function that made the indicators give inputs based on heikin ashi candles has been changed, see the code for more information.

⚙️Fixes:
  • Dashboard label now projects correctly on all timeframes including custom timeframes.
  • Removed unnecessary lines and variables to take up less code space.
  • All code in general has been optimized to avoid the use of variables, unnecessary lines and avoid unnecessary calculations, freeing up space to declare more variables and be able to use fewer lines of code.



| Lanzamiento Inicial | | ES |

Una actualización de mi antiguo script, este script está diseñado para que pueda ser usado como una plantilla para todos aquellos traders que quieran ahorrar tiempo al programar su estrategia y hacer un backtesting de ella, teniendo funciones ya programadas que en el desarrollo normal te tomaría más tiempo programar, con esta plantilla puedes simplemente agregar tu indicador favorito y así poder aprovechar todas las funciones que tiene esta plantilla.

🔴Stop Loss y 🟢Take Profit:
  • No hace falta mencionar que es un Stop Loss y un Take Profit, dentro de estas funciones encontramos las opciones de: porcentaje fijo (%), precio fijo ($), ATR, en especial para Stop Loss encontramos los Pivot Points, adicionalmente a esto, el rango de precio entre la entrada y el Stop Loss se puede convertir en un trailing stop loss, en cambio, especialmente para el Take Profit tenemos una opción para elegir un ratio 1:X que se complementa muy bien con los Pivot Points.

📈Entradas Basadas en Heikin Ashi:
  • Las entradas Heikin Ashi son operaciones que son calculados en base a las velas Heikin Ashi pero su precio esta ejecutado a velas japonesas, evitando así́ los falsos resultados que se producen en graficas de velas Heikin, esto haciendo que en ciertos casos se obtengan mejores resultados en las estrategias que son ejecutadas con esta opción en comparación con las velas japonesas.

📊Panel de Control:
  • Una manera más visual y organizada de ver los resultados y datos necesarios producidos por nuestra estrategia, entre ellos podemos ver las fechas entre las que se hacen nuestras operaciones independientemente si se tiene activado algún filtro de tiempo, datos usuales como el Profit, Win Rate, Profit factor también son mostrados en este panel, adicionalmente se agregaron datos como el número total de operaciones, cuantos fueron ganancias y cuantos perdidas, el promedio de ganancias y pérdidas por cada operación y por ultimo las máximas ganancias y pérdidas seguidas, que son datos que nos serán muy útiles al elaborar nuestras estrategias.

Siéntete libre de usar esta plantilla para programar tus propias estrategias, si encuentras errores o quieres solicitar una nueva función házmelo saber en los comentarios o a través de mis redes sociales que se encuentran en mi perfil de tradingview.


| Actualización 1.1 | | ES |

➕Añadidos:
  • Filtro de sesiones de tiempo y filtro de días de la semana agregados al apartado de filtro de tiempo.
  • Opción para agregar apalancamiento a la estrategia.
  • 5 Moving Averages, RSI, Stochastic RSI, ADX, y Parabolic Sar se han agregado como indicadores para la estrategia.
  • Puedes escoger entre los 6 indicadores disponibles la forma de operar, alerta de entrada o filtro de entrada.
  • Añadido la opción de ATR para Take Profit.
  • La información del ticker y la temporalidad ahora se muestran en el dashboard.
  • Añadido personalización de visualización y color de los plots de indicadores.
  • Añadido personalización de visualización y color de los plots de operaciones mostradas en grafica.

📝Cambios:
  • Ahora al activar el filtro de tiempo es opcional añadir una fecha y hora de inicio o fin, pudiendo únicamente agregar una fecha de inicio o solamente una fecha de fin.
  • Los plots de operaciones han cambiados de plot() a creación de líneas con line.new().
  • Los plots de indicadores ahora se pueden controlar desde el apartado "plots".
  • Ahora se puede elegir el rango aceptable y negable de profit, winrate y profit factor desde el apartado "plots" para mostrarse en el dashboard.
  • Cambios estéticos en las separaciones de secciones dentro del apartado de configuraciones y dentro del propio código.
  • Se ha cambiado la función que hacía que los indicadores dieran entradas en base a velas heikin ashi, mire el código para más información.

⚙️Arreglos:
  • El dashboard label ahora se proyecta correctamente en todas las temporalidades incluyendo las temporalidades personalizadas.
  • Se han eliminado líneas y variables innecesarias para ocupar menos espacio en el código.
  • Se ha optimizado todo el código en general para evitar el uso de variables, líneas innecesarias y evitar los cálculos innecesarios, liberando espacio para declarar más variables y poder utilizar menos líneas de código.

Script open-source

Nello spirito di condivisione promosso da TradingView, l'autore (al quale vanno i nostri ringraziamenti) ha deciso di pubblicare questo script in modalità open-source, così che chiunque possa comprenderlo e testarlo. Puoi utilizzarlo gratuitamente, ma il riutilizzo del codice è subordinato al rispetto del Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.

Vuoi usare questo script sui tuoi grafici?