Initial Balance |ASE|Introduction 
Initial Balance (IB) refers to the price data that is formed during the first hour of a trading session. It is an important concept in trading as it provides insights into the market's opening sentiment and potential trading opportunities or reversals for the day. There are multiple trading sessions throughout the day. The most popular, the NY Session, is open from 9:30 am to 4:00pm EST making the Initial Balance(IB) range the first hour (9:30-10:30) The other sessions include London, Tokyo, and Sydney.
 IB Customization 
The Initial Balance lines are fully customizable to fit the traders need. 
 Show Initial Balance  
This setting will plot the Initial Balance 
 Fill/Extend IB Range   
The Fill IB Range toggle fills the area in between the IB High and IB Low. Use the IB Fill Color option to change the fill color in the “Line Settings” group on the settings panel.
The Extend IB Range extends the IB lines until the market closes.
 Show 1x/2x Extensions  
The Show 1x Extension toggle displays 1 times the IB range line (IB High - IB Low) above IB High and 1 times the IB range line below IB Low.
The Show 2x Extension toggle displays the 2 times the IB range line (IB High - IB Low) above IB High and 2 times the IB range line below IB Low.
*Use the Extension Level Color in the “Line Settings” to change the color of the lines.
 Show Middle Levels  
The Show Middle Levels toggle shows all the 50% lines between the upper 2x and upper 1x line, upper 1x and IB high, IB high and IB low, IB low and lower 1x line, and the lower 1x and lower 2x line.
*Use the Mid Level Color in the “Line Settings” to change the color of the lines.
 Delete Previous Day’s Levels  
This setting will only show the current day's Initial Balance and delete all previous day levels to produce a clean chart.
 How To Use: 
The Initial Balance Range can support a bias as it shows the opening market sentiment. By watching price action interact with the Initial Balance Range we can watch for indications of trending or failing moves at the high or the low and overall a ranging or trending session. 
The extension levels are projections as to where price could potentially reach in a trending market. If we are bullish and trending higher, we would want to see price reach the first extension, signs of strength at these levels can be used as confirmation to target other levels.
Overall, all these levels can and should be used as support and resistance levels, and as always, can not be used by themselves and require additional confirmation, whether that be an indicator or price action. Below you can see chart examples of these levels in action.
  
   
   
ค้นหาในสคริปต์สำหรับ "order"
Volume / Open Interest "Footprint" - By LeviathanThis script generates a footprint-style bar (profile) based on the aggregated volume or open interest data within your chart's visible range. You can choose from three different heatmap visualizations: Volume Delta/OI Delta, Total Volume/Total OI, and Buy vs. Sell Volume/OI Increase vs. Decrease.
How to use the indicator:
1. Add it to your chart.
2. The script will use your chart's visible range and generate a footprint bar on the right side of the screen. You can move left/right, zoom in/zoom out, and the bar's data will be updated automatically.
Settings:
- Source: This input lets you choose the data that will be displayed in the footprint bar.
- Resolution: Resolution is the number of rows displayed in a bar. Increasing it will provide more granular data, and vice versa. You might need to decrease the resolution when viewing larger ranges.
- Type: Choose between 3 types of visualization: Total (Total Volume or Total Open Interest increase), UP/DOWN (Buy Volume vs Sell Volume or OI Increase vs OI Decrease), and Delta (Buy Volume - Sell Volume or OI Increase - OI Decrease).
- Positive Delta Levels: This function will draw boxes (levels) where Delta is positive. These levels can serve as significant points of interest, S/R, targets, etc., because they mark the zones where there was an increase in buy pressure/position opening.
- Volume Aggregation: You can aggregate volume data from 8 different sources. Make sure to check if volume data is reported in base or quote currency and turn on the RQC (Reported in Quote Currency) function accordingly.
- Other settings mostly include appearance inputs. Read the tooltips for more info.
Multi-Timeframe High Low (@JP7FX)Multi-Timeframe High Low Levels (@JP7FX)  
This Price Action indicator displays high and low levels from a selected timeframe on your current chart. 
These levels  COULD  represent areas of potential liquidity, providing key price points where traders can target entries, reversals, or continuation trades.
 Key Features: 
 
 Display high and low levels from a selected timeframe.
 Customize line width, colors for high and low levels, and label text color.
 Enable or disable the display of high levels, low levels, and labels.
 Receive alerts when the price takes out high or low levels.
 
 How to use: 
It is important to note that using this indicator on it's own is not advisable. Instead, it should be combined with other tools and analysis for a more comprehensive trading strategy.
Possibly look to use my MTF  Supply and Demand  Indicator to look for zones to trade from at these levels? 
If the price breaks above a high level, you might consider entering a long position, with the expectation that the price will continue to rise. Conversely, if the price breaks below a low level, you may think about entering a short position, anticipating further downward movement.
On the other hand, you can also use high or low levels to look for reversal trades, as these areas can represent attractive liquidity zones. 
By identifying these key price points, you could take advantage of potential market reversals and capitalise on new trading opportunities. 
Always remember to use this indicator in conjunction with other technical analysis tools for the best results.
Additionally, you can enable alerts to notify you when the price takes out high or low levels, helping you stay informed about significant price movements.
This indicator could be a valuable tool for traders looking to identify key price points for potential trading opportunities. 
As always with the markets, Trade Safe :)
Commission-aware Trade LabelsCommission-aware Trade Labels 
 Description: 
This library provides an easy way to visualize take-profit and stop-loss levels on your chart, taking into account trading commissions. The library calculates and displays the net profit or loss, along with other useful information such as risk/reward ratio, shares, and position size.
 Features: 
Configurable take-profit and stop-loss prices or percentages.
Set entry amount or shares.
Calculates and displays the risk/reward ratio.
Shows net profit or loss, considering trading commissions.
Customizable label appearance.
 Usage: 
Add the script to your chart.
Create an Order object for take-profit and stop-loss with desired configurations.
Call target_label() and stop_label() methods for each order object.
 Example: 
target_order = Order.new(take_profit_price=27483, stop_loss_price=28000, shares=0.2)
stop_order = Order.new(stop_loss_price=29000, shares=1)
target_order.target_label()
stop_order.stop_label()
This script is a powerful tool for visualizing your trading strategy's performance and helps you make better-informed decisions by considering trading commissions in your profit and loss calculations.
Library   "tradelabels" 
 entry_price(this) 
  Parameters:
     this : Order object
