olivero0

EP/SL and ratio calculation

olivero0 Mis à jour   
Explanation of the indicator

The first question is - what is shown here at all. Generally, the indicator calculates order prices depending on the data found in the chart. The order is based on the lowest low (for a long) of the bounce and the high of the last candle. For a short it is based on the highest high and on the low of the last candle. There is no value for you, if you don’t do swing trading using trend lines on your chart.

All values shown are no financial advise - you are responsible for all your trades.

The indicator looks for the lowest low of the last days. How many days back to be searched can be configured in the settings. The lowest low is marked with the flag - the date and price is displayed there.
The high of the last candle is read out and based on this the entry price is calculated. On the green line are the EP percentages with which is calculated, the entry price and also the high of the last candle displayed.
On the line there is a green (or red) triangle, which indicates the trading direction. More about the direction can be found below in the settings.
Based on the lowest low (or in case of short the highest high) the stop loss is calculated. Also here the percentage and the price is given.
The lines labeled R1 to R5 are the prices of the respective ratios. The lines are 40 time units long (in the standard setting) and thus one can read off the ratio, which the trade would reach after approx. 8 weeks, over the trend lines and their intersection point at the end of the ratio lines.
The orange line marks the point at which we would be 10% above the entry price (or below the entry price for a short).

In general, the calculations are equivalent for short, the marker of the highest high is displayed.

The capital and the number of shares to be traded are not publicly displayed on the chart. The complete calculation is visible when you move the mouse over the text of the entry price.

In this small pop-up window you can see with which capital the calculation was done. The capital should be updated daily in the settings. Furthermore, you can see how many shares can be traded with this capital, taking into account the 1% portfolio risk. It is again the entry price and a proposal for a stop limit price (percentages also configurable) displayed. The price for the 3 ratio (take profit) and also the price for the stop loss can be read here. So actually everything that is necessary for the creation of the order.

Settings

The indicator now has a lot of settings and options. I have also built-in indicators such as EMA and JMA to have all the indicators necessary for me - with the free TV. Some things can also be changed under "Style", but I don't want to go into the things under "Style" here, just the basic settings.

Settings of the main indicator

With the checkmark at "Main Indicator" all lines etc. can be switched off without the other indicators (EMA, JMA) disappearing.

Capital:
Here you can set your daily capital (from paper trading or from the real money deposit). This is used to calculate the number of shares.

Search last bounce in last x candles:
Here you can influence how many candles the tool should look into the past to search for the lowest (long) or highest (short) candle. Default is 10, but sometimes shorter or longer periods make sense. It is also possible to tune a bit here and e.g. with "0" make the calculation of the SL based on the low/high of the last candle. Which low (long) or high (short) is taken, is always evident with the above described flag.

go back x candles for calculation:
If the calculation is not to be made on the basis of the last candle, but e.g. the one before last, this can be adjusted here. Everything is adapted with, thus e.g. also the Stochastic of this time is used for the direction. One can go back in time and reconstruct the calculation at that time.

EP percent:
Specifying how far the EP should be from the high (long)/low (short) of the last candle.

EP limit percent:
Specify how far the EP limit should be from the EP.

SL percent:
Specifying how far the SL should be from the lowest low (long)/highest high (short).

direction mode:
here is set in which way the indicator should be directed long or short. The stochastic used here has the settings 8-5-5. k is the blue line and d is the red line of this stochastic.

Stoch k>d = long automatic, blue line above the red line for long calculation
Stoch k<50% = long automatic, blue line below 50% for long calculation
long no automatic, always long calculation
short no automatic, always short calculation

ignore last candle if market is open:
Normally one calculates at closed market, thus on the finished candles. If you want to calculate with an open market or if you want to make sure that the indicator is not constantly running back and forth after the market has opened, you can automatically ignore the last candle (i.e. calculate on the second to last candle) if the market is open. If the market is closed, the last candle is always taken. If turned off, the last candle is always taken even if the market is open.

use close price for EP (instead of high/low):
You can adjust the EP calculation here to take the close price instead of the high/low of the last candle. This is not the usual strategy, but if there are long wicks/luns and you are quite sure with the trading direction, this can improve the ratio significantly.

Ratio lines length (bars):
The length of the lines. You can change here for 3M/6M trades to 80 time units.

Text color:
Color of the text (default is gray, this is kind of useful for white and black background).

Line color R-lines:
Color of the ratio lines (default is gray)

10% color:
Color of the 10% line (default orange)

Additional indicators settings

EMAs:
Here you can switch on/off all EMA lines

xx EMA Length:
Configuration of the individual EMA lines to be displayed. At 0 the line is switched off, colors are configured at the style.

JMA:
Here you can additionally display the JMA. Also its colors can be configured at Style.

JMA length:
JMA length, default 20, phase is fixed at 50 and power is fixed at 2.
Notes de version:
typo corrected
Notes de version:
screenshot corrected
Notes de version:
Options are now grouped
candle markers added
Notes de version:
- Added a kind of ruler at the end of the ratio lines.
- Removed several warnings.
Notes de version:
- Added possibility to reduce ratio by a percentage (default 1%)
- changed default EP percentage to 1%
Notes de version:
- bugfix for short (ratio percent in wrong direction)
- added option to use close instead of high/low for SL calculation
Notes de version:
update to V5 script

changed length of 0.5 ratio lines due to disappearing lines in case of holidays

bring back mode to show entry information without pop-up (e.g. for mobile)
Script protégé
Ce script est publié en code source fermé et vous pouvez l'utiliser librement. Vous pouvez le préférer pour l'utiliser sur un graphique. Vous ne pouvez pas visualiser ou modifier son code source.
Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?