TradingView
ceyhun
2019年7月1日午後12時9分

Top Bottom Indicator 

EURO / NEW ZEALAND DOLLARICE

詳細

Top Bottom Indicator

リリースノート

bugs fixed

リリースノート

fix
コメント
raja74sekhar
Thanks a lot kindly let me know which time frame better only intraday trade. I.e 3,5,15 min
wealthy1111
Thank you for making & publishing this useful indicator , God bless you , always be happy & enjoyable trading & investing.
akafnf
@ceyhun hi there! Thanks for your work it’s a great script appreciate it a lot!! Could you just make a strategy out of it pls
pranjpatil
Discription for this Script.
The provided Pine Script code is a study that aims to identify top and bottom periods in the price chart and then plots buy and sell signals based on the crossovers of these periods. Let's break down the logic of the code step by step:

1. **Input Parameters:**
- `per`: This parameter defines the period used to identify the bottom period.
- `per2`: This parameter defines the period used to identify the top period.

2. **Identifying Bottom Periods:**
The code uses the `lowest` function to determine the lowest price value over a specified period. It then checks if the current low price is lower than the lowest price of the previous candle (`low < lowest(low[1], per)`) and also lower than the lowest price over the defined period (`low <= lowest(low[per], per)`). If both conditions are met, it means a potential bottom has been found, and a variable called `bottom` is assigned the number of bars since this bottom was found using the `barssince` function.

3. **Identifying Top Periods:**
Similarly, the code uses the `highest` function to determine the highest price value over a specified period. It then checks if the current high price is higher than the highest price of the previous candle (`high > highest(high[1], per2)`) and also higher than the highest price over the defined period (`high >= highest(high[per2], per2)`). If both conditions are met, it means a potential top has been found, and a variable called `top` is assigned the number of bars since this top was found using the `barssince` function.

4. **Buy and Sell Signals:**
The `crossover` function is used to check if the value of the `bottom` variable crosses above the value of the `top` variable, indicating a potential buy signal (`Buy = crossover(bottom, top)`). Similarly, the `crossunder` function is used to check if the value of the `bottom` variable crosses below the value of the `top` variable, indicating a potential sell signal (`Sell = crossunder(bottom, top)`).

5. **Plotting Signals:**
The `plotshape` function is used to plot the buy and sell signals on the chart. When a buy signal is generated, a green "BUY" label is plotted below the corresponding bar. When a sell signal is generated, a red "SELL" label is plotted above the corresponding bar. The `bgcolor` function is used to set the background color of the chart based on whether the top period is greater than the bottom period (blue background) or the bottom period is greater than the top period (red background).

6. **Alerts:**
The `alertcondition` function is used to trigger alerts when buy and sell signals are generated.

In summary, the script identifies potential top and bottom periods in the price chart and plots buy and sell signals based on the crossovers of these periods. It also uses background colors to provide a visual indication of whether top periods are greater or bottom periods are greater.
wjw668
@pranjpatil, Thank you so much. This is helpful!
kamleshparmar5908
Fine app
akafnf
It’s not repainting at all and that’s great ))))
詳細