Strambatax

Stx Monthly Trades Profit

Strambatax Uppdaterad   
Monthly profit displays profits in a grid and allows you to know the gain related to the investment during each month.
The profit could be computed in terms of gain/trade_cost or as percentage of equity update.

Settings:
- Profit: Monthly profit percentage or percentage of equity
- Table position

This strategy is intended only as a container for the code and for testing the script of the profit table.
Setting of strategy allows to select the test case for this snippet (percentage grid).
Money management: not relevant as strategy is a test case.

This script stand out as take in account the gain of each trade in relation to the capital invested in each trade. For example consider the following scenario:
Capital of 1000$ and we invest a fixed amount of 1000$ (I know is too risky but is a good example), we gain 10% every month.
After 10 months our capital is of 2000$ and our strategy is perfect as we have the same performance every month.
Instead, evaluating the percentage of equity we have 10% the first month, 9.9% the second (1200$/1100$ - 1) and 5.26% the tenth month. So seems that strategy degrade with times but this is not true.
For this reason, to evaluate my strategy I prefer to see the montly return of investment.

WARNING: The strategy provided with this script is only a test case and allows to see the behavior with different "trades" management, for these reason commision are set to zero.
At the moment only the provided test cases are handled:

test 1 - single entry and single exit;
test 2 - single entry and multiple exits;
test 3 - single entry and switch position;

Versionsinformation:
Update documentation
Versionsinformation:
fix position reversal condition
Versionsinformation:
add leverage setting for monthly_profit, in this way the script consider the profit_for_each_trade related to the trade investment as invested_capital * leverage.
Versionsinformation:
add yearly summary
Versionsinformation:
Highlight the cell with min and max value.
The first cell, starting from past with min, max is highlighted. Consider that values on the table are rounded therefore you can see highlighted value not at the first occourrence. For example 2.001% and 2.002% are shown both as 2% but the second will be higlighted.

Skript med en öppen källkod

I sann TradingView-anda har författaren publicerat detta skript med öppen källkod så att andra handlare kan förstå och verifiera det. Hatten av för författaren! Du kan använda det gratis men återanvändning av den här koden i en publikation regleras av våra ordningsregler. Du kan ange den som favorit för att använda den i ett diagram.

Frånsägelse av ansvar

Informationen och publikationerna är inte avsedda att vara, och utgör inte heller finansiella, investerings-, handels- eller andra typer av råd eller rekommendationer som tillhandahålls eller stöds av TradingView. Läs mer i Användarvillkoren.

Vill du använda det här skriptet i ett diagram?