Max Gain

This indicator is meant to be used for coming up with price targets based on past performances of rallies/selloffs.
It shows how much a trade could have made over a 30-day period (or other length of time) in terms of percentage gain.
It also show how much could have been lost in terms of percentage loss

The green plot shows percentage gain from current high to the low of the previous 30 days.
The red plot shows adjusted percentage loss from current low to the high of the previous 30 days.
The 30 can be adjusted and the chart can be used on any time interval.

Note on max loss adjustment:
Max loss percentage is adjusted to be higher to account for the fact that a percentage loss corresponds to a percentage
gain of a greater amount. For instance, a loss of 25% can only be recovered with a percentage gain of 33%.
A 25% loss looking at the chart from left to right would be a 33% gain looking at the same price
action from right to left. In order to compare apples to apples visually and performance wise, max loss percent needs to be adjusted.
The actual max loss percent is calculated and plottable but is not plotted by default because it is less useful and adds clutter.
There is not a great difference between actual max loss and adjusted max loss under everyday market conditions, but
major selloffs ( SPY 2020), short squeezes ( GME 2021), or other unusually directional moves will display percentage losses
that, in absolute terms, should be considered to be fairly incorrect. The adjusted percentages are good indicators of
relative performance when comparing the magnitudes to the magnitudes of the max gain percentages and
are more visually meaningful than the actual max loss percentages in every situation, so they are plotted despite having incorrect values.

Note on bear markets:
This indicator was designed for bull markets but should it be used in bear markets the indicators that are and aren't
plotted should be swapped using the plot check boxes in the settings dialogue if there is interest in using the loss percentages
for actual loss amount calculations while maintaining visual/performance adjustment

As can been seen in the example chart a gain of 16.3% to 17.1% appears to be a resistance level . This level was recently broken through and the next resistance is 24.5%.
The target is a 24.5% gain from the anticipated 30-day low at the time when the price can be expected to reach a 25.4% gain at the gain rate observed in recent rallies.
Previous rallies are shown for reference with their 30-day periods and corresponding gain percentages which are plotted below.
A selloff is shown in red for reference as well. It was drawn backward to trick the tool into thinking it was a gain, so as to demonstrate logic behind the adjustment.
In reality, this was closer to a 9.5% loss, not 10.55%.

I am still experimenting with this indicator to see how to best use it. Ultimately, it helps me do what I was already doing with the percentage gain tools
but now I can do those analyses in a more systematic manner and with charting. Please feel free to ask questions.




500 代幣
+3 回覆
First of wall, thank you for your time, your dedicaation, and your open source code( I'm not a programmer but sometimes a like to tweek some numbers and colors as defaults, so, I appreciate it = )

Do you think you gonna be able to record a video in the future, or, writting a step by step guide ? = )
I'll be testing here, if I have anything useful to say I'll share with te comunity o/
+2 回覆
Skipper86 hardmangames77
@hardmangames77, Thanks for the kind words, I'm glad you appreciate the script. Sorry, I don't plan to make a video, I'm still figuring out the best ways to use the indicator and I don't ever make trading videos. For now, a step-by-step guide to the intended use of the indicator is as follows:
1. Looking at the price action, find the longest run up in the relatively recent past (approximately 6 months to a year) and count the number of days that it took to go from the bottom to the top, this can be done using the date range tool as shown in the chart. They all happen to be almost 30 days in the example, but in other charts they're usually not all the same, so the longest one should be determined.
3. Add a couple days to that length and set that as your Max Gain Trading Period Length via the settings window
4. Look for common peaks which appear to serve as horizontal resistance and/or support levels in the indicator, mostly look at the green line but the red line peaks sometimes line up with the green which may strengthen those levels
5. Don't buy at or approaching resistance but look for breakthroughs which should also be supported by basic technical analysis of the price action such as the application of Dow theory or observing moving averages and Bollinger Bands.
6. Sell when approaching the next level of resistance or halfway to it. Make sure you have a stop loss. I'd recommend putting one just below the current day's low if you're not sure where to put one.
The same strategy applies in a bear market but with the normally hidden indicators used instead.
Hope this helps.
@Skipper86, You're awesome man = ) ~ ~ ~
Thank you very much again! = )
+1 回覆
Great script
+1 回覆
Thank you for making and publishing this useful indicator . God bless you ,Always be happy & enjoyable trading .
+1 回覆
This publication is now featured in our Editors' Picks: .
In the name of all TradingViewers, thank you for your valuable contribution to the community, and congrats!
+1 回覆
Hello, sir buy where
Skipper86 netlife1
@netlife1, 1565 might be a good entry but you shouldn't take trading advice from strangers on the internet
+3 回覆