@return entry_price
 take_profit_price(this) 
  Parameters:
     this : Order object
@return take_profit_price
 stop_loss_price(this) 
  Parameters:
     this : Order object
@return stop_loss_price
 is_long(this) 
  Parameters:
     this : Order object
@return entry_price
 is_short(this) 
  Parameters:
     this : Order object
@return entry_price
 percent_to_target(this, target) 
  Parameters:
     this : Order object
     target : Target price
@return percent
 risk_reward(this) 
  Parameters:
     this : Order object
@return risk_reward_ratio
 shares(this) 
  Parameters:
     this : Order object
@return shares
 position_size(this) 
  Parameters:
     this : Order object
@return position_size
 commission_cost(this, target_price) 
  Parameters:
     this : Order object
@return commission_cost
     target_price 
 net_result(this, target_price) 
  Parameters:
     this : Order object
     target_price : The target price to calculate net result for (either take_profit_price or stop_loss_price)
@return net_result
 create_take_profit_label(this, prefix, size, offset_x, bg_color, text_color) 
  Parameters:
     this 
     prefix 
     size 
     offset_x 
     bg_color 
     text_color 
 create_stop_loss_label(this, prefix, size, offset_x, bg_color, text_color) 
  Parameters:
     this 
     prefix 
     size 
     offset_x 
     bg_color 
     text_color 
 create_entry_label(this, prefix, size, offset_x, bg_color, text_color) 
  Parameters:
     this 
     prefix 
     size 
     offset_x 
     bg_color 
     text_color 
 create_line(this, target_price, line_color, offset_x, line_style, line_width, draw_entry_line) 
  Parameters:
     this 
     target_price 
     line_color 
     offset_x 
     line_style 
     line_width 
     draw_entry_line 
 Order 
  Order
  Fields:
     entry_price : Entry price
     stop_loss_price : Stop loss price
     stop_loss_percent : Stop loss percent, default 2%
     take_profit_price : Take profit price
     take_profit_percent : Take profit percent, default 6%
     entry_amount : Entry amount, default 5000$
     shares : Shares
     commission : Commission, default 0.04%
support and resistance on multi timeframe [parsimaj] Description:
support and resistance and trendline on two timeframes  by your choice
This indicator is capable of showing you the current and higher timeframe support and resistance by your strategy choice (two timeframes alongside each other). It also helps you to monitor the trend direction in short and long term by trend lines . You can change the depth of every levels and trend lines from the panel. Use this indicator in all markets because it follows the basic principles of levels but is unique in changing second timeframe by your choice.
_its smart , if the levels are too close together ,it will choose the deeper ones for you.
How it works:
By default, there is no higher timeframe and you can select your desire higher timeframe from the panel. Higher timelines will be displayed thicker and your current levels would be thin lines. (Levels that are higher than the current price will be red and those that are lower will be green). The number of levels to display is also by your choice, the default is 4 levels for each timeframe.
We have two types of trend lines , long terms as trend 1 (blue below and purple above trend line )- short term as trend 2(dashed ones).
Bouncing on levels and breaking trend line are the best triggers for entry and exit points.
Setting:
First, choose your higher timeframe then the depth of levels for each time (current and higher), The deeper it is, the more precise the lines. After that you can set the depth of trend lines by your choice. Trend 1 is the longer term So put it deeper and then set the short trend line (dashed ones) if you want to change it.
We have put the settings in the best mode, but you can also change it according to your strategy and inform us about the results.
This indicator has been obtained with hours of effort and codding , hope you enjoy 
[JL] Fractals ATR BlockI decided to combine Fractal ROC , ATR Break, and Order Blocks to an Indicator
The Fractal ROC , ATR Break, and Order Blocks indicator combines three concepts to help traders identify potential trade opportunities and manage risk. By using a combination of Fractal ROC , ATR Break, and Order Blocks, traders can gain a deeper understanding of market dynamics and make more informed trading decisions.
Fractal ROC is a momentum-based indicator that calculates the rate of change of the price between fractals, which are turning points in the market. It is calculated by taking the difference between the closing price and the lowest price in the previous n+1 periods, and dividing it by the difference between the open price 2n periods ago and the lowest price in the previous n+1 periods. This calculation is done for both up and down fractals. When the Fractal ROC value is greater than the ROC Break Level (as determined by the input variable roclevel), it indicates a potential momentum shift in the market. This can be used to identify potential trade entries or exits, depending on your trading strategy.
  
ATR Break is an indicator that helps traders identify significant price movements in the market. It measures the distance between the price and the Average True Range (ATR), which is a measure of the volatility of the market. ATR Break is calculated by taking the difference between the close and high/low, and dividing it by the previous ATR value. This calculation is done for both up and down movements. When the ATR Break value is greater than the ATR Break Level (as determined by the input variable atrlevel), it indicates a significant move in the market. This can be used to identify potential breakouts or breakdowns, and can be used to set stop-loss and take-profit levels.
  
An Order Block is a price level where significant buying or selling activity has taken place. The order blocks made by ATR Break and Fractal ROC are drawn using boxes on the chart. When the ATR or Fractal ROC level is breached, a box is drawn with the high and low of the candle that breached the level as the top and bottom of the box, respectively. The box is then extended to the right until the end of the chart or until another ATR or Fractal ROC level is breached, at which point a new box is drawn. This allows traders to easily identify significant price movements and potential support and resistance levels on the chart. When an Order Block is identified, it can be used as a potential support or resistance level . If price approaches an Order Block from below, it is likely to bounce off this level and continue in an upward direction. Similarly, if price approaches an Order Block from above, it is likely to bounce off this level and continue in a downward direction. Traders can use these levels to identify potential trade entries or exits, as well as to set stop-loss and take-profit levels.
  
