Lots / Leverage / Margin [JoseMetal]============
ENGLISH
============
- Description:
This is a utility indicator, it prints a table with ATR, Volatility, Lotage and Margin for 3 custom timeframes, using the ATR of basis, it calculates volatility (%) and a recommended lotage depending on your risk settings.
A few months ago i fled from crypto exchanges to regulated brokers, and working with lots instead of plain margin was a bit of headache, i also trade with crypto, currencies, metals and indexes, each with different volatility, leverage... so this tool was a MUST for me to code.
So basically, this tool allows to keep the same RISK for every single asset, no matter if they have different volatility.
- Visual:
The indicator shows a table with all the info explained, ATR, Volatility...
For each timeframe it also prints 3 periods, short, long and average, you can show/hide timeframes and the different periods.
- Customization:
Colors in the table are custom, as well as the font size.
The risk management settings start with the margin you want to use as average, then you can customize your asset leverage, the risk (which is a value you HAVE to keep the same for all assets to balance the results correctly) and units per lot.
You can increase/decrease risk if you want to, i personally take DAILY values with a 18-20 risk to trade on a 4H chart.
For the "units per lot" take in mind that usually that value is ONE, but in some assets with really low value like currencies or some crypto your broker can set 1 lot to xxxx units, that's why you have that option.
- Usage and recommendations:
As i said i trade from 4H to daily, that's why my risk setting is 18-20, i use the lots plotted in the table on DAILY.
If you're more a scalper, just adjust the timeframes to your needs :)
Enjoy!
============
INGLÉS
============
- Descripción:
Este es un indicador de utilidad, imprime una tabla con ATR, Volatilidad, Lotaje y Margen para 3 temporalidades personalizadas, usando el ATR de base, calcula la volatilidad (%) y un lotaje recomendado dependiendo de tu configuración de riesgo.
Hace unos meses cambié de intercambios crypto (exchanges) a brokers regulados, y trabajar con lotes en lugar de margen simple era un poco dolor de cabeza, también tradeo con crypto, divisas, metales e índices, cada uno con diferente volatilidad, apalancamiento... así que esta herramienta era IMPRESCINDIBLE para mí de programar.
Básicamente, esta herramienta permite mantener el mismo RIESGO para cada activo, sin importar si tienen diferente volatilidad.
- Visual:
El indicador muestra una tabla con toda la información explicada, ATR, Volatilidad...
Para cada temporalidad también imprime 3 períodos, corto, largo y medio, puedes mostrar/ocultar los marcos temporales y los diferentes periodos.
- Personalización:
Los colores de la tabla son personalizados, así como el tamaño de la fuente.
La configuración de la gestión del riesgo comienza con el margen que deseas utilizar como promedio, a continuación, puedes personalizar el apalancamiento del activo, el riesgo (que es un valor que TIENE que mantener igual para todos los activos para equilibrar los resultados correctamente) y las unidades por lote.
Puedes aumentar/disminuir el riesgo si quieres, yo personalmente tomo valores DIARIOS con un riesgo de 18-20 para operar en un gráfico de 4H.
Para las "unidades por lote" ten en cuenta que normalmente ese valor es UNO, pero en algunos activos con valor realmente bajo como divisas o algunas criptomonedas tu broker puede poner 1 lote a xxxx unidades, por eso agrego esa opción.
- Uso y recomendaciones:
Como dije yo opero de 4H a diario, por eso mi ajuste de riesgo es de 18-20, uso los lotes graficados en la tabla en DIARIO.
Si eres más un scalper, sólo tienes que ajustar las temporalidades a tus necesidades :)
¡Que lo disfrutes!
Управление портфелем
Live Portfolio ScreenerThe live portfolio screener indicator is a tool that help users to track the performance of their investments in real-time. The indicator provides a detailed breakdown of the user's portfolio, including the current profit and loss (P&L) for each stock that is invested in. This allows users to quickly and easily see how their portfolio is performing and make informed decisions about their investments on charts. Overall, this tool is an essential tool for anyone looking to stay on top of their investments and make data-driven decisions.
This indicator can load any symbol globally usable.
How to use this indicator ?
in this indicator firstly
you have add script name. (For example if you want to add symbol you have add in 's01 ' means the first symbol)
after that
you have to add price for each (For example if you want to add buy price for the first symbol then add the buy price in ' Bp01 ')
then the quantity comes in picture which is below price list and named here as Bq01 which means 'Buy quantity for first symbol'
Basic Position Calculator (BPC)In trading, proper position sizing is essential to managing risk and maximizing returns. The script provided is a Basic Position Calculator that allows traders to quickly and easily calculate their position size, stop loss, take profit, and risk reward ratio for a given trade.
The script starts by defining several inputs for the user to customize the calculations. The first input is the "Account Size", which specifies the total amount of funds available for the trade. The next input is "Risk Amount %", which is the percentage of the account size that the trader is willing to risk per trade. The "Stop Loss" input specifies the maximum amount of loss that the trader is willing to accept, while the "Reward" input is the desired profit target for the trade. Finally, there is a "Position" input that allows the user to specify where on the chart the table of calculations will be displayed.
The script then calculates the position size, stop loss, take profit and risk reward ratio using the user-specified inputs. The position size is calculated by dividing the risk amount by the stop loss. The stop loss is calculated by multiplying the stop loss percentage by the close price, and the take profit is calculated by multiplying the stop loss percentage by the close price and the reward. Risk-reward ratio is the ratio of amount of profit potential to the amount of risk in a trade.
The script then creates a table and displays the calculated values on the chart at the specified location. The table includes the following information: account size, position size, account risk %, stop loss, stop loss %, take profit, take profit % and risk reward ratio. This allows the trader to quickly and easily see all the key calculations for their trade in one place.
Overall, the Basic Position Calculator script is a valuable tool for any trader looking to quickly and easily calculate their position size, stop loss, take profit, and risk reward ratio for a given trade. The ability to customize the inputs and display the calculations on the chart makes it a useful and user-friendly tool for managing risk and maximizing returns.
Cuban's Pair Trading IndexThe purpose of this indicator is to visually simplify the relationship between two assets when searching for pair trades or higher beta opportunities.
With highly correlated pairs, it can be a blessing or a curse during volatility when you're somehow stuck in the only lower beta pairs, or maybe you're market neutral and the wrong leg starts nuking.
This indicator was built as a visual way to track pair relationships.
Fundamentally, this script does the following:
Plots the relative performance of the relationship between two assets across multiple time horizons
Uses a consistent measurement of historical performance, regardless of asset -- currently standard deviations, may add log difference in the future
Plots a custom Average Directional Index on the current chart ticker for current asset contextual momentum
Plots the average 'rotation' of both the ADX and Pair Delta independently, over n numbers of rotations -- able to be specified using the 'Rotation Lookback' variable
If you've never pair traded crypto before (i.e. long $DYDX, short $ETH), you might not be aware that most highly correlated alt asset returns tend to oscillate on a low timeframe rolling basis around the performance of the majors -- and more recently, predominantly $ETH. With this in mind and using this oscillator, we can track that relationship.
Users are given the ability to adjust the following:
Comparison Asset
Fast and Slow Delta Lookbacks
Whether to wait for one bar delay during security calls
Rotation Lookback
Rotation Threshold for Pair Delta and ADX independently
ADX Lookback
Whether to utilize the ADX on the current chart ticker or also net that off against the ADX of the comparison asset
TO DO:
Aesthetic update to Pair Delta plot
Permanent fix for security call forced delay
Cuban's Asset ScreenerCuban's Asset Screener is a tool designed to view the health of the entire market in a single charting window, using a multi-timeframe, real-time heatmapped asset screener built natively within Tradingview.
You can use this tool to aggregate and display critical information required to identify your favorite trade ideas using other Cuban's Edge tools. Although the screener currently uses pre-built lists for over 200+ Binance and Bybit Futures pairs, the tool comes with custom watchlist support, allowing you to add as many additional assets as your screen and browser will support.
Currently tracking range positions and a custom cross asset delta function from Cuban's Pair Trading Index, the screener has an in-built sorting function which orders assets by similar market structure and colors them relative to their performance against the user's comparison asset -- their current chart ticker.
Cuban's Asset Screener is also valuable as a tool to monitor performance of your portfolio against any benchmark asset, by using the 'Asset Redenomination' option within the settings. This allows the user to redenominate the entire screener easily using their current chart ticker.
In order to setup the Asset Screener, the user will need to select an 'Asset List' and a 'Screen Location' value. This will load the screener into a set position on screen, from right to left. In order to add additional assets, multiple instances of the asset screener will need to be loaded on screen.
With this indicator, users get the option to adjust the following:
range positioning lookback
asset redenomination for range positioning
asset sorting order
screen location
multi-timeframe support
live pricing for PTI values
in-built asset lists for 200+ assets
TO DO:
add market filters to the coloring
add tradfi asset lists
Strategy Developer ToolSolar Strategies: Strategy Developer Tool Complete Guide
This guide provides full explanation of the intended purpose of our script along with individual explanation of each input and the logic behind them coupled with general knowledge which we find useful in using our tool regarding elements of risk and strategy. Use this information wisely and understand we are not providing financial advise, this is a learning tool meant to help advance traders knowledge of the markets and their strategies which are formed as such.
Basics
Before getting into the specifics of how to use our strategy developer tool, it's important to understand a few basic fundamental things about it. The purpose of the tool is to allow the user to optimize a strategy through back testing with our strategy tracker and 50+ user inputs. The way you optimize your strategy depends on a couple things:
The state of the current and recent previous market.
The timeframe you trade on.
The types of trades you prefer. (swings, scalps, etc.)
How much risk you are willing to take on.
Risk Basics:
Going off the last bullet point on the list above, risk plays a huge part in how you optimize your strategy, with that being said here are a few general rules of risk as they relate to trades:
The more trades you take on, the more risk you are opening your strategy up to.
If done correctly, more trades will often result in more profit with slightly lower accuracy, and more risk.
The less trades you take on, the easier it is to have higher accuracy because ideally by rooting out the losing trades, you are left with fewer overall trades but mostly winning trades.
Less trades with higher accuracy often result in less profit but will 100% be less risky than the opposite. (More trades, less accurate, more profit, MORE RISK)
Input Basics:
More trades, less trades, more risk, less risk, what does this all mean as it relates to our tool?
The 50+ user inputs that allow you to optimize and create your strategy all effect when the script takes a trade.
Many of the inputs are essentially conditions. By changing these inputs, what you are doing is changing how specific the conditions need to be in order to take a trade.
This is how the inputs tie into the bullet point list above regarding risk and the number of trades you take on. By raising or lowering certain inputs, you are making the conditions more or less specific on when to trade.
Making conditions more specific will allow for less trades to be taken and will often result in a higher win rate, and less associated risk.
Making conditions less specific will allow for more trades to be taken and depending on the state of the market, could result in more profit being realized, but at the same time opens you up to more risk because you are stating a more general set of conditions in order to take a trade.
How does it work?
Our strategy developer tool is based on two simple factors in order to identify specific areas in the market deemed good for trade. They are as follows:
Directional momentum to identify when a move might happen.
A confirmation of the desired move.
Indicators:
The tool gets its information on these two factors from two custom built indicators which are hard coded into the script. These two indicators and the inputs which affect them can be found labeled with Indicator 1 or Indicator 2 in the tool's settings.
When the conditions are met based on the factors of both indicators, it then decides your stop losses and take profits using pivot points.
Indicator 1 is the momentum indicator.
Indicator 2 looks for confirmation of the move.
Hedges:
Since nothing is ever certain when trading, our tool also aims to minimize potential loss before it can happen by incorporating hedges when a signal prints in the opposite direction of the trade you are currently in.
To identify when to hedge, the candles will appear with the opposite color of your original trade. Candles, while in a long trade, appear as green and candles while in a short trade appear as red. While in a long trade the only time red candles will appear is when a hedge occurs and vice versa for shorts.
Example: If you just took a long trade based on a long signal that the script gave off, but a short signal prints off while you are in the long, you are directed to sell half your long position and enter that half into a short position. Since there is now more uncertainty in the long because of the short signal, minimizing your position size and having a smaller position in the opposite direction allows you to cover your bases if the trade moves against you. If it doesn’t move against you and ends up going long as originally intended, you are not to lose any money, likely a small profit or break even when all is said and done.
In order to give the hedges a greater change of hitting, the take profits are smaller than a normal trade, this way even if your hedge wasn’t necessary and the original trade does not move against you, it's likely that your hedge will still win, and you can just consider it a small scalp to further your profits on the original trade.
Doubles:
Besides minimizing loss, we also aim to maximize the potential gain. When a second signal prints off in the direction of the trade you are currently already in, the tool directs you to double your position size.
The signal for doubling is a label with “2x” written inside.
The logic here is similar to hedging but in the opposite way. Just as a signal in the opposite direction creates uncertainty, a signal in the same direction indicates more certainty hence doubling your position size.
Example: If you are currently in a long position and you get a second long signal, you would then double your existing position since two long signals printing off before the first one has a chance to play out indicates a stronger chance of movement in the intended direction of your trade.
User Inputs
Upon opening the tools settings tab, you will find all the user inputs which can then be modified to fit your desired strategy. In this section of our guides, you will find individual explanations and use cases for each input so you can correctly use them to your best advantage.
Strategy Tracker Table:
By ticking this input on, the strategy tracker table will be visible to the user. (Default is on)
Indicator 1 Greater Than: Long:
By ticking this input on, you are adding a condition the script will then look for in order to take a long. (Default is on)
This condition is that an average of indicator 1, which searches for momentum, must fall above a certain level, which is determined in the next input.
The purpose of this is to ensure that the average momentum is not too low because this would indicate prolonged downwards movement on the timeframe of the market being observed, making a long position riskier.
Indicator 1 Greater Than Input: Long:
This input correlates to the previous input directly above.
If Indicator 1 Greater Than: Long is ticked on, then one of the conditions in order to take a long position will be that the average of indicator 1 must fall above the level which you set in this input.
max level 100, min level 0
Indicator 1 Less Than: Long
By ticking this input on, you are adding a condition the script will then look for in order to take a long position. (Default is on)
This condition is that an average of indicator 1, which searches for momentum, must fall below a certain level, which is determined in the next input.
The purpose of this is to ensure that the average momentum is not too high, because this would indicate a prior significant upwards movement or trend on the timeframe of the market being observed.
Taking a long position while the average momentum is at higher levels exposes the risk of longing as the market has started to pull back from a peak or when the market has just reached a peak.
Indicator 1 Less Than Input: Long
This input correlates to the previous input directly above.
If Indicator 1 Less Than: Long is ticked on, then one of the conditions in order to take a long position will be that the average of indicator 1 must fall below the level which you set in this input.
max level 100, min level 0
Indicator 1 Greater Than: Short
By ticking this input on, you are adding a condition the script will then look for in order to take a short. (Default is on)
This condition is that an average of indicator 1, which searches for momentum, must fall above a certain level, which is determined in the next input.
The purpose of this is to ensure that the average momentum is not too low because this would indicate prolonged downwards movement or trend on the timeframe of the market being observed.
Taking a short position while the average momentum is at lower levels exposes the risk of shorting as the market has started to recover from a bottom or when the market has just reached a bottom.
Indicator 1 Greater Than Input: Short
This input correlates to the previous input directly above.
If Indicator 1 Greater Than: Short is ticked on, then one of the conditions in order to take a short position will be that the average of indicator 1 must fall above the level which you set in this input.
max level 100, min level 0
Indicator 1 Less Than: Short
By ticking this input on, you are adding a condition the script will then look for in order to take a short position. (Default is on)
This condition is that an average of indicator 1, which searches for momentum, must fall below a certain level, which is determined in the next input.
The purpose of this is to ensure that the average momentum is not too high, because this would indicate a prior significant upwards movement or trend on the timeframe of the market being observed.
Taking a short position while the average momentum is at higher levels exposes the risk of shorting as the market is currently in a strong uptrend.
Indicator 1 Less Than: Short
This input correlates to the previous input directly above.
If Indicator 1 Less Than: Short is ticked on, then one of the conditions in order to take a short position will be that the average of indicator 1 must fall below the level which you set in this input.
max level 100, min level 0
Summary of Input Group: Indicator 1 Greater/Less Than Long/Short
This grouping of inputs is best used as a filter of sorts, much like many of the other inputs which are also essentially filters of the market to find areas ripe for trade. Specifically, however, this group of inputs is especially powerful because if used correctly, it can specify a range for the average momentum to fall in when looking for either long or short trades. Think of it like a sweet spot where the average is not too high nor too low. In combination with the numerous other inputs which will shortly be explained, this sweet spot can be a great indication. Keep in mind that once you find a working range, this will not last forever. Conditions in the market are ever changing and as such your inputs, in this case the range the average momentum must fall in, will also need to change with the market conditions.
Bars Since Crossover:
This input simply describes a crossover of the momentum indicator (indicator 1) and its average.
In the category How does it work? Two main factors are discussed, the first being directional momentum to determine when an upwards move might happen. The crossover correlated to this input is the directional momentum as mentioned earlier.
As also mentioned in How does it work? The second factor is a confirmation of the desired upwards move. This confirmation is a crossover of the current price and indicator 2 which will be further addressed later on.
What's important to understand about the two key factors at play in regard to Bars Since Crossover is that this input is determining a condition which looks for a certain number of bars prior to the confirmation of indicator 2 which the crossover of momentum and its average has happened on indicator 1.
Example: Bars Since Crossover input is set to 10. This means that the crossover of momentum and its average from indicator 1 must be within 10 bars prior to the confirmation from indicator 2. If this happens then this condition is met for a long position.
Bars Since Crossunder:
This input simply describes a crossunder of the momentum indicator (indicator 1) and its average.
In the category How does it work? Two main factors are discussed, the first being directional momentum to determine when a downwards move might happen. The crossunder correlated to this input is the directional momentum as mentioned earlier.
As also mentioned in How does it work? The second factor is a confirmation of the desired downwards move. This confirmation is a crossunder of the current price and indicator 2 which will be further addressed later on.
What's important to understand about the two key factors at play in regard to Bars Since Crossunder is that this input is determining a condition which looks for a certain number of bars prior to the confirmation of indicator 2 which the crossunder of momentum and its average has happened on indicator 1.
Example: Bars Since Crossunder input is set to 10. This means that the crossunder of momentum and its average from indicator 1 must be within 10 bars prior to the confirmation from indicator 2. If this happens then this condition is met for a short position.
Summary of Input Group: Bars Since Crossover/Crossunder
These two inputs can have a large effect on the types of trades being taken and the risk which your strategy opens up to. The idea is that in order for the two key factors described in How does it work? to be correlated and therefore indicate a strong directional move, the two events must happen within a somewhat small period of time. If the period of time between the two events taking place is too large, then it's riskier for your strategy due to a delay in directional momentum and the necessary confirmation. It's important to note that this “small period of time” is relative to the security you're trading and the timeframe its being trades on. Small could mean 5 bars in some cases or 20 bars in others, this is why our custom back tester exists. So that the process of optimization on different securities and different timeframes is smooth and only requires adjustments to inputs then your own analysis of the back test results.
Indicator 1 Input Long
Defines how strong the upwards momentum needs to be in order to take a long position.
When optimizing your strategy, this input is likely to have some of the most effect on when the script takes a long position.
The reasoning for this is because the level you set for this input is the level which indicator 1 must close above following the crossover of its average.
Example: Indicator 1 Input Long set to 50, this means that when the momentum crosses over its average from indicator 1, upon the close of this crossover the momentum must be above the level 50 in order for this condition to be met to take a long position.
The higher the level, the stronger the upwards momentum must be, and therefore by using higher levels for this input, the script will search for stronger directional moves leaving less chance for the trade to move against you.
Indicator 1 Input Short
Defines how strong the downwards momentum needs to be in order to take a short position.
When optimizing your strategy, this input is likely to have some of the most effect on when the script takes a short position.
The reasoning for this is because the level you set for this input is the level which indicator 1 must close below following the crossunder of its average.
Example: Indicator 1 Input Short set to 40, this means that when the momentum crosses under its average from indicator 1, upon the close of this crossunder the momentum must be below the level 40 in order for this condition to be met to take a short position.
The lower the level, the stronger the downwards momentum must be, and therefore by using lower levels for this input, the script will search for stronger directional moves leaving less chance for the trade to move against you.
Summary of Input Group: Indicator 1 Input Long/Short
These two inputs are so important to your strategy because at the end of the day no matter how you set it up, it's still a momentum-based strategy. With that being said the level of momentum or the strength needed in order to take trades is of course going to be a key decider in the successfulness of the strategy. When optimizing these two inputs make sure to take into account what the overall market conditions are, meaning if it’s a bull market maybe make the momentum needed to take a long slightly less comparatively to the amount needed to take a short, in other words make long conditions less specific and short conditions more specific. Slight variations of this input can have very big effects, even changing it by 1 or 2 can make a major difference. In might even be good to consider starting optimization with these inputs and then work the rest of the strategy out from there. A lot could be said about these inputs and more docs will be added in order to further explain more strategy approaches revolving around them, for now don’t hesitate to ask any questions.
Indicator 2 Red
This input is used as a sort of chop filter at its base level, however if used correctly it can be a much broader filter for what areas of the market you want to trade in.
Indicator 2 shows as either red or green and is used as a confirmation when price crosses over it following the crossover of momentum and its average from indicator 1 to take a long position.
If ticked on, Indicator 2 Red states a condition in order for the script to take a long position. (Default is on)
The condition is that upon the crossover of the current price and Indicator 2, 10 bars ago indicator 2 must have been red.
The reason for this input is because the current color of indicator 2 upon the crossover must also be red. However, this condition is hard coded in and cannot be changed by any input.
This is because the type of trade being targeted is that of a type of reversal or continuation.
If indicator 2 showed green 10 bars ago and is currently red this would indicate that a top was just reached, and price is reversing downwards making this not a good area to take a long.
Another scenario if indicator 2 showed green 10 bars ago and is currently red is that there is currently a sideways trend going on or otherwise known as chop, also not an ideal area to take a long
However, if 10 bars ago indicator 2 was red and it's currently red this would indicate a more prolonged pullback.
If all conditions are met and we know that price has been pulling back, now we can enter a long with more knowledge pointing to price reversing upwards from a downwards trend, or continuing its upwards trend after a pullback.
Indicator 2 Green
This input is used as a sort of chop filter at its base level, however if used correctly it can be a much broader filter for what areas of the market you want to trade in.
Indicator 2 shows as either red or green and is used as a confirmation when price crosses under it following the crossunder of momentum and its average from indicator 1 to take a short position.
If ticked on, Indicator 2 Green states a condition in order for the script to take a short position. (Default is on)
The condition is that upon the crossunder of the current price and Indicator 2, 10 bars ago indicator 2 must have been green.
The reason for this input is because the current color of indicator 2 upon the crossunder must also be green. However, this condition is hard coded in and cannot be changed by any input.
This is because the type of trade being targeted is that of a type of reversal or continuation.
If indicator 2 showed red 10 bars ago and is currently green this would indicate that a bottom was just reached, and price is reversing upwards making this not a good area to take a short.
Another scenario if indicator 2 showed red 10 bars ago and is currently green is that there is currently a sideways trend going on or otherwise known as chop, also not an ideal area to take a short.
However, if 10 bars ago indicator 2 was green and it's currently green this would indicate a more prolonged upwards movement.
If all conditions are met and we know that price has been moving up, now we can enter a short with more knowledge pointing to price reversing downwards from an upwards trend, or continuing its downwards trend after a bounce up.
Summary of Input Group: Indicator 2 Red/Green
Similar to Indicator 1 Greater/Less Than Long/Short, the goal of these inputs is to try to get a picture of what the previous recent market has been doing. By getting this picture it's easier to find different areas of the market more ideal for trades. Different from Indicator 1 Greater/Less Than Long/Short though, Indicator 2 Red/Green is directly correlated to the price action in the market rather than the momentum. By switching these on or off you are setting more or less specific conditions for taking trades. Some markets require this extra condition to lower your risk in your strategy, however others may not.
Pivot Low
This input is used to define the number of bars the script will look back to grab a pivot low when taking a long position.
This pivot low is then used to set the stop loss when entering a long position.
This input is very important and optimizing it correctly can be extremely crucial to your strategies success.
The Strategy Developer tool uses a 1:1 risk to reward ratio when setting your first take profit point, so when the script looks back to get a pivot low based on the input you set, it will then set your first take profit at an equal ratio to the stop loss found from the pivot low.
The goal in optimizing this input is to give enough lookback to find real pivot points where price has reversed off of, but not to give too much lookback where its grabbing previous pivot points unrelated to the current move of momentum the script is giving a long signal from.
Consider the type of trades you're looking for in your strategy and what timeframe you are trying to trade on.
Longer swing trades which aim to catch bigger moves in the market, possibly on higher time frames, may require a further lookback in order to get your take profits in the correct positioning to catch the desired move, and not exit early before the trade has fully played out.
Shorter scalp trades may aim to catch smaller moves and therefore you don’t want to allow for too much risk by having a large stop loss and large take profits as a result.
Pivot Low 2
Pivot low 2 can be thought of as a backup lookback in order to get the correct pivot low.
In an input which will be discussed shortly called Pivot Low Minimum, you can set a minimum percentage for your pivot low to be, if the pivot low does not meet the minimum then the script will look to Pivot Low 2’s input to use as a bar lookback in order to get the correct pivot low.
This input is used because you might find a Pivot Low input that works well for the majority of the trades in your back tested strategy, however, there will always be outliers and when this Pivot Low input falls short of getting the correct level to put your stop losses at, Pivot Low 2 is used.
Pivot Low 2’s input should always be higher than Pivot Low’s input, that way you can allow the script to look back further in time to find the correct level when the minimum is not met.
Pivot High
This input is used to define the number of bars the script will look back to grab a pivot high when taking a short position.
This pivot high is then used to set the stop loss when entering a short position.
This input is very important and optimizing it correctly can be extremely crucial to your strategies success.
The Strategy Developer tool uses a 1:1 risk to reward ratio when setting your first take profit point, so when the script looks back to get a pivot high based on the input you set, it will then set your first take profit at an equal ratio to the stop loss found from the pivot high.
The goal in optimizing this input is to give enough lookback to find real pivot points where price has reversed off of, but not to give too much lookback where its grabbing previous pivot points unrelated to the current move of momentum the script is giving a short signal from.
Consider the type of trades you're looking for in your strategy and what timeframe you are trying to trade on.
Longer swing trades which aim to catch bigger moves in the market, possibly on higher time frames, may require a further lookback in order to get your take profits in the correct positioning to catch the desired move, and not exit early before the trade has fully played out.
Shorter scalp trades may aim to catch smaller moves and therefore you don’t want to allow for too much risk by having a large stop loss and large take profits as a result.
Pivot High 2
Pivot high 2 can be thought of as a backup lookback in order to get the correct pivot high.
In an input which will be discussed shortly called Pivot High Minimum, you can set a minimum percentage for your pivot high to be, if the pivot high does not meet the minimum then the script will look to Pivot High 2’s input to use as a bar lookback in order to get the correct pivot high.
This input is used because you might find a Pivot High input that works well for the majority of the trades in your back tested strategy, however, there will always be outliers and when this Pivot High input falls short of getting the correct level to put your stop losses at, Pivot High 2 is used.
Pivot High 2’s input should always be higher than Pivot High’s input, that way you can allow the script to look back further in time to find the correct level when the minimum is not met.
Pivot Low Risk Tolerance
This input is very important in managing the risk associated with your strategy.
Pivot Low Risk Tolerance is defining a maximum percentage the pivot low can be away from your entry.
Since the pivot low that’s found is assigned to your stop loss and directly affects the placement of your take profits when taking a long position, making sure the pivot low isn’t too far down is crucial.
Depending on the types of trades you're aiming to take, the timeframe you choose to trade on, and the leverage you use in your strategy, you may want to assign a higher risk tolerance or a lower one.
Example: Pivot Low Risk Tolerance input set to 3, this means that when all other conditions are met in order to take a long position, when searching for the pivot low in order to set a stop loss, if the script finds the pivot low is greater than 3% away from the entry point, it will not take the trade.
Pivot High Risk Tolerance
This input is very important in managing the risk associated with your strategy.
Pivot High Risk Tolerance is defining a maximum percentage the pivot high can be away from your entry.
Since the pivot high that’s found is assigned to your stop loss and directly affects the placement of your take profits when taking a short position, making sure the pivot high isn’t too far up is crucial.
Depending on the types of trades you're aiming to take, the timeframe you choose to trade on, and the leverage you use in your strategy, you may want to assign a higher risk tolerance or a lower one.
Example: Pivot High Risk Tolerance input set to 3, this means that when all other conditions are met in order to take a short position, when searching for the pivot high in order to set a stop loss, if the script finds the pivot high is greater than 3% away from the entry point, it will not take the trade.
Pivot Low Minimum
Sometimes when searching for the pivot low, the script's defined lookback may not be enough to find the proper pivot point.
This can cause improper placement of stop losses and take profits and may cause trades to be exited early before they can fully play out in your favor.
Pivot Low Minimum is an input used to combat this problem, when the script finds a pivot low that does not meet the minimum percentage away from the entry point, it will then turn to Pivot Low 2 input in order to gain a further lookback and grab the correct pivot point to set your stop loss and take profits with.
When reading and setting this input, understand that setting it to 1 means there is no minimum, setting it to 0.9 would mean the minimum is a 10% difference between the pivot low and your entry point.
Think of it in terms of decimals and their equivalent percentage, 0.1 is equal to 10%, 0.01 is equal to 1%.
Whatever percentage you want to set for a minimum, convert it to a decimal, then simply subtract it from 1.
Example: Say you desire a 1.5% minimum pivot low and as a result an equivalent stop loss of 1.5% below your long entry and furthermore a take profit 1.5% above your long entry since the script uses a 1:1 ratio. Converting 1.5% to a decimal would give you 0.015, then subtracting it from 1 would give you 0.985, this would be the input assigned to Pivot Low Minimum.
Pivot High Minimum
Sometimes when searching for the pivot high, the script's defined lookback may not be enough to find the proper pivot point.
This can cause improper placement of stop losses and take profits and may cause trades to be exited early before they can fully play out in your favor.
Pivot High Minimum is an input used to combat this problem, when the script finds a pivot high that does not meet the minimum percentage away from the entry point, it will then turn to Pivot High 2 input in order to gain a further lookback and grab the correct pivot point to set your stop loss and take profits with.
When reading and setting this input, understand that setting it to 1 means there is no minimum, setting it to 0.9 would mean the minimum is a 10% difference between the pivot high and your entry point.
Think of it in terms of decimals and their equivalent percentage, 0.1 is equal to 10%, 0.01 is equal to 1%.
Whatever percentage you want to set for a minimum, convert it to a decimal, then simply subtract it from 1.
Example: Say you desire a 1.5% minimum pivot high and as a result an equivalent stop loss of 1.5% above your short entry and furthermore a take profit 1.5% below your short entry since the script uses a 1:1 ratio. Converting 1.5% to a decimal would give you 0.015, then subtracting it from 1 would give you 0.985, this would be the input assigned to Pivot High Minimum.
Summary of Input Group: Pivot Low/High - Pivot Low/High 2 – Pivot Low/High Risk Tolerance – Pivot Low/High Minimum
The first key takeaway from all these inputs is that your stop losses and take profits will be directly affected through optimizing any of them. The second key takeaway is that these inputs are crucial in managing the risk in your strategy, and while this has been said many times throughout the guide for various inputs, when it comes to stop losses and take profits it is especially true. Having a stop loss which is too high opens up the possibility for much bigger losses, and as a result your take profits will also be too high, minimizing the chance of any of them being hit. Having a stop loss which is too low increases the chance that your trade will get stopped out preemptively, before the trade can mature and move in your favor because remember that trades will not always move immediately in the intended direction, a good amount of patience is often involved in creating consistent successful trades and a successful strategy as such. On the same note, too low of a stop loss could also mean you are missing out on unrealized profit since your take profits are a direct result of the stop loss which is found. When optimizing your pivot low/high risk tolerance, think not about how much you are willing to lose on a single trade, but how much your portfolio can actually afford to lose not just on a single trade but multiple trades, sometimes even in a row. Obviously, the goal in creating a strategy is that you avoid losing trades and especially multiple in a row, however, there are many things that can’t be accounted for. The only way to manage this unaccounted risk is to use proper risk management and not open yourself up to big losses even in the worst most unlikely scenarios. Even if you don’t lose multiple trades in a row, ask yourself, could I afford to lose multiple trades with the risk tolerance I have set if everything were to go to $hit, (hopefully it would not), but in the off chance it did, instead of beating yourself up over what you did wrong, you’ll be patting yourself on the back for what you did right.
TP2-4 Long Placement
The first thing to understand about the take profit placement is that our system of stop losses and take profits uses a 1:1 risk to reward ratio for the first stop loss and first take profit.
This means that if your stop loss falls 2% below your long entry, your first take profit will be 2% above your long entry, hence 1:1.
As for take profits 2-4, they are just extensions of that ratio. This means that if TP2 Long Placement is set to 1.5, the ratio for your second take profit is 1:1.5.
Using the same percentage from the second bullet point being 2%, we can now gather that with a 1:1.5 ratio our second take profit would be at 3% above our long entry.
The same applies for the rest of the take profits, meaning whatever the take profit is set at regardless of which one, apply that number to the second placeholder of the ratio.
Example: First stop loss falls 2% below long entry. TP2 Long Placement input set to 1.5; risk to reward ratio is 1:1.5; corresponding percentage would be a 3% gain. TP3 Long Placement input set to 2; risk to reward ratio is 1:2; corresponding percentage would be a 4% gain. TP4 Long Placement input set to 2.5; risk to reward ratio is 1:2.5; corresponding percentage would be a 5% gain.
The next key thing to understand about the trailing take profits system is the position size being sold at each take profit and therefore how the strategy tracker calculates your strategy's profit.
At the first take profit, 50% of your position is being calculated as sold, locking in good profits off the bat.
At TP2, 20% of your position is being calculated as sold, leaving a remaining 30% open to gain more profit.
At TP3, another 20% of your position is being calculated as sold, leaving 10% to collect any additional possible gains.
At TP4 the remaining 10% of your position is sold and the trade will be fully closed out.
SL2-4 Long Placement
Our system of trailing stop losses is completely similar to that of our trailing take profits.
Just like the trailing take profits, the inputs for stop losses 2-4 are also used as the second placeholders in the risk to reward ratio.
This may be confusing since generally stop losses are associated with a loss on your position, however, the only stop loss which results in a loss on your position is the first one, not stop losses 2-4.
This is because once your first take profit is hit on your long, your stop loss will automatically move up to the price equivalent to the ratio which you set using these inputs that lies in profit.
Example: Since your first take profit will always be at a 1:1 risk to reward ratio with your stop loss, your second take profit could be at a 1:0.8 ratio. So, to clarify, once your first take profit is hit at a 1:1, your original first stop loss will now be moved up in profits to just below your first take profit at a 1:0.8 risk to reward ratio. This only happens AFTER the first take profit is hit.
For stop losses 3 and 4, the same logic is true, once TP2 is hit, your second stop loss will now be moved up to the placement of SL3 which will fall somewhere below TP2. Once TP3 is hit, your third stop loss will now be moved up to the placement of SL4 which will fall somewhere below TP3. If stop loss 4 does not get hit, then the only thing left to happen is for TP4 to hit and the trade will fully close out.
The one major difference between our system of trailing stop losses and take profits is that no matter what stop loss is hit, the entire remainder of your position will be calculated as sold.
So, if your first take profit hits and sells 50% of your long position, but the trade does not continue upwards and moves down to your second stop loss, the remaining 50% of your position will be calculated as sold.
The same applies to SL3 and SL4, so at SL3 the remaining 30% of your position will be calculated as sold, and at SL4 the remaining 10% will be calculated as sold.
Your trailing stop loss placement is dependent on what types of trades you desire. For shorter scalps on smaller timeframes, it's recommended to place each stop loss just below each corresponding take profit for long trades.
This way you leave just enough room for the trade to continue upwards if there is enough momentum, but you don’t open yourself up to losing your unrealized profit if it does not make this continuation.
If you desire longer swing trades on higher timeframes, it might be a good idea to leave more room in between the take profit and corresponding stop loss.
This way you leave more room for the trade to mature and move in your favor since when trading longer moves, often they will not shoot straight up but rather have a series of small pullbacks throughout the more general upwards trend.
Note that when a long trade is first entered the only stop loss and take profit in play are your original stop loss found by the pivot low which would result in a loss, and the first take profit at a 1:1 risk to reward ratio from that pivot low.
TP2-4 Short Placement
The first thing to understand about the take profit placement is that our system of stop losses and take profits uses a 1:1 risk to reward ratio for the first stop loss and first take profit.
This means that if your stop loss falls 2% above your short entry, your first take profit will be 2% below your short entry, hence, 1:1.
As for take profits 2-4, they are just extensions of that ratio. This means that if TP2 Short Placement is set to 1.5, the ratio for your second take profit is 1:1.5.
Using the same percentage from the second bullet point being 2%, we can now gather that with a 1:1.5 ratio our second take profit would be at 3% below our short entry.
The same applies for the rest of the take profits, meaning whatever the take profit is set at regardless of which one, apply that number to the second placeholder of the ratio.
Example: First stop loss falls 2% above short entry. TP2 Short Placement input set to 1.5; risk to reward ratio is 1:1.5; corresponding percentage would be a 3% gain. TP3 Short Placement input set to 2; risk to reward ratio is 1:2; corresponding percentage would be a 4% gain. TP4 Short Placement input set to 2.5; risk to reward ratio is 1:2.5; corresponding percentage would be a 5% gain.
The next key thing to understand about the trailing take profits system is the position size being sold at each take profit and therefore how the strategy tracker calculates your strategy's profit.
At the first take profit, 50% of your position is being calculated as sold, locking in good profits off the bat.
At TP2, 20% of your position is being calculated as sold, leaving a remaining 30% open to gain more profit.
At TP3, another 20% of your position is being calculated as sold, leaving 10% to collect any additional possible gains.
At TP4 the remaining 10% of your position is sold and the trade will be fully closed out.
SL2-4 Short Placement
Our system of trailing stop losses is completely similar to that of our trailing take profits.
Just like the trailing take profits, the inputs for stop losses 2-4 are also used as the second placeholders in the risk to reward ratio.
This may be confusing since generally stop losses are associated with a loss on your position, however, the only stop loss which results in a loss on your position is the first one, not stop losses 2-4.
This is because once your first take profit is hit on your short, your stop loss will automatically move down to the price equivalent to the ratio which you set using these inputs that lies in profit.
Example: Since your first take profit will always be at a 1:1 risk to reward ratio with your stop loss, your second take profit could be at a 1:0.8 ratio. So, to clarify, once your first take profit is hit at a 1:1, your original first stop loss will now be moved down in profits to just below your first take profit at a 1:0.8 risk to reward ratio. This only happens AFTER the first take profit is hit.
For stop losses 3 and 4, the same logic is true, once TP2 is hit, your second stop loss will now be moved down to the placement of SL3 which will fall somewhere above TP2. Once TP3 is hit, your third stop loss will now be moved down to the placement of SL4 which will fall somewhere above TP3. If stop loss 4 does not get hit, then the only thing left to happen is for TP4 to hit and the trade will fully close out.
The one major difference between our system of trailing stop losses and take profits is that no matter what stop loss is hit, the entire remainder of your position will be calculated as sold.
So, if your first take profit hits and sells 50% of your short position, but the trade does not continue downwards and moves up to your second stop loss, the remaining 50% of your position will be calculated as sold.
The same applies to SL3 and SL4, so at SL3 the remaining 30% of your position will be calculated as sold, and at SL4 the remaining 10% will be calculated as sold.
Your trailing stop loss placement is dependent on what types of trades you desire. For shorter scalps on smaller timeframes, it's recommended to place each stop loss just above each corresponding take profit for short trades.
This way you leave just enough room for the trade to continue downwards if there is enough momentum, but you don’t open yourself up to losing your unrealized profit if it does not make this continuation.
If you desire longer swing trades on higher timeframes, it might be a good idea to leave more room in between the take profit and corresponding stop loss.
This way you leave more room for the trade to mature and move in your favor since when trading longer moves, often they will not shoot straight down but rather have a series of small bounces throughout the more general downwards trend.
Note that when a short trade is first entered the only stop loss and take profit in play are your original stop loss found by the pivot high which would result in a loss, and the first take profit at a 1:1 risk to reward ratio from that pivot high.
Summary of Take Profit/Stop Loss Placement:
Correctly placed take profits and stop losses are essential in having a successful strategy and proper risk management. With that being said there are also many ways in which to use this system. Deciding how to set them up is really just a matter of determining the trading style you aim to succeed with. Once this has been determined, the placement of take profits and stop losses should be easier to configure. However, if there is any confusion on either of these topics as the ratios and corresponding TP/SL can get confusing, please do not hesitate to ask further questions in our discord!
Leverage Long
Leverage Long input simply defines the leverage used in your long positions, and is used in calculating the profit in Strategy Tracker
A rundown of risk associated with using leverage will not be given here since it should assume that if you're using leverage, you should already understand the risks.
If you are not using any leverage, then set Leverage Long input to 1.
Long Position Size
This input defines the position size you are using in your long trades.
This input is also used in calculating profit in Strategy Tracker.
Long Hedge Position Size
This input is used to define the position size of long hedge positions.
This input is also used in calculating profit in Strategy Tracker.
Important: Your Long Hedge Position Size should always be half of your Long Position Size for accurate profit calculation.
Double Long Position Size
This input is used to define the position size when in a double long.
This input is also used in calculating profit in Strategy Tracker
Important: Your Double Long Position Size should always be double your Long Position Size for accurate profit calculation.
Short Position Size
This input defines the position size you are using in your short trades.
This input is also used in calculating profit in Strategy Tracker.
Short Hedge Position Size
This input is used to define the position size of short hedge positions.
This input is also used in calculating profit in Strategy Tracker.
Important: Your Short Hedge Position Size should always be half of your Short Position Size for accurate profit calculation.
Double Short Position Size
This input is used to define the position size when in a double short.
This input is also used in calculating profit in Strategy Tracker
Important: Your Double Short Position Size should always be double your Short Position Size for accurate profit calculation.
A Message From the Developer PLEASE READ!!!
If you have made it this far in the guide, I applaud you and thank you for sticking with it as I know there is a lot of information here! This is not an exaggeration when I say there are hundreds of millions of possible variations that could be applied throughout all the inputs which is why I much prefer to call this a tool rather than an algorithm. Algorithm is a loaded word in my opinion as it comes with an implication of guarantee in the trades being made. This is not meant to discourage anybody from taking trades based off the tool which is also why I provided the option for automated alerts which through third party software can turn into automated trades; if you have the confidence in your strategy by all means I encourage you to trade it, automated or not. Just please understand that it's highly recommended to also apply your own knowledge and analysis before taking a trade as historical back testing data has its limitations and cannot always account for current market conditions. The real applicability does not fall in what the back tester window is saying you would have made or how accurate your strategy would have been, it's within the sheer number of markets and scenarios this tool can be used in and the information you can get which a human just can’t comprehend all at once; its literally endless. I urge all of you to be creative and think outside the box about what you can do with such a powerful tool at your fingertips. After all this is the reason why so many inputs were provided. Another main goal of this project was to give users a better understanding of risk management. It can be hard to manage your risk when it’s all kept in your head, but when you can modify your strategy to better manage your risk by simply optimizing a few inputs, it’s a lot easier to comprehend and actually apply when trading. The last thing I want to say is have fun working through the possible learning curve in using this tool, it may be a process but enjoy it because the one thing I can guarantee is that you will come out the other side a better trader than before!
Forex Lot Size CalculatorI grew very tired of opening a Forex Calculator Website in the moment I wanted to enter a trade copying and pasting the values as fast as I can to make sure my trade is the correct size like a responsible trader before I hit the buy button :') SO I put together this indicator tool to make the process faster and just better for myself. I have been using it for a bit and I have found it very helpful in my own process so I thought I should share it with the TV community.
The indicator does as it's title suggest. Simply add it to your chart follow to two prompts...Step one select your entry price. Step two select your stop loss price. The indicator will then load the position box for your trade. In the settings you can set your account balance, Risk % per trade and your risk to reward ratio. You also have the option to change the account base currency, the indicator will calculate the lots required to reflect the base currency that you have selected.
Things to note: This calculator is intended to give you a quick idea of an appropriate lot size for your desired trade there are many different factors that many influence the results of the calculations. Please take the time to review the results before entering your trades this tool is intend to add in your process; calculations are not guaranteed. The tool is for the Forex Market obviously.
For the most efficient way to deploy this tool I've found keeping it in my favorites section of my indictors is the best way to use it. I add it to the chart sets my points read the lots then remove it from the chart. You can modify the settings for the entry and stop each time and just leave the indictor on the chart however if you trade many pairs it becomes more tedious to type in manually the new price levels each time. It is far more simpler and fast to grab the tool out of the favs tab click the two points and read the result. Just remember to save your account settings ie: Balance, Risk, Base currency, etc...as the default settings of the indicator so everything is set up when you want to use it( You can save your settings at the bottom of the settings tab). I truly hope this tool helps your process. God bless and happy trading.
Market SnapshotGet a snapshot of the market with the index's last price, distance to selectable moving averages, and breadth data.
Choose to see data based on the Nasdaq or SPX, as well as net highs / lows for the Nasdaq, NYSE or combined.
Snapshot shows:
- Index's (SPX or Nasdaq's) last price
- Put call ratio
- % of stocks above the 50 day moving average for the index of your choice
- % of stocks above the 200 day moving average for the index of your choice
- Distance to or from two selectable moving averages. (negative number means price is below the moving average, positive means price is above)
Configurable options:
- Which moving averages to use
- Where to display the table on your chart
- Table size, background and text colors
Risk Management ToolThis tool is a good way to get quick position sizing. No need to use your calculator and find that your price asset is already out of your range.
It works best with Cryptocurrencies Exchange way to manage position size calculation.
Really useful when scalping. This tool tracks the last high and low following your custom lookback bars number. It also follows the VWAP level.
You also have 4 custom ranges around the current price with the calculated position size. You set the desired percentage distance from the current price and you get the position size you need.
1. You choose the type of order
2. Account balance
3. Leverage if you use the cost base orders type
4. Amount to risk
and you get real-time risk management.
Sessions and news markersHello,
I use this script daily so I thought it might help some of you guys out!
WHAT IS THE SCRIPT
This script can show two custom trading sessions and up to three specific dates and hours to keep in mind while trading (for example a news release).
WHY USE THE SCRIPT
My trading plan tells me to trade from 08:00am to 10:00am (GMT+1) and not to let open trades during a high impact news release, this script allows me to show my trading session and mark the news releases on the chart before trading so I don't forget about them while in the heat of trading.
HOW TO USE THE SCRIPT
It is very straightforward:
How to set up the TRADING SESSIONS:
- Tick the trading sessions that you want to use (one or two)
- Specify the trading hours
- Choose the color of the trading sessions
- Choose the color to fill outside of the trading sessions
- Choose the time zone (GMT, GMT+1, UTC, UTC+2...)
How to set up the NEWS MARKERS:
- Tick the news markers you want to use (up to three)
- Specify the date and hours of the news
- Choose the color of the news markers
- No need to choose the time zone, it will use the timezone of the chart
PS: As you can see in the settings, each session and news marker can have their own color
I hope this helps you out as much as it helps me! If you have any recommendations I would be glad to hear them :)
Market Stop LightThis indicator shows two signals to help gauge the health of the market. The first is where the price of the Nasdaq is in relation to a selectable moving average (default is the 21 ema) and the second is based on the number of net new highs and lows on the Nasdaq.
Price vs MA
Price is above a rising moving average = 🟢
Price below a falling moving average = 🔴
Price above a falling moving average or below a rising moving average = 🟡
Net highs / lows signal
3 days in a row of net new highs = 🟢
3 days in a row of net new lows = 🔴
Between 3 days either way = 🟡
Configurable options:
- Which moving average to use
- Option to show signal history
- Where to display current data on the chart
- Table size
Crypto Index (DXY) CandlesA modification of @loxx's "Dollar Index (DXY) Candles" allowing for a user selected basket of tickers using the same weights as the standard DXY. Ticker Inputs are in descending order so highest weight is at the top by default, although weighting can be changed manually by modifying the symbol's corresponding weight input in the settings. The Idea was to get a bird's eye view of the crypto space using some of the more relevant names in the space. User's can use the toggle in the settings for viewing the default DXY for comparison. Indicator should be used as a confirmation when looking at long term trend changes in the space, shorter time frames may, or may not be as useful.
Financial Data Spreadsheet [By MUQWISHI]The Financial Data Spreadsheet indicator displays tables in the form of a spreadsheet containing a set of selected financial performances of a company within the most recent reported period. Analyzing Financial data is one of the classic methods to evaluate whether the company’s stock price is overvalued or undervalued based on its income statement, balance sheet, and cash flow statement. This indicator might be practical to investors to collect needed data of a company to analyze and compare it with other companies on a TradingView chart or print it in spreadsheet form.
█ OVERVIEW
█ BEST PRACTICES
Due to strict limitations on calling request.financial() function, I tried to develop the table with the best ways to be more dynamic to move and the ability to join multiple tables into a spreadsheet. Users can add up to 20 instruments and 2 financial metrics per table. However, it’s possible to add many tables with other financial metrics, then connect them to the main table.
Credits: The idea of joining multiple tables inspired by @QuantNomad Screener for 40+ instruments
█ INDICATOR SETTINGS
1- Moving Table toward right-left up-down from its origin.
2- Hiding Column Title checkmark. Useful for adding a joined table underneath with additional instruments.
3- Hiding Instruments Title checkmark. Useful for adding a joined table on the right with other financial metrics.
4- Shade Alternate Rows checkmark. I believe it’ll make the table easier to read.
5- Selecting Financial Period. (Year, Quarter).
6- Entering a currency.
7- Choosing a financial ID for each column. There’re over 200 financial IDs. Source: What financial data is available in Pine? — TradingView
8- Optional to highlight values in between.
9- Entering the ticker’s symbol with the ability to activate/deactivate.
█ TIP
For best technical performance, use the indicator in a 1D timeframe.
Please let me know if you have any questions.
Thank you.
Kioseff Trading - AI-Powered Strategy Optimizer Introducing the Kioseff Trading AI-Powered Strategy Optimizer
Optimize and build your trading strategy with ease, no matter your experience level. The Kioseff Trading AI-Powered Strategy Optimizer allows traders to efficiently test and refine strategies with thousands of different profit targets and stop loss settings. Integrated with TradingView's backtester, this tool simplifies strategy optimization, strategy testing, and alert setting, enabling you to enhance your strategy with AI-driven insights.
Key Features:
Comprehensive Testing : Simultaneously test thousands of profit targets and stop losses to fine-tune your strategy.
Dual Strategy Optimization : Adjust and optimize both long and short strategies for balanced performance.
AI Integration : Elevate your strategy with heuristic-based adaptive learning, turning it into a smart, AI-assisted system.
Detailed Analysis : View critical metrics like profit factor, win rate, max drawdown, and equity curve, presented in a strategy script format.
Customizable Alerts : Set alerts for the best version of your strategy.
Flexible Risk Management : Optimize various stop loss types, including profit targets, limit orders, OCO orders, trailing stops, and fixed stops.
Targeted Goals : Choose optimization goals like highest win rate, maximum net profit, or most efficient profit.
Indicator Compatibility : Integrate any strategy/indicator, whether it’s your creation, a favorite author’s, or any public TradingView indicator.
Accessible Design : Navigate a user-friendly interface suitable for traders of all skill levels. No code required.
Precision Lock-In : “Lock” your optimal profit target or stop loss to drill down into precision testing of other variables.
How it works
It's important to remember that merely having the AI-Powered Strategy Optimizer on your chart doesn't automatically provide you with the best strategy. You need to follow the AI's guidance through an iterative process to discover the optimal settings for your strategy.
The Trading Strategy Optimizer is a versatile tool tailored for both non-coding traders and seasoned algorithmic trading professionals. Let's start with no-code-required instructions on how to use the optimizer.
Instructions: How To Optimize Your Strategy Without Code
1. Build your strategy in the settings
The image above shows explanations for each key setting.
Note: This example uses the RSI indicator to initiate a long trade whenever it dips below the 30 mark.
Ensure that the indicator you wish to optimize is already applied to your chart . This enables the Trading Strategy Optimizer to interact with the indicator and finetune profit targets and stop losses effectively.
Because the indicator is plotted on the chart I can access the indicator with the Trading Strategy Optimizer and optimize profit targets and stop losses for it.
2. Leverage AI Recommendations
Optimization Prompt: After you load your strategy, the tool advises you on new TP and SL levels that could be more profitable.
When your strategy is set, the tool gives you tips for where to set your profit goal (TP) and your stop loss to help you optimize your strategy. It'll tell you if there's a better range for these settings based on past results.
Follow Suggestions: Keep updating your TP and SL according to the tool's suggestions until it says "Best Found".
Final Result: The last image shows the best settings found by the indicator.
(Optional Step 3)
3. Lock the profit target or stop loss to further fine tune your strategy
Continue following the AI’s suggestion until “Best Found” is displayed.
Note: you can select lock either your stop loss or profit target for fine tuning. For this demonstration we will lock our profit target.
Code-Required Instructions (Optional)
You can backtest more code-intensive strategies, such as harmonic patterns, traditional chart patterns, candlestick patterns, Elliot wave, etc., by coding the entry condition in your own script and loading it into the Trading Strategy Optimizer. Let's dial in on how to achieve this!
1. You must create an integer variable in your script with an initial value of "0".
2. Define your entry condition in the code. Once complete, assign the value "1" to the variable you created if the entry condition is fulfilled.
3. Plot your variable.
4. Select the plotted variable in the settings for the Trading Strategy Optimizer
The image above shows a coded entry condition for the linear regression channel (which can be any indicator). When price crosses under and closes below the lower line our variable "strategyEntryVariable" is assigned the value "1".
The Trading Strategy Optimizer will treat this change in value from "0" to "1" as an entry signal and enter long/short up to 1000 times at the price where the entry condition was fulfilled.
5. Test Your Strategy
The image above shows the completion of the process! Keep applying the steps we described. Stick with the AI's recommendations until you see “Best Found” show up.
By following these instructions, you can build, test, and optimize almost any trading indicator or strategy!
So, just note that the Trading Strategy Optimizer considers a change in value of a plotted variable from "0" to "1" as an entry signal! So long as you follow this rule you should be able to test and optimize any conceivable, Pine Script compatible strategy!
AI Mode
AI Mode incorporates Heuristic-Based Adaptive Learning to fine-tune trading strategies in a continuous manner. This feature consists of two main components:
Heuristic-Based Decision Making: The algorithm evaluates multiple versions of your strategy using specific metrics such as Profit and Loss (PNL), Win Rate, and Most Efficient Profit. These metrics act as heuristics to assist the algorithm in identifying suitable profit targets and stop losses for trade execution.
Online Learning: The algorithm updates the performance evaluations of each strategy based on incoming market data. This enables the system to adapt to current market conditions.
Incorporating both heuristic-based decision-making and online learning, this feature aims to provide a framework for trading strategy optimization.
Settings
AI Mode Aggressiveness:
Description: The "AI Mode Aggressiveness" setting allows you to fine-tune the AI's trading behavior. This setting ranges from "Low" To "High, with higher aggressiveness indicating a more assertive trading approach.
Functionality: This feature filters trading strategies based on a proprietary evaluation method. A higher setting narrows down the strategies that the AI will consider, leaning towards more aggressive trading. Conversely, a lower setting allows for a more conservative approach by broadening the pool of potential strategies.
Adaptive Learning Aggressiveness:
Description: When Adaptive Learning is enabled, the "Adaptive Learning Aggressiveness" setting controls how dynamically the AI adapts to market conditions using selected performance metrics.
Functionality: This setting impacts the AI's responsiveness to shifts in strategy performance. By adjusting this setting, you can control how quickly the AI moves away from strategies that may have been historically successful but are currently underperforming, towards strategies that are showing current promise.
Additional Settings
Optimization
Trading system optimization is immensely advantageous when executed with prudence.
Technical-oriented, mechanical trading systems work when a valid correlation is methodical to the extent that an objective, precisely-defined ruleset can consistently exploit it. If no such correlation exists, or a technical-oriented system is erroneously designed to exploit an illusory correlation (absent predictive utility), the trading system will fail.
Evaluate results practically and test parameters rigorously after discovery. Simply mining the best-performing parameters and immediately trading them is unlikely a winning strategy. Put as much effort into testing strong-performing parameters and building an accompanying system as you would any other trading strategy. Automated optimization involves curve fitting - it's the responsibility of the trader to validate a replicable sequence or correlation and the trading system that exploits it.
Position Size ToolUpdated - Version 2
This tool is used to calculate the size of a trade.
Settings - Type in total account size and % of capital that can be risked on each trade.
The table will display:
Column 1 - Stop placement based on low, mid or high value of the current candle.
Column 2 - Percent risk on the trade.
Column 3 - Amount of shares that can be traded (calculated from account size, risk and selected stop placement).
Green color is intended for long position, stop at the low of the candle.
Red color is intended for short position, stop at the high of the candle.
Middle value can shift between either color since its measured from open to close.
Price Change AlertsThis purpose of this indicator script is to reduce time traders spend staring on the charts.
For example if you're trading BTCUSD you can set alerts to be trigered by desired delta amount, for example 50. Then you can receive push notifications on your phone (need to install the tradinview app) and on your desktop computer every time price changes by amount of 50. Simple and easy.
To enable alerts do this:
- Click on alerts clock icon in top right corner of the screen
- Click on "Create alert button"
- In Condition dropdown select "alerts"
- In the next dropdown select "Any alert function() call" and click on "Create" button
Script uses repainting on purpose to display daily percentage changes since the previous day's closing and to triger alerts.
Portfolio Chart by fonotoFeatures:
If you are looking for a chart that can project your portfolio value as a whole over time instead of individual stocks, this can be it. This is an indicator overlaid on the main chart of your index/stock selection allowing you to compare your portfolio performance against the main index/stock visually in chart form.
UI:
The settings has UI to input your portfolio stocks and quantities. The setting also has a divide factor which you can set to divide the portfolio value by this value so Y-Axis is offset to show main index/stock chart and your portfolio chart relatively closer. Portfolio chart works on any chosen timeframe. Colors can be customized in the UI.
Limitations:
1. Number of portfolio stocks is limited to 10.
2. Chart Type is limited to Candle.
3. Exponential Moving Averages are limited to 21, 50, 100, 200 & 500.
Entry helperHello traders,
This is a script I use daily as a scalper and it helps me a lot, maybe it can help you, this is why I am sharing it!
PART 1 - DESCRIPTION
This program is specifically designed to help scalpers but can be used for all types of trading but won't be as useful.
This script is what I call an entry helper as it calculates dynamically the position size, stop loss and take profit levels and more.
When scalping and placing market entry orders, the price can move significantely while you are calculating your position size according to your stop loss, capital, risk and especially close price that changes very quickly, this results in a risk that is not ideally controlled and personally was a source of frustration and stress. I wanted to enter my quantity and stop loss values as fast as possible and make the process easier.
This script automates the calculation of the position size, stop loss and take profit levels according the the users input and prints the data visibly on the screen so it is easy to copy by the trader. It allows the trader to be confident that his risk is as controlled as possible.
The script is easy to use and set up, this guide will help you if you have any difficulies or questions.
PART 2 - HOW TO USE THE SCRIPT
- SET THE CAPITAL SETTINGS
1 - Set your capital value in $
- SET THE TRADE SETTINGS
2 - Set your trade side (BUY or SELL)
3 - Set you desired risk in % of your capital
- ENTRY SETTINGS
4 - Set your entry from 2 different options
|MARKET| (default option)
This option will place the entry level at the last available price
|LIMIT|
This option allows you to input a fixed price level for the entry
- STOP LOSS SETTINGS
5 - Select your stop loss placement from 4 different options
|EXTREMA STOP LOSS| (default option)
This option will place the stop loss at the highest/lowest (extrema) price level within the last N candles
|ATR EXTREMA|
This option uses the same price level as the EXTREMA STOP LOSS but will add/soustract the last ATR value (calculated on the N last candles) multiplied by a coefficient that you input
|TICKS EXTREMA|
This option uses the same price level as the EXTREMA STOP LOSS but will add/soustract a number of ticks that you input
|PRICE LEVEL|
This option allows you to input a fixed price level for the stop loss
- TAKE PROFIT SETTINGS
6 - Select your take profit from 3 different options
|NONE| (default option)
This option will not display any take profit level, I have added this option as I don't have take profit targets
|RR|
This option uses a risk to reward ratio (reward/risk) that you input, it will automatically calculate the take profit level that corresponds
|PRICE LEVEL|
This option allows you to input a fixed price level for the take profit
- QUANTITY AND FEE SETTINGS
7 - Set the quantity settings, it represents the quantity in a lot (usually 100 000 in forex, 100 in stocks 1 for crypto currencies)
8 - Set the fee per quantity (turning lot)
- VISUAL SETTINGS
9 - Show or remove the tab
- TAB SETTINGS
10 - Select the data that you want to display in the tab (the tab will adapt automatically)
NOTES:
The vertical dashed line shows what candle has been used for the calculation of the stop loss, it allows you to visualize what candle the script has selected in case of an EXTREMA stop loss option.
I hope this helps you out! Any suggestions are welcome and I hope that the guide is clear enough.
Happy trading!
Breakeven Line DemoPlug the breakeven line code into the bottom of your strategy to get visualization of your breakeven price. Line is green when net position is long, red when net short and invisible when strategy is risk neutral. Most useful for strategies which use pyramiding (successive entries in same direction stacked upon each other) as it can be difficult to track where prices needs to return to to allow closing in profit. Disclaimer: the strategy logic is garbage do not use it. It is only there so you can see how Breakeven Line logic is implemented.
Portfolio_Tracking_TRThis is a portfolio tracker that will track individual, overall and daily profit/loss for up. You can set the size of your buys and price of your buys for accurate, up to date profit and loss data right on your chart. It works on all markets and timeframes.
Next we get into setting up your , order size and price. Each ticker lets you set which stock you bought, then set how much you purchased and then what price you purchased them at.
FEATURES
Top Section
The portfolio tracker has 2 sections. The top section shows each ticker in your portfolio individually with the following data:
- Ticker Name
- Weight of that asset compared to your total portfolio in %
- Current value of that position in TL
- Profit or loss value from purchase price in %
- Todays change in value from yesterday’s close in %
Bottom Section
The bottom section of the tracker will give you info for your portfolio as a whole. It has the following data:
- Total cost of your entire portfolio in TL
- Current value of your entire portfolio in TL
- Current profit or loss of your entire portfolio in TL
- Current profit or loss of your entire portfolio in %
- Todays change of your entire portfolio value compared to yesterday’s close in %
This indicator was compiled from FriendOfTheTrend's indicator named Portfolio Tracker For Stocks & Crypto.
LuxAlgo - Backtester (S&O)The S&O Backtester is an innovative strategy script that encompasses features + optimization methods from our Signals & Overlays™ toolkit and combines them into one easy-to-use script for backtesting the most detailed trading strategies possible.
Our Signals & Overlays™ toolkit is notorious for its signal optimization methods such as the 'Optimal Sensitivity' displayed in its dashboard which provides optimization backtesting of the Sensitivity parameter for the Confirmation & Contrarian Signals.
This strategy script allows even more detailed & precise backtests than anything available previously in the Signals & Overlays™ toolkit; including External Source inputs allowing users to use any indicator including our other paid toolkits for take profit & stop loss customization to develop strategies, along with 10+ pre-built filters directly Signals & Overlays™' features.
🔶 Features
Full Sensitivity optimization within the dashboard to find the Best Win rates or Best Profits.
Counter Trade Mode to reverse signals in undesirable market conditions (may introduce higher drawdowns)
Built-in filters for Confirmation Signals w/ Indicator Overlays from Signals & Overlays™.
Built-in Confirmation exit points are available within the settings & on by default.
External Source Input to filter signals or set custom Take Profits & Stop Losses.
Optimization Matrix dashboard option showing all possible permutations of Sensitivity.
Option to Maximize for Winrate or Best Profit.
🔶 Settings
Sensitivity signal optimizations for the Confirmation Signals algorithm
Buy & Sell conditions filters with Indicator Overlays & External Source
Take Profit exit signals option
External Source for Take Profit & Stop Loss
Sensitivity ranges
Backtest window default at 2,000 bars
External source
Dashboard locations
🔶 Usage
Backtests are not necessarily indicative of future results, although a trader may want to use a strategy script to have a deeper understanding of how their strategy responds to varying market conditions, or to use as a tool for identifying possible flaws in a strategy that could potentially be indicative of good or bad performance in the future.
A strategy script can also be useful in terms of it's ability to generate more complete & configurable alerts, giving users the option to integrate with external processes.
In the chart below we are using default settings and built-in optimization parameters to generate the highest win rate.
Results like the above will vary & finding a strategy with a high win rate does not necessarily mean it will persist into the future, however, some indications of a well-optimized strategy are:
A high number of closed trades (100+) with a consistently green equity curve
An equity curve that outperforms buy & hold
A low % max drawdown compared to the Net Profit %.
Profit factor around 1.5 or above
In the chart below we are using the Trend Catcher feature from Signals & Overlays™ as a filter for standard Confirmation Signals + exits on a higher timeframe.
By filtering bullish signals only when the Trend Catcher is bullish, as well as bearish signals for when the Trend Catcher is bearish, we have a highly profitable strategy created directly from our flagship features.
While the Signals & Overlays features being used as built-in filters can generate interesting backtests, the provided External Sources can allow for even more creativity when creating strategies. This feature allows you to use many indicators from TradingView as filters or to trigger take-profit/stop-loss events, even if they aren't from LuxAlgo.
The chart below shows the HyperWave Oscillator from our Oscillator Matrix™ being used for take-profit exit conditions, exiting a long position on a profit when crossing 80, and exiting a short position when crossing 20.
🔶 Counter Trade Mode
Our thesis has always firmly remained to use Confirmation Signals within Signals & Overlays™ as a supportive tool to find trends & use as extra confirmation within strategies.
We included the counter-trade mode as a logical way to use the Confirmation signals as direct entries for longs & shorts within more contrarian trading strategies. Many traders can relate to using a trend-following indicator and having the market not respect its conditions for entries.
This mode directly benefits a trader who is aware that market conditions are generally not-so-perfect trends all the time. Acknowledging this, allows the user to use this to their advantage by introducing countertrend following conditions as direct entries, which tend to perform very well in ranging markets.
The big downfall of using counter-trade mode is the potential for very large max-drawdowns during trending market conditions. We suggest for making a strategy to consider introducing stop-loss conditions that can efficiently minimize max-drawdowns during the process of backtesting your creations.
Sensitivity Optimization
Within the Signals & Overlays™ toolkit, we allow users to adjust the Confirmation Signals with a Sensitivity parameter.
We believe the Sensitivity paramter is the most realistic way to generate the most actionable Confirmation Signals that can navigate various market conditions, and the Confirmation Signals algorithm was designed specifically with this in mind.
This script takes this parameter and backtests it internally to generate the most profitable value to display on the dashboard located in the top right of the chart, as well as an optimization table if users enable it to visualize it's backtesting.
In the image below, we can see the optimization table showing permutations of settings within the user-selected Sensitivity range.
The suggested best setting is given at the current time for the backtesting window that's customizable within the indicator. Optimized settings for technical indicators are not indicative of future results and the best settings are highly likely / guaranteed to change over time.
Optimizing signal settings has become a popular activity amongst technical analysts, however, the real-time beneficial applications of optimizing settings are limited & best described as complicated (even with forward testing).
🔶 Strategy Properties (Important)
We strongly recommend all users to ensure they adjust the Properties within the script settings to be in line with their accounts & trading platforms of choice to ensure results from strategies built are realistic.
🔶 How to access
You can see the Author's Instructions below to learn how to get access on our website.
ILM India Sectors NSDL FII/FPI Investments FortnightlyThis indicator shows the FII/FPI fortnightly investments across various sectors for easy consumption.
This data is sourced from website
www.fpi.nsdl.co.in
This data gets published on a fortnightly basis.
This data is very difficult to interpret and not easy to consume.
This indicator makes this data very easy to consume and make good investment decisions by tagging along with Smart Money.
Since Trading View does not expose this data via QUANDL or any other means, the data is updated in the indicator itself.
Hence, indicator needs to be updated as soon as the new data is available on a fortnightly basis.
All the numbers are in INR Cr.
The date columns represent the investment value for that fortnight for the sector
AUC column represents the total Assets held by FPI in that sector
%age column represents the %age of Assets in the sector compared to Total FPI investment
Features Planned in future
- Drill down to Group-A stocks in the sector and show the performance of the stock (% Change, Volume, Delivery) fortnightly so specific stock can be identified
Send me a DM if you would like to see any additional features on this indicator
Turtle Money ManagementThe Turtle Trading approach* is a trend following system that uses volatility for position size. *(Richard Dennis & William Eckhardt )
Turtle traders use the N unit system for risk management, which has its own advantages. This indicator offers beginners a simple interface that uses the same logic. Using ATR (Average True Range) to measure volatility.
The indicator shows the suggested position size and stop-loss price. You need to activate position line to see how it behaved in the past. Information about the Turtle system shows that it works in a daily candle. Intraday candles can be misleading (for ATR) because of this indicator use daily ATR by default. I leave the choice to you.
Limits recommended by Turtle Traders
-
Single Trade % 2 Maximum risk
Single Market % 4 Maximum risk
Closely Correlated Markets % 6 Maximum risk
Loosely Correlated Markets % 10 Maximum risk
Single Direction – Long or Short % 12 Maximum risk