ローソク足分析
BarCounting_ v1.1** aims to facilitate candle identification while studyng or sharing your screen. not for professional use. idea here is to make it as easy and direct as possible. hope it helps. **
** tem como único objetivo facilitar a identificação de velas/dos candles enquanto estuda ou compartilha sua tela. não para uso profissional. a única ideia aqui é torná-lo o mais fácil e direto possível. espero que ajude.**
The Strat ToolsThis indicator will be collection of tools for using Rob Smith's The Strat.
Currently only bar numbers is implemented.
Every individual tool can be enabled or disabled and customized.
#TheStrat
NVME Candles Creator Experimental //Note://
This is an experimental indicator that may provide you with useful information or it may not depending on how you use it and more information can be found below!
NVME Candle Creator indicator is an experimental indicator that allows you as the user to build your own candlestick system within a click of a button. The indicator uses data from 5 different chart series including the following: The default candle stick, Heikin Ashi, Renko (ATR Version), Kagi and the Point and Figure chart. Since there are 4 pieces of data from a candle plot such as the open, the close, the high and the low, we are able to edit each individually with our own data using the security() function and the chart series functions that are linked to the those specific charts. This indicator is designed to be used as a second chart alternative without having to take much screen space, however there are other uses to it such as using this indicator to find information about other chart types and possibly creating a noise free chart series using our integrated colour scheme system.
The features of this indicator are the following:
Sources (1-4) : These are customisable by changing the item listed on the drop down menu, the items displayed will be data from the charts such as open, close, high, low, hl2, hl3, and ohcl etc. There are 4 of these inputs as this will change the data that you are grabbing for the series. (Series 1 -> Close, Series 2 -> Open, Series 3 -> High, Series 4 -> Low)
Candle Style (1-4) : This is the chart series we will be using to get the final output of the indicator, this can be changed by selecting a different item in the dropdown menu. The following content of this drop down menu are: Default (Japanese Candlesticks), Heikin Ashi Candlesticks, ATR (Renko Version), Kagi and Point and Figure. These will strongly determine the final output of the indicator as they can change what data will be represented and how it will be displayed.
Length (1-4) : The value in this input field only affects the following candle style options: ATR, Kagi and Point and Figure. The reason is because these chart series include a customisable input in the form of reversal points or ATR value. Changing this value will determine the final design of the indicator as it can make the candles larger or smaller depending on the number inside the box.
Custom Timeframe (1-4) : This toggle will allow you to fetch data from a different timeframe of choice, however disabling this will fetch data from the current timeframe period.
Timeframe Value (1-4) : This input field is only active when the custom timeframe is enabled and this will change the security function so that it grabs data from the timeframe inputted and this can change the indicator's output so that the candles will look different but it doesn't have a significant change compared to the candle style feature.
Colour Filter: (Affects the candles plotted)
Option 1: "Close > Open" - Recolours the candles in a manner where candles will be green if that candle is greater than the open and the candles will be red if the close is less than the open.
Option 2: "Close < Open" - Recolours the candles in a manner where candles will be red if that candle is greater than the open and the candles will be green if the close is less than the open. (May be useful for some settings where the plots are different) - Use this as a colour correction.
Option 3: "None" - The colours will be removed so you will have to manually change it.
Dashboard: This can be turned off or turned on however it doesn't contain anything useful only a reminder that it isn't recommended to use this indicator alone as it is designed as an experimental indicator.
[SerDarK] SMA RSI Engulfing BarENG: This indicator includes the SMA line colored according to the price position, the RSI to identify the bearish or the bullish points, the Engulfing bars, the clock and the information panel showing the countdown to the candle closing.
SMA: default period is set to 50. It can change from the settings.
Definition of SMA line default colors: When the price is below the SMA line, its color is blue. It is green when the price is above the SMA line. It is yellow in RSI alerts and when the price hits the SMA line.
RSI: default period 14 is set. It can be changed in the settings.
🔨 Hammer Emoji: RSI is located at the overbought turnaround point. This sign does not mean that the trend will definitely return.
🚀Rocket Emoji: Tries to catch the "RSI oversold point turn".This sign does not mean that the trend will definitely return.
↗️↘️Up and Down arrows emojis. After the price crosses the SMA line, it indicates that it is closing a candle in that direction.
Engulfing candles: bullish engulfing candle is blue color. Bear engulfing candle is black in color.colors can be changed in settings.
Note that this indicator is only an indicator. It does not give advice on buying or selling.
Enjoy
TUR: Bu indikatör, fiyat konumuna göre renklendirilmiş SMA çizgisi, RSI ile düşüş veya yükseliş noktalarını belirleme, Engulfing (Yutan) barlar , saat ve mum kapanışı için geri sayım gösteren bilgi paneli içermektedir.
SMA: varsayılan periyodu 50 ayarlıdır. Ayarlardan değiştirebilir.
SMA çizgisi varsayılan renklerinin tanımı: Fiyat SMA çizgisi altında iken rengi mavidir. Fiyat SMA çizgisi üstünde iken yeşildir. RSI uyarılarında ve fiyat SMA çizgisine temas ettiğinde sarı renktedir.
RSI: varsayılan periyodu 14 ayarlanmıştır. Ayarlardan değiştirilebilir.
🔨 Çekiç Emojisi: RSI aşırı alım dönüş noktasında bulunur. Bu işaret trendin kesin döneceği anlamına gelmez.
🚀Roket Emojisi: "RSI aşırı satım noktası dönüşünü "yakalamaya çalışır. Bu işaret trendin kesin döneceği anlamına gelmez.
↗️↘️Yukarı ve Aşağı yönlü okl emojileri. Fiyat SMA çizgisini kestikten sonra, o yönde mum kapattığını gösterir.
Engulfing mumları: bullish engulfing (yutan boğa) mumu mavi renktir. Bear engulfing (yutan ayı) mumu siyah renktir. Renkler ayarlardan değiştirilebilir.
Not: Bu indikatörün yalnızca gösterge olduğunu unutmayın. Alma satma tavsiyesi vermez.
Kalan süre etiketi BIST gibi sınırlı süreli sembollerde, gün ve daha üstü periyotlarda doğru çalışmayabiliyor.
Traders Hedge - Pro with AlertsDear Traders,
"You can't connect the dots looking forward; you can only connect them looking backwards. So you have to trust that the dots will somehow connect in your future." ~Steve Jobs
This quote from Steve Jobs, explains the very essence of this indicator.
Trading is Simple, Why make it complicated. ~ Ravi Chandran
The main motto building this Traders Hedge - Pro indicator is to equip retail traders with a multi purpose tool which in itself will act as a complete trading setup.
This indicator will help you in understanding the market structure and planning your possible entries & exits well in advance.
The indicator & setup is independent of time frames & will work for all trading instruments.
Traders Hedge - Pro Indicator with Alerts you can also set Alerts on your favourite scripts and time frames, to get notification when a Demand or a Supply Zone is created or any Price rejection is formed.
List of all the features is provided below.
1. Trade Type - A quick auto setup for Intraday or Swing trades
2. CPR - Identifies the market structure and helps to plan mean reversions trade setups
3. Weekly Support & Resistance - Automatically identifies and displays the higher time frame support & resistance levels
4. Price Action Triggers - Alert with a trigger symbol shown on the respective candle where a possible price reversal is expected
5. Targets - Plots the possible Major & Minor targets, which helps in planning our possible profit booking & stop loss zones
6. Developing Pivots - Plots the price mean reversion zones for the upcoming trading session
7. Supply & Demand Zones - Plots the demand and supply zones by changing the color of the candle
8. Dynamic Dz & Sz Price Tracking - It dynamically identifies and plots the support & resistance levels
9. Opening Range - Plots the identified opening range on the chart
10. PEMA - Helps in visualizing the trend and also acts as a dynamic support & resistance levels
To set Alerts follow the steps provided below.
1. Go to the symbol chart and select the time frame on which you want to set Alerts.
2. Select Alerts Tab and click on Create Alert, shortcut key Alt+A
3. In Condition Select the option “Price Rejection Alerts“ or “Zone Alerts“ for which you want the alerts to be shown
4. In Options, select Once Per Bar Close
5. Select expiry as per your preference or keep it open-ended
6. Select Alerts Actions as per your preference
7. Alert name is optional
8. Default message is “Price Rejection Alerts“ or “Zone Alert” and can be modified
9. Click on Create and in the warning window select Continue Anyway
How to get the indicator:
To know more about the indicator & to download please check the link in the signature below.
Once you have active alert, you will keep getting notification whenever a Price rejection or new Demand / Supply zone gets created in the identified symbol and time frame you have selected.
Please do feel free to use the indicator and give your valuable feed backs which will help me in optimizing it to a great extent.
I would love to thank each of the traders in this Trading View community in helping me improve on my trading skills.
Happy Trading!
Fiveral: Repulsion/Golden Radio HackAnother in a series of experimental indicators using logarithmic scale visualisation.
This one extends into some work on I've been doing on 'the cube', but Pine isn't liking multiple log lines even when the equations are included for each plotted variable, meaning, no variables used in the definition of a variable, as is done here. As a result, accuracy of this indicator can't be guaranteed between scales, or during use.
Have at it, and enjoy!
Hikkake HunterSimple script for finding Hikkake patterns in charts.
This script will:
- Identify bullish / bearish variants of the Hikkake pattern.
- Allow the user to change the color scheme for the bullish / bearish variants.
- Allow the user to specify which Hikkake patterns will be recognized by this hunter (specifically, allowing which of the three candles after the pattern appears will confirm the pattern).
Replay Mode - Check HTF CandleThis indicator is intended to be used while using Replay Mode.
A vertical line will be drawn when you can safely check the 4H, Daily, or Weekly candle without seeing future price.
It is similar to the built-in Session Breaks, but has the benefit of not needing to remove one candle before checking the Daily.
When the line is the color of your 4H settings, it is safe to check the 4H candle.
When the line is the color of your Daily settings, it is safe to check the 4H and Daily candles.
When the line is the color of your Weekly settings, it is safe to check the 4H, Daily and Weekly candles
Replay Mode - Check Daily/WeeklyThis indicator is intended to be used while using Replay Mode.
It is similar to the built-in Session Breaks, but has the benefit of not needing to remove one candle before checking the Daily.
When on an intraday chart (timeframe less than Daily), a vertical line will be drawn when you can safely check the Daily or Weekly candle without seeing future price.
When the line is the color of your Daily settings, it is safe to check the Daily candle.
When the line is the color of your Weekly settings, it is safe to check both the Daily and Weekly candle.
Performance ComparisonThis script takes two symbols as input and shows the year-to-date (YTD), quarter-to-date (QTD), or month-to-date (MTD) performance in percent.
Gaps % Size DistributionThis tool is to visualize the distribution of gap % sizes, i.e. those things that I marked on the main chart. The tool uses the entire history of an instrument.
The detalization depends on the Binning Step parameter. The lower chart timeframe the lower that step should be.
Good luck.
NVME TP & SL systemNVME TP and SL system is an ATR based risk management tool that is designed to identify possible stop loss and take profit points for you to follow depending on the volume generated by the average true range. Sometimes, they zones may be really close together and this often occurs during a ranging period of the market where there is little movement and this can be fixed if you increase the values on the settings. Moreover, you can input your entry price and what position you are looking for such as a short or a long and then the indicator will generate some zones for you to follow too. The zones will not update after every bar close but instead follow the main setting of bar reset period where the indicator will generate new zones if x bars has passed, default is 20.
Features:
3 Take profit zones ( all customisable: colour, atr multiplier, display toggle on and off )
1 Stop Loss Zone ( all customisable: colour, atr multiplier, display toggle on and off )
Custom Position (Long or Short)
Custom Entry Point (Up to 9 decimal places)
Data Gap PointerUpdating the v3 script made by u/Lemrin + some mods
What this does:
Paints a blue "down arrow" pointer at an intraday bar that has occurred with a skip (e.g. a 1min bar that occurs a few minutes after the previous bar)
Checks for whether the market is open, and only paints arrows if inside open hours (because Extended Hours have lots of bar gaps)
Nifty50 Bullish Bearish Scanner▪ How to use ?
The Screener has 40 stocks which are selected from NSE Nifty50 (list is given below) (cannot be editable) and after 9:15 am IST, it will scan most probable Bullish and Bearish stocks, both stocks will be labelled separately.
▪ Entry may be made at specified near the Stock name and target and SL is also mentioned nearby. Priority to be given to the stop-loss first. User can change profit percentage and Stop-loss percentage as per need, max. 10% can be done, default SL = 0.5% and Profit = 2%. Do use the indicator with other analysis, indicators, strategies, etc. Do not wait for target to hit, also use your calculations to book profit.
▪ How the figures are calculated ?
Conditions for Bullish and Bearish are calculated when trade day starts, and the default timeframe is for 1 Day (i.e.-Current Whole Day)
means the target and stop-loss are for intraday whole day, which can be changed to week, month, etc., Here Entry points are calculated depending upon the current days open price, with consecutive profit and stop-loss are calculated. The Percentage profit and stop-loss are
calculated including previous days price also, confusion to be avoided with figures.
▪ Caution :
If in morning any stock comes in any of list and if it goes from that list, that means the reversal took place for that stock(s) and stop-loss is hit. If any stock is opened Gap-Up or Gap-Down that it will come in either of the Bullish / Bearish stocks, then those stocks maybe
avoided.
▪ Which Nifty50 Stocks are included ?
Top 40 stocks from NSE Nifty50 are selected which are included are below =
ADANIPORTS, ASIANPAINT, AXISBANK, BAJAJ_AUTO, BAJFINANCE, BHARTIARTL, BPCL, BRITANNIA, CIPLA, DIVISLAB, DRREDDY,
EICHERMOT, GRASIM, HCLTECH, HDFC, HDFCBANK, HEROMOTOCO, HINDALCO, HINDUNILVR, ICICIBANK, INDUSINDBK, INFY
ITC, JSWSTEEL, KOTAKBANK, LT, M_M, MARUTI, RELIANCE, SBILIFE, SBIN, SUNPHARMA, TATACONSUM, TATAMOTORS, TATASTEEL
TCS, TECHM, TITAN, UPL, WIPRO.
▪ Indicator options :
Choice to hide bearish / bullish stocks labels, change background color of label, change text color of label, user can change position of label from the current bar, modify stop-loss and profit percentage.
▪ Alerts
You can create an alert from it easily. No additional configuration is required, message and alert on close is used the code.
The current timeframe candle is considered as alerts is set to once per bar close.
▪ Note: The initial load may be slow. If something doesn't seem to work, you can try the following:
- wait more time for it to load.
- hide & show or remove & add back to chart.
- don't add the indicator to chart multiple times in a short amount of time, as you may be rate limited
- Remember that majority of indicators fails in a sideways market, also every indicator is not 100% accurate.
▪ Disclaimer
Please remember that past performance may not be indicative of future results.
Due to various factors, including sudden changing market conditions, the indicator may not perform good.
This description and the indicator don’t provide any financial advice.
Engulfing Empire at over Sold Over <50 Bought >50Shows bulling engulfing patterns only if above >50 rsi and Shows Bearish engulfing patterns only if above <50 rsi
. Very simple.
Indicator Conditions RSI above 50 overbought/below 50 oversold, price is above/below)
Entry Reasons (eg. a bullish or bearish engulfing candle)
RM StratThis is my attempt to code up the rules of "The Strat." I've seen other scripts that do parts of what my script does, but this script combines all of them into one script and allows the user control over how they interact with each other.
What's in this indicator?
Show the Strat Candle Numbers (1 - inside bar, 2 - continuation bar, 3 - outside bar) on the chart.
Show a widget off to the right of the chart for multi-timeframe analysis. This widget tells you whether the D/W/M/Q candles are currently green or red as well as the Candle type (White Circle - (1) Inside Bar, Up Green Arrow - (2U) Continuation Bar, Down Red Arrow - (2D) Continuation Bar, Green/Red Square - (3) Outside Bar)
Integrates the long and short rules into the chart. These can also be turned off if you don't want to see them. Note: this is a simplified version of these rules - if you look at the cheat sheets floating around the internet, you'll notice that all trade initiations occur on a break of the high (for longs) or low (for shorts) of the previous candle as long as that previous candle was not a 2. So that's my only rule for going long or short. I think it matches well with the cheat sheets but is way simpler to code and to think of how it works. The other benefit is it shows you failed trades that the cheat sheet won't catch - where a 2 becomes a 3 in the other direction and stops you out. You'll see that now with this script.
Ability to filter out the long/short rules based on the timeframe continuity of the higher timeframe candles. This is user-configurable so that you can experiment with timeframe continuity and see how strict you want to be with this on your trades.
Show the high/low of the Day, Week, and Month on your chart as horizontal lines that you can use as a reference. This could be used for planning profit targets or seeing how likely a reversal might indicate moving into timeframe continuity.
Open==High, open==lowThis script shows signals based in Open==low or Open==high . You can change candle number, budget and target multiplier .
NVME Market ScannerNVME Market Scanner is a dashboard that scans our preset market pairs to identify the previous signal call made by the Vanquisher X algorithm. It will also tell you whether or not it is a good time to enter based on the buy or sell call being the previous bar of the next candle rather than multiple bars. Furthermore you can choose to remove each section of the dashboard so that it is smaller and you can also create your own market scanner with settings panel. The dashboard is fully customisable and editable.
Note: Due to the retrieval of data from multiple pairs, expect the load time of this indicator to be much slower compared to others!
Pinescript - Common Label & Line Array Functions Library by RRBPinescript - Common Label & Line Array Functions Library by RagingRocketBull 2021
Version 1.0
This script provides a library of common array functions for arrays of label and line objects with live testing of all functions.
Using this library you can easily create, update, delete, join label/line object arrays, and get/set properties of individual label/line object array items.
You can find the full list of supported label/line array functions below.
There are several libraries:
- Common String Functions Library
- Standard Array Functions Library
- Common Fixed Type Array Functions Library
- Common Label & Line Array Functions Library
- Common Variable Type Array Functions Library
Features:
- 30 array functions in categories create/update/delete/join/get/set with support for both label/line objects (45+ including all implementations)
- Create, Update label/line object arrays from list/array params
- GET/SET properties of individual label/line array items by index
- Join label/line objects/arrays into a single string for output
- Supports User Input of x,y coords of 5 different types: abs/rel/rel%/inc/inc% list/array, auto transforms x,y input into list/array based on type, base and xloc, translates rel into abs bar indexes
- Supports User Input of lists with shortened names of string properties, auto expands all standard string properties to their full names for use in functions
- Live Output for all/selected functions based on User Input. Test any function for possible errors you may encounter before using in script.
- Output filters: hide all excluded and show only allowed functions using a list of function names
- Output Panel customization options: set custom style, color, text size, and line spacing
Usage:
- select create function - create label/line arrays from lists or arrays (optional). Doesn't affect the update functions. The only change in output should be function name regardless of the selected implementation.
- specify num_objects for both label/line arrays (default is 7)
- specify common anchor point settings x,y base/type for both label/line arrays and GET/SET items in Common Settings
- fill lists with items to use as inputs for create label/line array functions in Create Label/Line Arrays section
- specify label/line array item index and properties to SET in corresponding sections
- select label/line SET function to see the changes applied live
Code Structure:
- translate x,y depending on x,y type, base and xloc as specified in UI (required for all functions)
- expand all shortened standard property names to full names (required for create/update* from arrays and set* functions, not needed for create/update* from lists) to prevent errors in label.new and line.new
- create param arrays from string lists (required for create/update* from arrays and set* functions, not needed for create/update* from lists)
- create label/line array from string lists (property names are auto expanded) or param arrays (requires already expanded properties)
- update entire label/line array or
- get/set label/line array item properties by index
Transforming/Expanding Input values:
- for this script to work on any chart regardless of price/scale, all x*,y* are specified as % increase relative to x0,y0 base levels by default, but user can enter abs x,price values specific for that chart if necessary.
- all lists can be empty, contain 1 or several items, have the same/different lengths. Array Length = min(min(len(list*)), mum_objects) is used to create label/line objects. Missing list items are replaced with default property values.
- when a list contains only 1 item it is duplicated (label name/tooltip is also auto incremented) to match the calculated Array Length
- since this script processes user input, all x,y values must be translated to abs bar indexes before passing them to functions. Your script may provide all data internally and doesn't require this step.
- at first int x, float y arrays are created from user string lists, transformed as described below and returned as x,y arrays.
- translated x,y arrays can then be passed to create from arrays function or can be converted back to x,y string lists for the create from lists function if necessary.
- all translation logic is separated from create/update/set functions for the following reasons:
- to avoid redundant code/dependency on ext functions/reduce local scopes and to be able to translate everything only once in one place - should be faster
- to simplify internal logic of all functions
- because your script may provide all data internally without user input and won't need the translation step
- there are 5 types available for both x,y: abs, rel, rel%, inc, inc%. In addition to that, x can be: bar index or time, y is always price.
- abs - absolute bar index/time from start bar0 (x) or price (y) from 0, is >= 0
- rel - relative bar index/time from cur bar n (x) or price from y0 base level, is >= 0
- rel% - relative % increase of bar index/time (x) or price (y) from corresponding base level (x0 or y0), can be <=> 0
- inc - relative increment (step) for each new level of bar index/time (x) or price (y) from corresponding base level (x0 or y0), can be <=> 0
- inc% - relative % increment (% step) for each new level of bar index/time (x) or price (y) from corresponding base level (x0 or y0), can be <=> 0
- x base level >= 0
- y base level can be 0 (empty) or open, close, high, low of cur bar
- single item x1_list = "50" translates into:
- for x type abs: "50, 50, 50 ..." num_objects times regardless of xloc => x = 50
- for x type rel: "50, 50, 50 ... " num_objects times => x = x_base + 50
- for x type rel%: "50%, 50%, 50% ... " num_objects times => x_base * (1 + 0.5)
- for x type inc: "0, 50, 100 ... " num_objects times => x_base + 50 * i
- for x type inc%: "0%, 50%, 100% ... " num_objects times => x_base * (1 + 0.5 * i)
- when xloc = xloc.bar_index each rel*/inc* value in the above list is then subtracted from n: n - x to convert rel to abs bar index, values of abs type are not affected
- x1_list = "0, 50, 100, ..." of type rel is the same as "50" of type inc
- x1_list = "50, 50, 50, ..." of type abs/rel/rel% produces a sequence of the same values and can be shortened to just "50"
- single item y1_list = "2" translates into (ragardless of yloc):
- for y type abs: "2, 2, 2 ..." num_objects times => y = 2
- for y type rel: "2, 2, 2 ... " num_objects times => y = y_base + 2
- for y type rel%: "2%, 2%, 2% ... " num_objects times => y = y_base * (1 + 0.02)
- for y type inc: "0, 2, 4 ... " num_objects times => y = y_base + 2 * i
- for y type inc%: "0%, 2%, 4% ... " num_objects times => y = y_base * (1 + 0.02 * i)
- when yloc != yloc.price all calculated values above are simply ignored
- y1_list = "0, 2, 4" of type rel% is the same as "2" with type inc%
- y1_list = "2, 2, 2" of type abs/rel/rel% produces a sequence of the same values and can be shortened to just "2"
- you can enter shortened property names in lists. To lookup supported shortened names use corresponding dropdowns in Set Label/Line Array Item Properties sections
- all shortened standard property names must be expanded to full names (required for create/update* from arrays and set* functions, not needed for create/update* from lists) to prevent errors in label.new and line.new
- examples of shortened property names that can be used in lists: bar_index, large, solid, label_right, white, left, left, price
- expanded to their corresponding full names: xloc.bar_index, size.large, line.style_solid, label.style_label_right, color.white, text.align_left, extend.left, yloc.price
- all expanding logic is separated from create/update* from arrays and set* functions for the same reasons as above, and because param arrays already have different types, implying the use of final values.
- all expanding logic is included in the create/update* from lists functions because it seemed more natural to process string lists from user input directly inside the function, since they are already strings.
Creating Label/Line Objects:
- use study max_lines_count and max_labels_count params to increase the max number of label/line objects to 500 (+3) if necessary. Default number of label/line objects is 50 (+3)
- all functions use standard param sequence from methods in reference, except style always comes before colors.
- standard label/line.get* functions only return a few properties, you can't read style, color, width etc.
- label.new(na, na, "") will still create a label with x = n-301, y = NaN, text = "" because max default scope for a var is 300 bars back.
- there are 2 types of color na, label color requires color(na) instead of color_na to prevent error. text_color and line_color can be color_na
- for line to be visible both x1, x2 ends must be visible on screen, also when y1 == y2 => abs(x1 - x2) >= 2 bars => line is visible
- xloc.bar_index line uses abs x1, x2 indexes and can only be within 0 and n ends, where n <= 5000 bars (free accounts) or 10000 bars (paid accounts) limit, can't be plotted into the future
- xloc.bar_time line uses abs x1, x2 times, can't go past bar0 time but can continue past cur bar time into the future, doesn't have a length limit in bars.
- xloc.bar_time line with length = exact number of bars can be plotted only within bar0 and cur bar, can't be plotted into the future reliably because of future gaps due to sessions on some charts
- xloc.bar_index line can't be created on bar 0 with fixed length value because there's only 1 bar of horiz length
- it can be created on cur bar using fixed length x < n <= 5000 or
- created on bar0 using na and then assigned final x* values on cur bar using set_x*
- created on bar0 using n - fixed_length x and then updated on cur bar using set_x*, where n <= 5000
- default orientation of lines (for style_arrow* and extend) is from left to right (from bar 50 to bar 0), it reverses when x1 and x2 are swapped
- price is a function, not a line object property
Variable Type Arrays:
- you can't create an if/function that returns var type value/array - compiler uses strict types and doesn't allow that
- however you can assign array of any type to another array of any type creating an arr pointer of invalid type that must be reassigned to a matching array type before used in any expression to prevent error
- create_any_array2 uses this loophole to return an int_arr pointer of a var type array
- this works for all array types defined with/without var keyword and doesn't work for string arrays defined with var keyword for some reason
- you can't do this with var type vars, only var type arrays because arrays are pointers passed by reference, while vars are actual values passed by value.
- you can only pass a var type value/array param to a function if all functions inside support every type - otherwise error
- alternatively values of every type must be passed simultaneously and processed separately by corresponding if branches/functions supporting these particular types returning a common single type result
- get_var_types solves this problem by generating a list of dummy values of every possible type including the source type, tricking the compiler into allowing a single valid branch to execute without error, while ignoring all dummy results
Notes:
- uses Pinescript v3 Compatibility Framework
- uses Common String Functions Library, Common Fixed Type Array Functions Library, Common Variable Type Array Functions Library
- has to be a separate script to reduce the number of local scopes/compiled file size, can't be merged with another library.
- lets you live test all label/line array functions for errors. If you see an error - change params in UI
- if you see "Loop too long" error - hide/unhide or reattach the script
- if you see "Chart references too many candles" error - change x type or value between abs/rel*. This can happen on charts with 5000+ bars when a rel bar index x is passed to label.new or line.new instead of abs bar index n - x
- create/update_label/line_array* use string lists, while create/update_label/line_array_from_arrays* use array params to create label/line arrays. "from_lists" is dropped to shorten the names of the most commonly used functions.
- create_label/line_array2,4 are preferable, 5,6 are listed for pure demonstration purposes only - don't use them, they don't improve anything but dramatically increase local scopes/compiled file size
- for this reason you would mainly be using create/update_label/line_array2,4 for list params or create/update_label/line_array_from_arrays2 for array params
- all update functions are executed after each create as proof of work and can be disabled. Only create functions are required. Use update functions when necessary - when list/array params are changed by your script.
- both lists and array item properties use the same x,y_type, x,y_base from common settings
- doesn't use pagination, a single str contains all output
- why is this so complicated? What are all these functions for?
- this script merges standard label/line object methods with standard array functions to create a powerful set of label/line object array functions to simplify manipulation of these arrays.
- this library also extends the functionality of Common Variable Type Array Functions Library providing support for label/line types in var type array functions (any_to_str6, join_any_array5)
- creating arrays from either lists or arrays adds a level of flexibility that comes with complexity. It's very likely that in your script you'd have to deal with both string lists as input, and arrays internally, once everything is converted.
- processing user input, allowing customization and targeting for any chart adds a whole new layer of complexity, all inputs must be translated and expanded before used in functions.
- different function implementations can increase/reduce local scopes and compiled file size. Select a version that best suits your needs. Creating complex scripts often requires rewriting your code multiple times to fit the limits, every line matters.
P.S. Don't rely too much on labels, for too often they are fables.
List of functions*:
* - functions from other libraries are not listed
1. Join Functions
Labels
- join_label_object(label_, d1, d2)
- join_label_array(arr, d1, d2)
- join_label_array2(arr, d1, d2, d3)
Lines
- join_line_object(line_, d1, d2)
- join_line_array(arr, d1, d2)
- join_line_array2(arr, d1, d2, d3)
Any Type
- any_to_str6(arr, index, type)
- join_any_array4(arr, d1, d2, type)
- join_any_array5(arr, d, type)
2. GET/SET Functions
Labels
- label_array_get_text(arr, index)
- label_array_get_xy(arr, index)
- label_array_get_fields(arr, index)
- label_array_set_text(arr, index, str)
- label_array_set_xy(arr, index, x, y)
- label_array_set_fields(arr, index, x, y, str)
- label_array_set_all_fields(arr, index, x, y, str, xloc, yloc, label_style, label_color, text_color, text_size, text_align, tooltip)
- label_array_set_all_fields2(arr, index, x, y, str, xloc, yloc, label_style, label_color, text_color, text_size, text_align, tooltip)
Lines
- line_array_get_price(arr, index, bar)
- line_array_get_xy(arr, index)
- line_array_get_fields(arr, index)
- line_array_set_text(arr, index, width)
- line_array_set_xy(arr, index, x1, y1, x2, y2)
- line_array_set_fields(arr, index, x1, y1, x2, y2, width)
- line_array_set_all_fields(arr, index, x1, y1, x2, y2, xloc, extend, line_style, line_color, width)
- line_array_set_all_fields2(arr, index, x1, y1, x2, y2, xloc, extend, line_style, line_color, width)
3. Create/Update/Delete Functions
Labels
- delete_label_array(label_arr)
- create_label_array(list1, list2, list3, list4, list5, d)
- create_label_array2(x_list, y_list, str_list, xloc_list, yloc_list, style_list, color1_list, color2_list, size_list, align_list, tooltip_list, d)
- create_label_array3(x_list, y_list, str_list, xloc_list, yloc_list, style_list, color1_list, color2_list, size_list, align_list, tooltip_list, d)
- create_label_array4(x_list, y_list, str_list, xloc_list, yloc_list, style_list, color1_list, color2_list, size_list, align_list, tooltip_list, d)
- create_label_array5(x_list, y_list, str_list, xloc_list, yloc_list, style_list, color1_list, color2_list, size_list, align_list, tooltip_list, d)
- create_label_array6(x_list, y_list, str_list, xloc_list, yloc_list, style_list, color1_list, color2_list, size_list, align_list, tooltip_list, d)
- update_label_array2(label_arr, x_list, y_list, str_list, xloc_list, yloc_list, style_list, color1_list, color2_list, size_list, align_list, tooltip_list, d)
- update_label_array4(label_arr, x_list, y_list, str_list, xloc_list, yloc_list, style_list, color1_list, color2_list, size_list, align_list, tooltip_list, d)
- create_label_array_from_arrays2(x_arr, y_arr, str_arr, xloc_arr, yloc_arr, style_arr, color1_arr, color2_arr, size_arr, align_arr, tooltip_arr, d)
- create_label_array_from_arrays4(x_arr, y_arr, str_arr, xloc_arr, yloc_arr, style_arr, color1_arr, color2_arr, size_arr, align_arr, tooltip_arr, d)
- update_label_array_from_arrays2(label_arr, x_arr, y_arr, str_arr, xloc_arr, yloc_arr, style_arr, color1_arr, color2_arr, size_arr, align_arr, tooltip_arr, d)
Lines
- delete_line_array(line_arr)
- create_line_array(list1, list2, list3, list4, list5, list6, d)
- create_line_array2(x1_list, y1_list, x2_list, y2_list, xloc_list, extend_list, style_list, color_list, width_list, d)
- create_line_array3(x1_list, y1_list, x2_list, y2_list, xloc_list, extend_list, style_list, color_list, width_list, d)
- create_line_array4(x1_list, y1_list, x2_list, y2_list, xloc_list, extend_list, style_list, color_list, width_list, d)
- create_line_array5(x1_list, y1_list, x2_list, y2_list, xloc_list, extend_list, style_list, color_list, width_list, d)
- create_line_array6(x1_list, y1_list, x2_list, y2_list, xloc_list, extend_list, style_list, color_list, width_list, d)
- update_line_array2(line_arr, x1_list, y1_list, x2_list, y2_list, xloc_list, extend_list, style_list, color_list, width_list, d)
- update_line_array4(line_arr, x1_list, y1_list, x2_list, y2_list, xloc_list, extend_list, style_list, color_list, width_list, d)
- create_line_array_from_arrays2(x1_arr, y1_arr, x2_arr, y2_arr, xloc_arr, extend_arr, style_arr, color_arr, width_arr, d)
- update_line_array_from_arrays2(line_arr, x1_arr, y1_arr, x2_arr, y2_arr, xloc_arr, extend_arr, style_arr, color_arr, width_arr, d)
Extrema DetectorDetermines local maximums and minimums points in the chart.
Parameters:
lookback : number of candlesticks to look.
extrema_finder_sensivity : If lower, more extreme points will be found (may over-find).
Brief algorithm description:
Computes a Simple Moving Average (length= extrema_finder_sensivity ), and searches for its local extremes.
Given some SMA extreme, it looks the previous extrema_finder_sensivity candlesticks to find the highest (or lowest value).
Notes:
Is a lagged indicator: determining if the current candlestick have reach a maximum can be delayed to, at most extrema_finder_sensivity -further candlesticks.
Gann HiLo Activator [CC]The HiLo Activator was created by W.D. Gann and I was surprised to not see more of his technical indicators on here. I will start adding more of his indicators on here if I get more interest. This is the original version of the indicator that performs like a trailing stop that also works well as a trend line. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators you want me to publish!
LTB Zigzag CirclesHello All,
Today I am here with a new idea and script, " LTB Zigzag Circles ". The idea is to create Circles using last 2 zigzag waves and to catch the breakouts earlier than horizontal lines. if a circle is broken then the script shows entry for Long/Short positions. and if broken circle reappears again then the position is closed. You can change Zigzag period as you wish and see the different results.
Here you can see how the script calculates and draws the Circles:
Below you can see how the script draws part of the circle on each bar:
Optionally the script can show levels:
P.S. I haven't tested it as a strategy, Result and Performance may change by Zigzag period, you need to find best Zigzag period according to your strategy. By the way, my Zigzag Circles idea can be improved, if you have any recommendation let me know please ;)
Enjoy!