Overall, the Fractal ROC , ATR Break, and Order Blocks indicator is a powerful tool for traders who want to identify potential trade opportunities and manage risk. By combining these three concepts, traders can gain a deeper understanding of market dynamics and make more informed trading decisions. As with any indicator, it is important to use it in conjunction with other analysis tools and to have a clear trading plan in place.
Weis V5 zigzag jayySomehow, I deleted version 5 of the zigzag script.  Same name.  I have added some older notes describing how the Weis Wave works.
I have also changed the date restriction that stopped the script from working after Dec 31, 2022.
What you see here is the Weis zigzag wave plotted directly on the price chart.  This script is the companion to the Weis cumulative wave volume script.
 What is a Weis wave?  David Weis has been recognized as a Wyckoff method analyst he has written two books one of which, Trades About to Happen, describes the evolution of the now-popular Weis wave.  The method employed by Weis is to identify waves of price action and to compare the strength of the waves on characteristics of wave strength.  Chief among the characteristics of strength is the cumulative volume of the wave.  There are other markers that Weis uses as well for example how the actual price difference between the start of the Weis wave from start to finish.  Weis also uses time, particularly when using a Renko chart 
David Weis did a futures  io video which is a popular source of information about his method. (Search David Weis and futures.io.  I strongly suggest you also read “Trades About to Happen” by David Weis.
This will get you up and running more quickly when studying charts.  However, you should choose the Traditional method to be true to David Weis technique as described in his book "Trades About to Happen" and in the Futures IO Webcast featuring David Weis
 .  The Weis pip zigzag wave shows how far in terms of bar close price a Weis wave has traveled through the duration of a Weis wave.  The Weis zigzag wave is used in combination with the Weis cumulative volume wave.  The two waves should be set to the same "wave size".
To use this script, you must set the wave size: Using the traditional Weis method simply enter the desired wave size in the box "How should wave size be calculated", in this example I am using a traditional wave size of .25.  Each wave for each security and each timeframe requires its own wave size.  Although not the traditional method devised by David Weis a more automatic way to set wave size would be to use Average True Range (ATR).  Using ATR is not the true Weis method but it does give you similar waves and, importantly, without the hassle described above. Once the Weis wave size is set then the zigzag wave will be shown with volume. Because Weis used the closing price of a wave to define waves a line Bar highs and bar lows are not captured by the Weis Wave.  The default script setting is now cumulative volume waves using an ATR of 7 and a multiplication factor of .5.  
To display volume in a way that does not crowd out neighbouring volumes Weis displayed volume as a maximum of 3 digits (usually).  Consider two Weis Wave volumes 176,895,570 and 2,654,763,889. To display wave volume as three digits it is necessary to take a number such as 176,895,570 and truncate it.  176,895,570 can be represented as 177 X 10 to the power of 6.  The number displayed must also be relative to other numbers in the field. If the highest volume on the page is: 2,654,763,889 and with only three numbers available to display the result the value shown must be 265 (265 X 10 to the power of 7).  Since 176,895,570 is an order of magnitude smaller than 2,654,763,889 therefore 175,895,570 must be shown as 18 instead of 177.  In this way, the relative magnitudes of the two volumes can be understood. All numbers in the field of view must be truncated by the same order of magnitude to make the relative volumes understandable. The script attempts to calculate the order of magnitude value automatically. If you see a red number in the field of view it means the script has failed to do the calculation automatically and you should use the manual method – use the dialogue box “Calculate truncated wave value automatically or manually”.  Scroll down from the automatic method and select manual.  Once "manual" is selected the values displayed become the power values or multipliers for each wave.
Using the manual method you will select a “Multiplier” in the next dialogue box.  Scan the field and select the largest value in the field of view (visible chart) is the multiplier of interest.  If you select a lower number than the maximum value will see at least one red “up”.  If you are too high you will see at least one red “down”.  Scroll in the direction recommended or the values on the screen will be totally incorrect. With volume truncated to the highest order values, the eye can quickly get a feel for relative volumes. It also reduces the crowding and overlapping of values on the screen.  You can opt to show the full volume to help get a sense of the magnitude of the true volumes.
How does the script determine if a Weis wave is continuing to grow or not?
The script evaluates the closing price of each new bar relative to the "Weis wave size".  Suppose the current bar closes at a new low close, within the current down wave, at $30.00. If the Weis wave size is $0.10 then the algorithm will remember the $30.00 close and compare it to the close of the next bar.  If the bar close price does not close equal to or lower than $30.00 or close equal to or higher than $30.10 then the wave is still a down wave with a current low of $30.00.  This is true even if the bar low is less than $30.00 or the bar high is greater than 30.10 – only the bar’s closing price matters.  If a bar's closing price climbs back up to a close of $30.11 then because the closing price has moved more than $0.10 (the Weis wave size) then that is a wave reversal with a new up-trending wave.  In the above example if there was currently a downward trending wave and the bar closes were as follows $30.00, $30.09, $30.01, $30.05, $30.10 The wave direction would continue to stay downward trending until the close of $30.10 was achieved.  As such $30.00 would be the low and the following closes $30.09, $30.01, $30.05 would be allocated to the new upward-trending wave. If however There was a series of bar closes like this $30.00, $30.09, $30.01, $30.05, $29.99 since none of the closes was equal to above the 10-cent reversal target of $30.10 but instead, a new Weis wave low was achieved  ($29.99).  As such the closes of  $30.09, $30.01, $30.05 would all be attributed to the continued down-trending wave with a current low of $29.99, even though the closing price for the interim bars was above $30.00.  Now that the Weis Wave low is now 429.99 then, in order to reverse this continued downtrend price will need to close at or above $30.09 on subsequent bar closes assuming now new low bar close is achieved.  With large wave sizes, wave direction can be in limbo for many bars before a close either renews wave direction or reverses it and confirms wave direction as either a reversal or a continuation. On the zig-zag, a wave line and its volume will not be "printed" until a wave reversal is confirmed. 
The wave attribution is similar when using other methods to define wave size. If ATR is used for wave size instead of a traditional wave constant size such as $0.10 or $2 or 2000 pips or ... then the wave size is calculated based on current ATR instead of the Weis wave constant (Traditional selected value).
I have the option to display pseudo-Ord volume.  In truth, Ord used more traditional zig-zag pivots of bar highs and lows. Waves using closes as pivots can have some significant differences.  This difference can be lessened by using smaller time frames and larger wave sizes.
There are other options such to display the delta price or pip size of a Weis Wave, the number of bars in a wave, and a few other options.
Session LiquidityThe “Session Liquidity” TradingView indicator by Infinity Trading creates dynamic horizontal lines at the high and low points of a specified time span within the trading day. This indicator gives the user control of three separate time spans so the user can dynamically see the highs and lows of their favorite daily time spans. 
 Purpose 
This indicator is similar to my TradingView indicator “Futures Exchange Sessions 3.0”. In that indicator the user gets control of dynamic price boxes. For me, these boxes made it difficult to spot ICT’s Orderblocks. So instead of boxes I made independently controllable lines and now I can spot ICT Orderblocks and easily identify Liquidity Pools. 
 Inputs and Style 
Everything about the three dynamic lines can but independently configured. Start & End Times, Line Color, Line Style, Line Width, Text Characters, Text Size, Text Color can all be adjusted. The high and low lines as well as their text labels can be individually toggled on or off for maximum control. 
 Timezone 
All of the start and end times are in EST. Additionally, each time span line needs a specific start of each day. This is controlled by a setting called “Line Start Day Timezone” where the user sets a timezone that corresponds with the start time. In general if a timespan resides within a particular Session pick the corresponding timezone. If the users line fits in the Asian Session then choose Asia/Shanghai. If the line is within the London Session then choose Europe/London. And the same goes for the New York Session.
 Special Notes 
 
  If the Line Start Time is within one candle of the Start Day Timezone in the Settings, then the line/box won’t display. So choose the previous timezone
  Lines only display when the timeframe is <= 30 minute
 
 Gallery 
  
  
 
BIAS NotesUsage:  This indicator allows you to note on your desired pair what is the current state of the trends.
!!  How to use:  You have to input the values for each table case to your desire in the indicator settings. !!
 With this indicator you can note :
-what is the timeframe Bias
-which supply or demand we`ve just hit
I use this as a tool for my analysis with Insitutional Orderflow/SMC (Smart Money Concepts).
RSI Buy & Sell Trading ScriptThis is my first attempt at a trading script using the RSI indicator for Buy & Sell signals (so please be nice but would appreciate any constructive comments).
Starting with $100 initial capital and using 10% per trade
You can select which month the backtesting starts 
There is also a monthly table (sorry can’t remember who I got this from) that shows the total monthly profits, but you’ll need to turn it on by going into settings, Properties and in the Recalculate section tick the “On every tick” box
 
It should do the following:
Open Buy order if the RSI > 68 and the current Moving Average is greater than the previous Moving average
•	TP1 = 50% of Order at 0.4%
•	TP2 = 50% of order at 0.8%
•	SL = 2% below entry
•	Close Buy order if the RSI < 30
Open Sell order if the RSI < 28 and the current Moving Average is less than the previous Moving average
•	TP1 = 50% of Order at 0.4%
•	TP2 = 50% of order at 0.8%
•	SL = 2% above entry
•	Close Buy order if the RSI < 60
I would like to build on this if you have any ideas/ code that could help like the following:
•	Move the SL to break even when it hits TP1
•	Move the SL to TP1 when TP2 hits
•	Moving take profit code so I can let the some of the trade stay in play (activate if it hits 1% profit and close trade if price retracts 0.5%)
Black Scholes Option Pricing Model w/ Greeks [Loxx]The Black Scholes Merton model 
If you are new to options I strongly advise you to profit from  Robert Shiller's lecture on same . It combines practical market insights with a strong authoritative grasp of key models in option theory. He explains many of the areas covered below and in the following pages with a lot intuition and relatable anecdotage. We start here with Black Scholes Merton which is probably the most popular option pricing framework, due largely to its simplicity and ease in terms of implementation. The closed-form solution is efficient in terms of speed and always compares favorably relative to any numerical technique.  The Black–Scholes–Merton model  is a mathematical go-to model for estimating the value of European calls and puts. In the early 1970’s, Myron Scholes, and Fisher Black made an important breakthrough in the pricing of complex financial instruments. Robert Merton simultaneously was working on the same problem and applied the term Black-Scholes model to describe new generation of pricing. The Black Scholes (1973) contribution developed insights originally proposed by Bachelier 70 years before. In 1997, Myron Scholes and Robert Merton received the Nobel Prize for Economics. Tragically, Fisher Black died in 1995. The Black–Scholes formula presents a theoretical estimate (or model estimate) of the price of European-style options independently of the risk of the underlying security. Future payoffs from options can be discounted using the risk-neutral rate. Earlier academic work on options (e.g., Malkiel and Quandt 1968, 1969) had contemplated using either empirical, econometric analyses or elaborate theoretical models that possessed parameters whose values could not be calibrated directly. In contrast, Black, Scholes, and Merton’s parameters were at their core simple and did not involve references to utility or to the shifting risk appetite of investors. Below, we present a standard type formula, where: c = Call option value, p = Put option value, S=Current stock (or other underlying) price, K or X=Strike price, r=Risk-free interest rate, q = dividend yield, T=Time to maturity and N denotes taking the normal cumulative probability. b = (r - q) = cost of carry. (via  VinegarHill-Financelab )
 Things to know 
 
 This can only be used on the daily timeframe
 You must select the option type and the greeks you wish to show
 This indicator is a work in process, functions may be updated in the future. I will also be adding additional greeks as I code them or they become available in finance literature. This indictor contains 18 greeks. Many more will be added later.
 
 Inputs 
 
 Spot price: select from 33 different types of price inputs
 Calculation Steps: how many iterations to be used in the BS model. In practice, this number would be anywhere from 5000 to 15000, for our purposes here, this is limited to 300
 Strike Price: the strike price of the option you're wishing to model
 % Implied Volatility: here you can manually enter implied volatility
 Historical Volatility Period: the input period for historical volatility ; historical volatility isn't used in the BS process, this is to serve as a sort of benchmark for the implied volatility ,
 Historical Volatility Type: choose from various types of implied volatility , search my indicators for details on each of these
 Option Base Currency: this is to calculate the risk-free rate, this is used if you wish to automatically calculate the risk-free rate instead of using the manual input. this uses the 10 year bold yield of the corresponding country
 % Manual Risk-free Rate: here you can manually enter the risk-free rate
 Use manual input for Risk-free Rate? : choose manual or automatic for risk-free rate
 % Manual Yearly Dividend Yield: here you can manually enter the yearly dividend yield
 Adjust for Dividends?: choose if you even want to use use dividends
 Automatically Calculate Yearly Dividend Yield? choose if you want to use automatic vs manual dividend yield calculation
 Time Now Type: choose how you want to calculate time right now, see the tool tip
 Days in Year: choose how many days in the year, 365 for all days, 252 for trading days, etc
 Hours Per Day: how many hours per day? 24, 8 working hours, or 6.5 trading hours
 Expiry date settings: here you can specify the exact time the option expires
 
 The Black Scholes Greeks 
The Option Greek formulae express the change in the option price with respect to a parameter change taking as fixed all the other inputs. ( Haug explores multiple  parameter changes at once .) One significant use of Greek measures is to calibrate risk exposure. A market-making financial institution with a portfolio of options, for instance, would want a snap shot of its exposure to asset price, interest rates, dividend fluctuations. It would try to establish impacts of volatility and time decay. In the formulae below, the Greeks merely evaluate change to only one input at a time. In reality, we might expect a conflagration of changes in interest rates and stock prices etc. (via  VigengarHill-Financelab )
 First-order Greeks 
 Delta:   Delta measures the rate of change of the theoretical option value with respect to changes in the underlying asset's price. Delta is the first derivative of the value 
 Vega:   Vegameasures sensitivity to volatility. Vega is the derivative of the option value with respect to the volatility of the underlying asset.
 Theta:  Theta measures the sensitivity of the value of the derivative to the passage of time (see Option time value): the "time decay."
 Rho:   Rho measures sensitivity to the interest rate: it is the derivative of the option value with respect to the risk free interest rate (for the relevant outstanding term).
 Lambda:   Lambda, Omega, or elasticity is the percentage change in option value per percentage change in the underlying price, a measure of leverage, sometimes called gearing.
 Epsilon:   Epsilon, also known as psi, is the percentage change in option value per percentage change in the underlying dividend yield, a measure of the dividend risk. The dividend yield impact is in practice determined using a 10% increase in those yields. Obviously, this sensitivity can only be applied to derivative instruments of equity products.
 Second-order Greeks 
 Gamma:   Measures the rate of change in the delta with respect to changes in the underlying price. Gamma is the second derivative of the value function with respect to the underlying price.
 Vanna:   Vanna, also referred to as DvegaDspot and DdeltaDvol, is a second order derivative of the option value, once to the underlying spot price and once to volatility. It is mathematically equivalent to DdeltaDvol, the sensitivity of the option delta with respect to change in volatility; or alternatively, the partial of vega with respect to the underlying instrument's price. Vanna can be a useful sensitivity to monitor when maintaining a delta- or vega-hedged portfolio as vanna will help the trader to anticipate changes to the effectiveness of a delta-hedge as volatility changes or the effectiveness of a vega-hedge against change in the underlying spot price.
 Charm:   Charm or delta decay  measures the instantaneous rate of change of delta over the passage of time.
 Vomma:   Vomma, volga, vega convexity, or DvegaDvol measures second order sensitivity to volatility. Vomma is the second derivative of the option value with respect to the volatility, or, stated another way, vomma measures the rate of change to vega as volatility changes.
 Veta:   Veta or DvegaDtime measures the rate of change in the vega with respect to the passage of time. Veta is the second derivative of the value function; once to volatility and once to time.
 Vera:  Vera (sometimes rhova) measures the rate of change in rho with respect to volatility. Vera is the second derivative of the value function; once to volatility and once to interest rate.
 Third-order Greeks 
 Speed:   Speed measures the rate of change in Gamma with respect to changes in the underlying price.
 Zomma:   Zomma measures the rate of change of gamma with respect to changes in volatility.
 Color:   Color, gamma decay or DgammaDtime measures the rate of change of gamma over the passage of time.
 Ultima:   Ultima measures the sensitivity of the option vomma with respect to change in volatility.
 Dual Delta:   Dual Delta determines how the option price changes in relation to the change in the option strike price; it is the first derivative of the option price relative to the option strike price
 Dual Gamma:  Dual Gamma determines by how much the coefficient will changedual delta when the option strike price changes; it is the second derivative of the option price relative to the option strike price.
 Related Indicators 
 Cox-Ross-Rubinstein Binomial Tree Options Pricing Model  
  
 Implied Volatility Estimator using Black Scholes  
  
 Boyle Trinomial Options Pricing Model  
 
Variety, Low-Pass, FIR Filter Impulse Response Explorer [Loxx]Variety Low-Pass FIR Filter, Impulse Response Explorer   is a simple impulse response explorer of 16 of the most popular FIR digital filtering windowing techniques. Y-values are the values of the coefficients produced by the selected algorithms; X-values are the index of sample. This indicator also allows you to turn on Sinc Windowing for all window types except for Rectangular, Triangular, and Linear. This is an educational indicator to demonstrate the differences between popular FIR filters in terms of their coefficient outputs. This is also used to compliment other indicators I've published or will publish that implement advanced FIR digital filters (see below to find applicable indicators).
 Inputs:  
 
 Number of Coefficients to Calculate = Sample size; for example, this would be the period used in SMA or WMA
 FIR Digital Filter Type = FIR windowing method you would like to explore
 Multiplier (Sinc only) = applies a multiplier effect to the Sinc Windowing
 Frequency Cutoff = this is necessary to smooth the output and get rid of noise. the lower the number, the smoother the output. 
 Turn on Sinc? = turn this on if you want to convert the windowing function from regular function to a Windowed-Sinc filter
 Order = This is used for power of cosine filter only. This is the N-order, or depth, of the filter you wish to create.
 
 What are FIR Filters? 
In discrete-time signal processing, windowing is a preliminary signal shaping technique, usually applied to improve the appearance and usefulness of a subsequent Discrete Fourier Transform. Several window functions can be defined, based on a constant (rectangular window), B-splines, other polynomials, sinusoids, cosine-sums, adjustable, hybrid, and other types. The windowing operation consists of multipying the given sampled signal by the window function. For trading purposes, these FIR filters act as advanced weighted moving averages.
A finite impulse response (FIR) filter is a filter whose impulse response (or response to any finite length input) is of finite duration, because it settles to zero in finite time. This is in contrast to infinite impulse response (IIR) filters, which may have internal feedback and may continue to respond indefinitely (usually decaying).
The impulse response (that is, the output in response to a Kronecker delta input) of an Nth-order discrete-time FIR filter lasts exactly {\displaystyle N+1}N+1 samples (from first nonzero element through last nonzero element) before it then settles to zero.
FIR filters can be discrete-time or continuous-time, and digital or analog.
A FIR filter is (similar to, or) just a weighted moving average filter, where (unlike a typical equally weighted moving average filter) the weights of each delay tap are not constrained to be identical or even of the same sign. By changing various values in the array of weights (the impulse response, or time shifted and sampled version of the same), the frequency response of a FIR filter can be completely changed.
An FIR filter simply CONVOLVES the input time series (price data) with its IMPULSE RESPONSE. The impulse response is just a set of weights (or "coefficients") that multiply each data point. Then you just add up all the products and divide by the sum of the weights and that is it; e.g., for a 10-bar SMA you just add up 10 bars of price data (each multiplied by 1) and divide by 10. For a weighted-MA you add up the product of the price data with triangular-number weights and divide by the total weight.
 What's a Low-Pass Filter? 
A low-pass filter is the type of frequency domain filter that is used for smoothing sound, image, or data. This is different from a high-pass filter that is  used for sharpening data, images, or sound. 
 Whats a Windowed-Sinc Filter?  
Windowed-sinc filters are used to separate one band of frequencies from another. They are very stable, produce few surprises, and can be pushed to incredible performance levels. These exceptional frequency domain characteristics are obtained at the expense of poor performance in the time domain, including excessive ripple and overshoot in the step response. When carried out by standard convolution, windowed-sinc filters are easy to program, but slow to execute.
The sinc function sinc (x), also called the "sampling function," is a function that arises frequently in signal processing and the theory of Fourier transforms.
In mathematics, the historical unnormalized sinc function is defined for x ≠ 0 by
sinc x = sinx / x
In digital signal processing and information theory, the normalized sinc function is commonly defined for x ≠ 0 by
sinc x = sin(pi * x) / (pi * x)
For our purposes here, we are used a normalized Sinc function
 Included Windowing Functions 
 
 N-Order Power-of-Cosine (this one is really N-different types of FIR filters)
 Hamming
 Hanning
 Blackman
 Blackman Harris
 Blackman Nutall
 Nutall
 Bartlet Zero End Points
 Bartlet-Hann
 Hann
 Sine
 Lanczos
 Flat Top
 Rectangular
 Linear
 Triangular
 
If you wish to dive deeper to get a full explanation of these windowing functions, see here:  en.wikipedia.org 
 Related indicators  
STD-Filtered, Variety FIR Digital Filters w/ ATR Bands   
  
STD/C-Filtered, N-Order Power-of-Cosine FIR Filter   
  
STD/C-Filtered, Truncated Taylor Family FIR Filter  
  
STD/Clutter-Filtered, Kaiser Window FIR Digital Filter  
  
STD/Clutter Filtered, One-Sided, N-Sinc-Kernel, EFIR Filt  
 
Ehlers Two-Pole Predictor [Loxx]Ehlers Two-Pole Predictor is a new indicator by John Ehlers . The translation of this indicator into PineScript™ is a collaborative effort between @cheatcountry and I.
The following is an excerpt from  "PREDICTION" , by John Ehlers
Niels Bohr said “Prediction is very difficult, especially if it’s about the future.”. Actually, prediction is pretty easy in the context of technical analysis . All you have to do is to assume the market will behave in the immediate future just as it has behaved in the immediate past. In this article we will explore several different techniques that put the philosophy into practice.
 LINEAR EXTRAPOLATION 
Linear extrapolation takes the philosophical approach quite literally. Linear extrapolation simply takes the difference of the last two bars and adds that difference to the value of the last bar to form the prediction for the next bar. The prediction is extended further into the future by taking the last predicted value as real data and repeating the process of adding the most recent difference to it. The process can be repeated over and over to extend the prediction even further.
Linear extrapolation is an FIR filter, meaning it depends only on the data input rather than on a previously computed value. Since the output of an FIR filter depends only on delayed input data, the resulting lag is somewhat like the delay of water coming out the end of a hose after it supplied at the input. Linear extrapolation has a negative group delay at the longer cycle periods of the spectrum, which means water comes out the end of the hose before it is applied at the input. Of course the analogy breaks down, but it is fun to think of it that way. As shown in Figure 1, the actual group delay varies across the spectrum. For frequency components less than .167 (i.e. a period of 6 bars) the group delay is negative, meaning the filter is predictive. However, the filter has a positive group delay for cycle components whose periods are shorter than 6 bars.
Figure 1
  
Here’s the practical ramification of the group delay: Suppose we are projecting the prediction 5 bars into the future. This is fine as long as the market is continued to trend up in the same direction. But, when we get a reversal, the prediction continues upward for 5 bars after the reversal. That is, the prediction fails just when you need it the most. An interesting phenomenon is that, regardless of how far the extrapolation extends into the future, the prediction will always cross the signal at the same spot along the time axis. The result is that the prediction will have an overshoot. The amplitude of the overshoot is a function of how far the extrapolation has been carried into the future.
But the overshoot gives us an opportunity to make a useful prediction at the cyclic turning point of band limited signals (i.e. oscillators having a zero mean). If we reduce the overshoot by reducing the gain of the prediction, we then also move the crossing of the prediction and the original signal into the future. Since the group delay varies across the spectrum, the effect will be less effective for the shorter cycles in the data. Nonetheless, the technique is effective for both discretionary trading and automated trading in the majority of cases.
 EXPLORING THE CODE 
Before we predict, we need to create a band limited indicator from which to make the prediction. I have selected a “roofing filter” consisting of a High Pass Filter followed by a Low Pass Filter. The tunable parameter of the High Pass Filter is HPPeriod. Think of it as a “stone wall filter” where cycle period components longer than HPPeriod are completely rejected and cycle period components shorter than HPPeriod are passed without attenuation. If HPPeriod is set to be a large number (e.g. 250) the indicator will tend to look more like a trending indicator. If HPPeriod is set to be a smaller number (e.g. 20) the indicator will look more like a cycling indicator. The Low Pass Filter is a Hann Windowed FIR filter whose tunable parameter is LPPeriod. Think of it as a “stone wall filter” where cycle period components shorter than LPPeriod are completely rejected and cycle period components longer than LPPeriod are passed without attenuation. The purpose of the Low Pass filter is to smooth the signal. Thus, the combination of these two filters forms a “roofing filter”, named Filt, that passes spectrum components between LPPeriod and HPPeriod.
Since working into the future is not allowed in EasyLanguage variables, we need to convert the Filt variable to the data array XX. The data array is first filled with real data out to “Length”. I selected Length = 10 simply to have a convenient starting point for the prediction. The next block of code is the prediction into the future. It is easiest to understand if we consider the case where count = 0. Then, in English, the next value of the data array is equal to the current value of the data array plus the difference between the current value and the previous value. That makes the prediction one bar into the future. The process is repeated for each value of count until predictions up to 10 bars in the future are contained in the data array. Next, the selected prediction is converted from the data array to the variable “Prediction”. Filt is plotted in Red and Prediction is plotted in yellow.
The Predict Extrapolation indicator is shown below for the Emini S&P Futures contract using the default input parameters. Filt is plotted in red and Predict is plotted in yellow. The crossings of the Predict and Filt lines provide reliable buy and sell timing signals. There is some overshoot for the shorter cycle periods, for example in February and March 2021, but the only effect is a late timing signal. Further reducing the gain and/or reducing the BarsFwd inputs would provide better timing signals during this period.
Figure 2.  Predict Extrapolation Provides Reliable Timing Signals
  
I have experimented with other FIR filters for predictions, but found none that had a significant advantage over linear extrapolation.
 MESA 
MESA is an acronym for Maximum Entropy Spectral Analysis.  Conceptually, it removes spectral components until the residual is left with maximum entropy.  It does this by forming an all-pole filter whose order is determined by the selected number of coefficients.  It maximally addresses the data within the selected window and ignores all other data.  Its resolution is determined only by the number of filter coefficients selected.  Since the resulting filter is an IIR filter, a prediction can be formed simply by convolving the filter coefficients with the data.  MESA is one of the few, if not the only way to practically determine the coefficients of a higher order IIR filter.  Discussion of MESA is beyond the scope of this article.
 TWO POLE IIR FILTER 
While the coefficients of a higher order IIR filter are difficult to compute without MESA, it is a relatively simple matter to compute the coefficients of a two pole IIR filter.
(Skip this paragraph if you don’t care about DSP)  We can locate the conjugate pole positions parametrically in the Z plane in polar coordinates.  Let the radius be QQ and the principal angle be 360 / P2Period.  The first order component is 2*QQ*Cosine(360 / P2Period) and the second order component is just QQ2.  Therefore, the transfer response becomes:
	H(z) = 1 / (1 - 2*QQ*Cosine(360 / P2Period)*Z-1 + QQ2*Z-2)
	By mixing notation we can easily convert the transfer response to code.
	Output / Input = 1 / (1 - 2*QQ*Cosine(360 / P2Period)*  + QQ2* )
	Output - 2*QQ*Cosine(360 / P2Period)*Output  + QQ2*Output  = Input
	Output = Input + 2*QQ*Cosine(360 / P2Period)*Output  - QQ2*Output 
The Two Pole Predictor starts by computing the same “roofing filter” design as described for the Linear Extrapolation Predictor.  The HPPeriod and LPPeriod inputs adjust the roofing filter to obtain the desired appearance of an indicator.  Since EasyLanguage variables cannot be extended into the future, the prediction process starts by loading the XX  data array with indicator data up to the value of Length.  I selected Length = 10 simply to have a convenient place from which to start the prediction.  The coefficients are computed parametrically from the conjugate pole positions and are normalized to their sum so the IIR filter will have unity gain at zero frequency.
The prediction is formed by convolving the IIR filter coefficients with the historical data.  It is easiest to see for the case where count = 0.  This is the initial prediction.  In this case the new value of the XX  array is formed by successively summing the product of each filter coefficient with its respective historical data sample.  This process is significantly different from linear extrapolation because second order curvature is introduced into the prediction rather than being strictly linear.  Further, the prediction is adaptive to market conditions because the degree of curvature depends on recent historical data.  The prediction in the data array is converted to a variable by selecting the BarsFwd value.  The prediction is then plotted in yellow, and is compared to the indicator plotted in red.
The Predict 2 Pole indicator is shown above being applied to the Emini S&P Futures contract for most of 2021.  The default parameters for the roofing filter and predictor were used.  By comparison to the Linear Extrapolation prediction of Figure 2, the Predict 2 Pole indicator has a more consistent prediction.  For example, there is little or no overshoot in February or March while still giving good predictions in April and May.
Input parameters can be varied to adjust the appearance of the prediction.  You will find that the indicator is relatively insensitive to the BarsFwd input.  The P2Period parameter primarily controls the gain of the prediction and the QQ parameter primarily controls the amount of prediction lead during trending sections of the indicator.
 TAKEAWAYS 
1.	 A more or less universal band limited “roofing filter” indicator was used to demonstrate the predictors.  The HPPeriod input parameter is used to control whether the indicator looks more like a trend indicator or more like a cycle indicator.  The LPPeriod input parameter is used to control the smoothness of the indicator.
2.	A linear extrapolation predictor is formed by adding the difference of the two most recent data bars to the value of the last data bar.  The result is considered to be a real data point and the process is repeated to extend the prediction into the future.  This is an FIR filter having a one bar negative group delay at zero frequency, but the group delay is not constant across the spectrum.  This variable group delay causes the linear extrapolation prediction to be inconsistent across a range of market conditions.
3.	The degree of prediction by linear extrapolation can be controlled by varying the gain of the prediction to reduce the overshoot to be about the same amplitude as the peak swing of the indicator.
4.	I was unable to experimentally derive a higher order FIR filter predictor that had advantages over the simple linear extrapolation predictor.
5.	A Two Pole IIR predictor can be created by parametrically locating the conjugate pole positions.
6.	The Two Pole predictor is a second order filter, which allows curvature into the prediction, thus mitigating overshoot.  Further, the curvature is adaptive because the prediction depends on previously computed prediction values.
7.	The Two Pole predictor is more consistent over a range of market conditions.
 ADDITIONS 
 
 Loxx's Expanded source types:
Library for expanded source types:
  
Explanation for expanded source types:
  
 Three different signal types: 1) Prediction/Filter crosses; 2) Prediction middle crosses; and, 3) Filter middle crosses.
 Bar coloring to color trend.
 Signals, both Long and Short.
 Alerts, both Long and Short.
Modified Covariance Autoregressive Estimator of Price [Loxx]What is the Modified Covariance AR Estimator? 
The Modified Covariance AR Estimator uses the modified covariance method to fit an autoregressive (AR) model to the input data. This method minimizes the forward and backward prediction errors in the least squares sense. The input is a frame of consecutive time samples, which is assumed to be the output of an AR system driven by white noise. The block computes the normalized estimate of the AR system parameters, A(z), independently for each successive input. 
 Characteristics of Modified Covariance AR Estimator 
 
 Minimizes the forward prediction error in the least squares sense
 Minimizes the forward and backward prediction errors in the least squares sense
 High resolution for short data records
 Able to extract frequencies from data consisting of p or more pure sinusoids
 Does not suffer spectral line-splitting
 May produce unstable models
 Peak locations slightly dependent on initial phase
 Minor frequency bias for estimates of sinusoids in noise
 Order must be less than or equal to 2/3 the input frame size
 
 Purpose 
This indicator calculates a prediction of price. This will  NOT work on all tickers. To see whether this works on a ticker for the settings you have chosen, you must check the label message on the lower right of the chart. The label will show either a pass or fail. If it passes, then it's green, if it fails, it's red. The reason for this is because the Modified Covariance method produce unstable models
 H(z)= G / A(z) = G / (1+. a(2)z −1 +…+a(p+1)z) 
You specify the order, "ip", of the all-pole model in the Estimation order parameter. To guarantee a valid output, you must set the Estimation order parameter to be less than or equal to two thirds the input vector length.
The output port labeled "a" outputs the normalized estimate of the AR model coefficients in descending powers of z.
The implementation of the Modified Covariance AR Estimator in this indicator is the fast algorithm for the solution of the modified covariance least squares normal equations. 
 Inputs 
 x   - Array of complex data samples X(1) through X(N)
 ip  - Order of linear prediction model (integer)
 Notable local variables 
v   - Real linear prediction variance at order IP
 Outputs 
a        - Array of complex linear prediction coefficients
stop  - value at time of exit, with error message
    false - for normal exit (no numerical ill-conditioning)
    true - if v is not a positive value
    true - if delta and gamma do not lie in the range 0 to 1
    true - if v is not a positive value
    true - if delta and gamma do not lie in the range 0 to 1
errormessage - an error message based on "stop" parameter; this message will be displayed in the lower righthand corner of the chart. If you see a green "passed" then the analysis is valid, otherwise the test failed.
 Indicator inputs 
LastBar = bars backward from current bar to test estimate reliability 
PastBars = how many bars are we going to analyze
LPOrder = Order of Linear Prediction, and for Modified Covariance AR method, this  must be less than or equal to 2/3 the input frame size, so this number has a max value of 0.67
FutBars = how many bars you'd like to show in the future. This algorithm will either accept or reject your value input here and then project forward
 Further reading 
 Spectrum Analysis-A Modern Perspective 1380 PROCEEDINGS OF THE IEEE, VOL. 69, NO. 11, NOVEMBER 1981  
 Related indicators 
 Levinson-Durbin Autocorrelation Extrapolation of Price  
  
 Weighted Burg AR Spectral Estimate Extrapolation of Price  
  
 Helme-Nikias Weighted Burg AR-SE Extra. of Price  
   
 Itakura-Saito Autoregressive Extrapolation of Price  
  
 Modified Covariance Autoregressive Estimator of Price    
  
1+KillZoneLiteRemove plot line for a better view. I've made this to work on "US30 Global Prime" probably works on other pairs the codes left open to mod. 
This Indicator shows 3 sessions to help you focus on timing. This will help you with learning pattern recognition aswell. 
1. Gray zone is spreads. The gray zone will show up 30 min before spreads open up. 
2. Blue is new york
3. Red is london reversal zone. 
4. Look between the zones and also how price reacts within the zones and at what time. 
5. This indicator also prints the sessions 1 day in advance to help with back testing aswell.
Joker Trailing TP BotTrailing Take Profit is used by the traders to increase their gains when the prices moves in a favorable direction. Let’s have a look at what is Trailing Take Profit and how it works.
What Is a Trailing Take Profit?
Trailing Take Profit is a term largely used in crypto, whereas you may encounter the term Trailing Stop in traditional trading describing almost the same thing, So what’s the difference between Trailing Take Profit and Trailing Stop? Trailing Stop is a type of Stop Loss automatically moving in the same direction as the asset’s price. Trailing Take Profit is nothing else than Trailing Stop activated after initial Take Profit is reached.
The main difference between these two is that Trailing Take Profit takes the profit in any case (altough it might be later annihilated by Trailing Stop). Thus, Trailing Take Profit reduces the risks that might’ve occurred using Trailing Stop alone.   Trailing Take Profit is bound to the maximum of Take Profit price instead of just a price increase/decrease.
As you might notice, the terms Trailing Take Profit and Stop Loss are quite similar. To avoid confusion, in this article we will be talking about Trailing Take Profit as defined above.
Trailing Take Profit only moves in one direction. It is designed to lock in profit and limit losses. The trailing profit only moves up (in case of a long strategy) once the price has surpassed previous high and a new high has been established. If the trailing take profit moves up, it cannot move back down, thus securing the profit and preventing losses.
Trailing Take Profit allows the trade to remain open and continue to profit as long as the price is moving in the investor’s favor.  If the price changes direction and the change surpasses the previously set percentage the order will be closed.
How Does it Work?
For example if you buy BTC at the price of 10000, if you set a Take Profit at 11000 and a Trailing Take Profit at 5% :
If the price goes up to 10500, nothing happens because the Take Profit at 11000 has not been reached.
Then if the BTC price goes up top 11000, a Stop Order at 10450 will be set.
Then if the BTC price goes down to 10500, the Stop Order stays at 104500. 
Then if the BTC price goes up to 12000, the Stop Order moves to 11400. 
Then if the BTC price goes down to 11000, the Stop Order at 11400 is executed.
You see that without Trailing Take Profit, the buy order would have been sold at 11000. Thus, a trader would miss an earning opportunity at 11400. 















