Directional Matrix [LuxAlgo]Returns a dashboard showing the direction taken by 4 overlay indicators, SMA (simple moving average), TMA (triangular moving average), WMA (weighted moving average), and REG (linear regression), all using different length periods.
The user can select the minimum and maximum length of these indicators and introduce an increment.
1. Settings
Maximum Length: The end value of sequences of the indicator periods to analyze
Minimum Length: The starting value of sequences of the indicator periods to analyze
Step: Determines the spacing between each indicator periods values
Src: Data source for each of the 4 indicators
1.1 Style settings
Normalized Change Mode: Allows the user to access a different interpretation of the indicator by showing the normalized first differences of each indicator in the dashboard instead of their sign
Dashboard Location: Location of the dashboard on the chart
Dashboard Size: Size of the dashboard on the chart
Text/Frame Color: Determines the color of the frame grid as well as the text color
Bullish Cell Color: Determines the color of cell associated with a rising indicator direction
Bearish Cell Color: Determines the color of cell associated with a decreasing indicator direction
Cell Transparency: Transparency of each cell
2. Usage
Each of the indicators included in the dashboard aim to give an estimate of the underlying trend in the price. Knowing which direction they are taking can help us have a broader view regarding the direction of shorter/longer-term trends. We will later see that this is not the only kind of information that we can get from this indicator.
Rising indicators are represented by blue cells (or the color selected in the Bullish Cell Color setting) while decreasing indicators are represented by red cells (or the color selected in the Bearish Cell Color setting).
The percentage of bullish cells is given in the top-left cell of the dashboard.
2.1 Normalized change mode
Enabling the Normalized Change mode will display the normalized changes returned by the indicators over different length periods. This metric is within a range (0,1), with 1 indicating the highest change over the selected length periods, while 0 indicates the lowest one.
When enabling this mode the color of the cells makes use of a gradient with a color palette ranging from the color selected in the Bearish Cell setting to the color selected in the Bullish Cell setting.
2.1 Other Usage
The direction taken by certain indicators can give more information than one would think. Indeed, the sign of the change of one indicator can often be given by different indicators.
A positive change in a simple moving average indicates that the price is greater than the price p bars ago, where p is the period of the simple moving average.
A positive change in a triangular moving average indicates that a simple moving average of period p is above a simple moving average of period p × 2 , where p is the period of the triangular moving average (note that we assume here that the TMA is given by cascading two SMAs of period p ).
A positive change in a weighted moving average indicates that the price is above a simple moving average of period p+1 , where p is the period of the WMA.
Finally, a positive change in a linear regression indicates that a weighted moving average is above a simple moving average of period p , where p is the period of the linear regression.
Matrix
Correlation MatrixReturns a 4x4 correlation matrix between various user-selected symbols. Users can change the window of the correlation with the setting length .
Correlation matrices can be useful to see the linear relationship between various symbols, this is an important tool for diversification.
Envious Volume Matrix"View it all from a different perspective, enter with the hive, stick to your motive, and the further you'll dive." ~ Envious Volume Matrix.
What is unique about this volume indicator compared to others?
The volume matrix is calculated with different maths and philosophies compared to others and it is combined with some indicators to create the final result. The volume matrix can be used to help see whether or not the bulls or bears are falling or rising so you can see what the next direction of the trend is going to be in. With the volume matrix, you have full control of the indicator. You can customise the timeframe, the colour scheme, the significance of the bull and bear's volume, the plot styles, the dashboard and your alerts. Now that is astonishing!
The volume matrix is to be used as a confluence with your analysis or trading style and should not in anyway shape or form be used as a indication to buy or sell just because the signal says so, it is there to give you a higher chance of having a high probability trade though past results is not indicative of future results and getting access doesn't mean you will become a millionaire in a day as it is not a get rich quick indicator so it won't guarantee 100% success.
Visit our website for more information, which can be found on my profile or on the signature of this indicator!
Does it repaint?
No, our volume matrix doesn't repaint as we do not use any variations where it will cause gaps, future predictions or miscalculations of historic bars.
Does it support all chart types?
Yes, all charts are supported with the volume matrix.
Features:
/Basic Settings
-Enable Custom Timeframe (This will toggle the settings for custom timeframe on and off)
-Custom Timeframe (input box, this will change the timeframe on the indicator to the value set)
-Lookback Period (This period will determine the bar levels needed to validate a calculation)
-Bull's significance (This value will change the strength of the bulls, decreasing the value will make the volume occur faster, increasing the value will make the volume slower)
-Bear's significance (This value will change the strength of the bears, decreasing the value will make the volume occur faster, increasing the value will make the volume slower)
/Miscellaneous
-Volume Styles (Changes the plot style to: Double Lines, Single Line, Histogram, Hills and Valleys, Bar Columns)
-Colour Scheme (Changes the colour scheme to the following options: Ice and Fire, Rhubarb and Custard, Strawberry and Lime, Orange and Purple, Black and White, Old School, Blue and Yellow, Green and Yellow, Purple and
Pink, Heat-O-Meter)
/Dashboard Settings
-Show Volume Dashboard (This will toggle the dashboard on and off)
-Dashboard X-LOC (This will change the x position of the dashboard)
-Text Colour (This will change the text colour of the dashboard)
/Custom Alerts
-Bull Switchover
-Bear Switchover
Bank Heist ( Matrix 5 EMA With Delorean Indicator Alerts )Bank Heist ( Market Maker / Matrix 5 EMA With Delorean Indicator Alerts )
Welcome to the "Bank Heist" Indicator
This indicator is based on one strategy that many many individuals and companies have tried to label as their own, brand it, and resell it. The names of these companies will be listed below as to not "steal" the strategy from the people trying to brand EMA's and also to help those using keyword searches (based on the many hot terms coined over the years) to find this indicator. I personally have decided to add to the confusion and call it the "Bank Heist" so as to not appear to be "stealing" someone elses name for free indicators 😊
The Strategy
Simple:
The EMA's are below price, look for buys. EMA's above price, look for sells.
The 50 EMA is ALWAYS market equilibrium
Intermediate:
5 EMA Crossing Up 13 EMA With The 50 EMA Under everything = Buy
5 EMA Crossing Down 13 EMA with 50 EMA Above everything = Sell
The 50 EMA is ALWAYS market equilibrium
Advanced:
Simple+Intermediate
The higher period the EMA , the Longer the trend.
All time frames must pull back to ALL EMA's at some point during the trend
🤯 Each EMA is one period different, one time frame up or down (Example: The 13 EMA on the 15m chart is the same as the 5 EMA on the 1hr Chart)
🔑 If you don't understand this and/or want to study it further then mark each EMA on the 15m chart, then move up one time frame at a time all the way to the daily chart.
🧙♂️ After it "clicks" , just remember that price must always pull back to all EMA's on all time frames, The 50 EMA is ALWAYS market equilibrium
Delorean Indicator Alerts:
Set alarms on TradingView with this indicator!
For those who don't know what this is:
Two candles cutting through the 13 ema, second candle bigger, trade in the direction of the trend.
Special Notes:
The 50 EMA is ALWAYS market equilibrium
The Highly Skilled Will See How To Get The Worlds Tightest Stop Loss
THIS WORKS ON ALL TIME FRAMES (Yes, 1 minute throught 1 year)
THIS WORKS ON ANY FINANCIAL INSTRUMENT
You Can Also Set Alerts For The EMA's Crossing ( 5 EMA Crossing 13 EMA , ETC.)
🔮 Study These, You Cant Make This Up 🔮
Famous Trading System Names That Got You Here
Ordered from true original to most recent "creators" in chronological order
FXPX
Matrix
Matrix Trading System
Matrix 5 EMA
5 EMA
5 EMA's
Market Maker
MarketMaker
Delorean
Delorean Indicator
Delorean Strategy
IM Academy
Bank Heist (Free & Condensed TradingView Indicator)
DISCLAIMER
THIS IS NOT FINANCIAL OR INVESTMENT ADVICE AND SHOULD NOT BE INTERPRETED AS SUCH.
Trading foreign exchange on margin carries a high level of risk, and may not be suitable for all investors. Past performance is not indicative of future results. The high degree of leverage can work against you as well as for you. Before deciding to invest in foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with foreign exchange trading, and seek advice from an independent financial advisor if you have any doubts.
Genesis Matrix Momentum IndicatorThe Genesis Matrix (GMMI = Genesis Matrix Momentum Indicator) is primarily a momentum indicator that can be very well combined with other indicators to easily detect possible trend changes.
This is a translation/interpretation for TradingView from the original Metatrader 4 code which is Open-Source and was developed by "realjumper". More information here: www.forexfactory.com
The 5-15 Genesis Strategy and Genesis Summary PDF: www.forexfactory.com
EMA is configured as follows:
Length: 5
Source: hlc3
Offset: 2
Create a buy alert:
- Condition: GMMI and "All blue"
- Options: Once Per Bar
Create a sell alert:
- Condition: GMMI and "All red"
- Options: Once Per Bar
Version 3 changes:
- Bug fixes
- Fixed T3 signal (trend reversal instead of closing above/under trend)
- Input variables added (You could play around with periods of CCI and T3 by setting it to 12 for example.)
- Converted to PineScript v4
- Added alarm conditions
Happy Trading 📈😎
Important : We have neither invented this indicator nor added anything in the logic to it. This is just a script translation.
Note1 : TVI (first line) only works on a ticker with provided volume!
Note2 : The original system uses Heikin Ashi candles, but please be aware that this may alter the alertcondition and probably falsify the actual outcome.
Note3 : We do not recommend using a single indicator as a basis for your trading decisions.
To find out more about how to gain access to this indicator, please use the provided information below or just message me.
Matrix Library (Linear Algebra, incl Multiple Linear Regression)What's this all about?
Ever since 1D arrays were added to Pine Script, many wonderful new opportunities have opened up. There has been a few implementations of matrices and matrix math (most notably by TradingView-user tbiktag in his recent Moving Regression script: ). However, so far, no comprehensive libraries for matrix math and linear algebra has been developed. This script aims to change that.
I'm not math expert, but I like learning new things, so I took it upon myself to relearn linear algebra these past few months, and create a matrix math library for Pine Script. The goal with the library was to make a comprehensive collection of functions that can be used to perform as many of the standard operations on matrices as possible, and to implement functions to solve systems of linear equations. The library implements matrices using arrays, and many standard functions to manipulate these matrices have been added as well.
The main purpose of the library is to give users the ability to solve systems of linear equations (useful for Multiple Linear Regression with K number of independent variables for example), but it can also be used to simulate 2D arrays for any purpose.
So how do I use this thing?
Personally, what I do with my private Pine Script libraries is I keep them stored as text-files in a Libraries folder, and I copy and paste them into my code when I need them. This library is quite large, so I have made sure to use brackets in comments to easily hide any part of the code. This helps with big libraries like this one.
The parts of this script that you need to copy are labeled "MathLib", "ArrayLib", and "MatrixLib". The matrix library is dependent on the functions from these other two libraries, but they are stripped down to only include the functions used by the MatrixLib library.
When you have the code in your script (pasted somewhere below the "study()" call), you can create a matrix by calling one of the constructor functions. All functions in this library start with "matrix_", and all constructors start with either "create" or "copy". I suggest you read through the code though. The functions have very descriptive names, and a short description of what each function does is included in a header comment directly above it. The functions generally come in the following order:
Constructors: These are used to create matrices (empy with no rows or columns, set shape filled with 0s, from a time series or an array, and so on).
Getters and setters: These are used to get data from a matrix (like the value of an element or a full row or column).
Matrix manipulations: These functions manipulate the matrix in some way (for example, functions to append columns or rows to a matrix).
Matrix operations: These are the matrix operations. They include things like basic math operations for two indices, to transposing a matrix.
Decompositions and solvers: Next up are functions to solve systems of linear equations. These include LU and QR decomposition and solvers, and functions for calculating the pseudo-inverse or inverse of a matrix.
Multiple Linear Regression: Lastly, we find an implementation of a multiple linear regression, including all the standard statistics one can expect to find in most statistical software packages.
Are there any working examples of how to use the library?
Yes, at the very end of the script, there is an example that plots the predictions from a multiple linear regression with two independent (explanatory) X variables, regressing the chart data (the Y variable) on these X variables. You can look at this code to see a real-world example of how to use the code in this library.
Are there any limitations?
There are no hard limiations, but the matrices uses arrays, so the number of elements can never exceed the number of elements supported by Pine Script (minus 2, since two elements are used internally by the library to store row and column count). Some of the operations do use a lot of resources though, and as a result, some things can not be done without timing out. This can vary from time to time as well, as this is primarily dependent on the available resources from the Pine Script servers. For instance, the multiple linear regression cannot be used with a lookback window above 10 or 12 most of the time, if the statistics are reported. If no statistics are reported (and therefore not calculated), the lookback window can usually be extended to around 60-80 bars before the servers time out the execution.
Hopefully the dev-team at TradingView sees this script and find ways to implement this functionality diretly into Pine Script, as that would speed up many of the operations and make things like MLR (multiple linear regression) possible on a bigger lookback window.
Some parting words
This library has taken a few months to write, and I have taken all the steps I can think of to test it for bugs. Some may have slipped through anyway, so please let me know if you find any, and I'll try my best to fix them when I have time to do so. This library is intended to help the community. Therefore, I am releasing the library as open source, in the hopes that people may improving on it, or using it in their own work. If you do make something cool with this, or if you find ways to improve the code, please let me know in the comments.
MM Matrix OscillatorHere I present MM Matrix Oscillator
What the oscillator and histogram represent are trend candles, when the histogram is painted lime above 0 line it is buy, you will also see the buy signal below with an arrow, when the oscillator is painted red below the 0 line you will see the signal in red sell.
Dynamic Support and resistance to see possible exit points and extra confirmation on zones
You have an additional, exit buy and exit sell to perform scalping.
It has buy and sell signals alarm and also the painting of candles on the chart to see the trend. green=uptrend/red= downtrend
added "color trend and exit" in settings
red=downtrend
white=ranging
green=buy
Use link below or PM us for access you this indicator Happy Trading
[NLX-L1] Trend Matrix (+Alerts)- Trend Matrix with Alerts -
This is pretty much the only Trend Indicator you will ever need. Alerts are included :)
It includes all the common indicators and creates a positive or negative score (which can be used with my Modular Trading Framework)
QQE-RSI-W%
ICHIMOKU-TREND
ICHIMOKU-TWIST
ICHIMOKU-CLOUD
SUPERTREND
PSAR
TTM
BB/ KELTNER SQUEEZE
ALLIGATOR
- Use with the Modular Trading Framework -
1. Add Trend Matrix to your chart. All the parameters are adjusted dynamically.
2. Add any L2 Indicator to your Chart and select Trend Matrix as a Signal Source, select L1 as Type
Polynomial Regression Bands + Channel [DW]This is an experimental study designed to calculate polynomial regression for any order polynomial that TV is able to support.
This study aims to educate users on polynomial curve fitting, and the derivation process of Least Squares Moving Averages (LSMAs).
I also designed this study with the intent of showcasing some of the capabilities and potential applications of TV's fantastic new array functions.
Polynomial regression is a form of regression analysis in which the relationship between the independent variable x and the dependent variable y is modeled as a polynomial of nth degree (order).
For clarification, linear regression can also be described as a first order polynomial regression. The process of deriving linear, quadratic, cubic, and higher order polynomial relationships is all the same.
In addition, although deriving a polynomial regression equation results in a nonlinear output, the process of solving for polynomials by least squares is actually a special case of multiple linear regression.
So, just like in multiple linear regression, polynomial regression can be solved in essentially the same way through a system of linear equations.
In this study, you are first given the option to smooth the input data using the 2 pole Super Smoother Filter from John Ehlers.
I chose this specific filter because I find it provides superior smoothing with low lag and fairly clean cutoff. You can, of course, implement your own filter functions to see how they compare if you feel like experimenting.
Filtering noise prior to regression calculation can be useful for providing a more stable estimation since least squares regression can be rather sensitive to noise.
This is especially true on lower sampling lengths and higher degree polynomials since the regression output becomes more "overfit" to the sample data.
Next, data arrays are populated for the x-axis and y-axis values. These are the main datasets utilized in the rest of the calculations.
To keep the calculations more numerically stable for higher periods and orders, the x array is filled with integers 1 through the sampling period rather than using current bar numbers.
This process can be thought of as shifting the origin of the x-axis as new data emerges.
This keeps the axis values significantly lower than the 10k+ bar values, thus maintaining more numerical stability at higher orders and sample lengths.
The data arrays are then used to create a pseudo 2D matrix of x power sums, and a vector of x power*y sums.
These matrices are a representation the system of equations that need to be solved in order to find the regression coefficients.
Below, you'll see some examples of the pattern of equations used to solve for our coefficients represented in augmented matrix form.
For example, the augmented matrix for the system equations required to solve a second order (quadratic) polynomial regression by least squares is formed like this:
(∑x^0 ∑x^1 ∑x^2 | ∑(x^0)y)
(∑x^1 ∑x^2 ∑x^3 | ∑(x^1)y)
(∑x^2 ∑x^3 ∑x^4 | ∑(x^2)y)
The augmented matrix for the third order (cubic) system is formed like this:
(∑x^0 ∑x^1 ∑x^2 ∑x^3 | ∑(x^0)y)
(∑x^1 ∑x^2 ∑x^3 ∑x^4 | ∑(x^1)y)
(∑x^2 ∑x^3 ∑x^4 ∑x^5 | ∑(x^2)y)
(∑x^3 ∑x^4 ∑x^5 ∑x^6 | ∑(x^3)y)
This pattern continues for any n ordered polynomial regression, in which the coefficient matrix is a n + 1 wide square matrix with the last term being ∑x^2n, and the last term of the result vector being ∑(x^n)y.
Thanks to this pattern, it's rather convenient to solve the for our regression coefficients of any nth degree polynomial by a number of different methods.
In this script, I utilize a process known as LU Decomposition to solve for the regression coefficients.
Lower-upper (LU) Decomposition is a neat form of matrix manipulation that expresses a 2D matrix as the product of lower and upper triangular matrices.
This decomposition method is incredibly handy for solving systems of equations, calculating determinants, and inverting matrices.
For a linear system Ax=b, where A is our coefficient matrix, x is our vector of unknowns, and b is our vector of results, LU Decomposition turns our system into LUx=b.
We can then factor this into two separate matrix equations and solve the system using these two simple steps:
1. Solve Ly=b for y, where y is a new vector of unknowns that satisfies the equation, using forward substitution.
2. Solve Ux=y for x using backward substitution. This gives us the values of our original unknowns - in this case, the coefficients for our regression equation.
After solving for the regression coefficients, the values are then plugged into our regression equation:
Y = a0 + a1*x + a1*x^2 + ... + an*x^n, where a() is the ()th coefficient in ascending order and n is the polynomial degree.
From here, an array of curve values for the period based on the current equation is populated, and standard deviation is added to and subtracted from the equation to calculate the channel high and low levels.
The calculated curve values can also be shifted to the left or right using the "Regression Offset" input
Changing the offset parameter will move the curve left for negative values, and right for positive values.
This offset parameter shifts the curve points within our window while using the same equation, allowing you to use offset datapoints on the regression curve to calculate the LSMA and bands.
The curve and channel's appearance is optionally approximated using Pine's v4 line tools to draw segments.
Since there is a limitation on how many lines can be displayed per script, each curve consists of 10 segments with lengths determined by a user defined step size. In total, there are 30 lines displayed at once when active.
By default, the step size is 10, meaning each segment is 10 bars long. This is because the default sampling period is 100, so this step size will show the approximate curve for the entire period.
When adjusting your sampling period, be sure to adjust your step size accordingly when curve drawing is active if you want to see the full approximate curve for the period.
Note that when you have a larger step size, you will see more seemingly "sharp" turning points on the polynomial curve, especially on higher degree polynomials.
The polynomial functions that are calculated are continuous and differentiable across all points. The perceived sharpness is simply due to our limitation on available lines to draw them.
The approximate channel drawings also come equipped with style inputs, so you can control the type, color, and width of the regression, channel high, and channel low curves.
I also included an input to determine if the curves are updated continuously, or only upon the closing of a bar for reduced runtime demands. More about why this is important in the notes below.
For additional reference, I also included the option to display the current regression equation.
This allows you to easily track the polynomial function you're using, and to confirm that the polynomial is properly supported within Pine.
There are some cases that aren't supported properly due to Pine's limitations. More about this in the notes on the bottom.
In addition, I included a line of text beneath the equation to indicate how many bars left or right the calculated curve data is currently shifted.
The display label comes equipped with style editing inputs, so you can control the size, background color, and text color of the equation display.
The Polynomial LSMA, high band, and low band in this script are generated by tracking the current endpoints of the regression, channel high, and channel low curves respectively.
The output of these bands is similar in nature to Bollinger Bands, but with an obviously different derivation process.
By displaying the LSMA and bands in tandem with the polynomial channel, it's easy to visualize how LSMAs are derived, and how the process that goes into them is drastically different from a typical moving average.
The main difference between LSMA and other MAs is that LSMA is showing the value of the regression curve on the current bar, which is the result of a modelled relationship between x and the expected value of y.
With other MA / filter types, they are typically just averaging or frequency filtering the samples. This is an important distinction in interpretation. However, both can be applied similarly when trading.
An important distinction with the LSMA in this script is that since we can model higher degree polynomial relationships, the LSMA here is not limited to only linear as it is in TV's built in LSMA.
Bar colors are also included in this script. The color scheme is based on disparity between source and the LSMA.
This script is a great study for educating yourself on the process that goes into polynomial regression, as well as one of the many processes computers utilize to solve systems of equations.
Also, the Polynomial LSMA and bands are great components to try implementing into your own analysis setup.
I hope you all enjoy it!
--------------------------------------------------------
NOTES:
- Even though the algorithm used in this script can be implemented to find any order polynomial relationship, TV has a limit on the significant figures for its floating point outputs.
This means that as you increase your sampling period and / or polynomial order, some higher order coefficients will be output as 0 due to floating point round-off.
There is currently no viable workaround for this issue since there isn't a way to calculate more significant figures than the limit.
However, in my humble opinion, fitting a polynomial higher than cubic to most time series data is "overkill" due to bias-variance tradeoff.
Although, this tradeoff is also dependent on the sampling period. Keep that in mind. A good rule of thumb is to aim for a nice "middle ground" between bias and variance.
If TV ever chooses to expand its significant figure limits, then it will be possible to accurately calculate even higher order polynomials and periods if you feel the desire to do so.
To test if your polynomial is properly supported within Pine's constraints, check the equation label.
If you see a coefficient value of 0 in front of any of the x values, reduce your period and / or polynomial order.
- Although this algorithm has less computational complexity than most other linear system solving methods, this script itself can still be rather demanding on runtime resources - especially when drawing the curves.
In the event you find your current configuration is throwing back an error saying that the calculation takes too long, there are a few things you can try:
-> Refresh your chart or hide and unhide the indicator.
The runtime environment on TV is very dynamic and the allocation of available memory varies with collective server usage.
By refreshing, you can often get it to process since you're basically just waiting for your allotment to increase. This method works well in a lot of cases.
-> Change the curve update frequency to "Close Only".
If you've tried refreshing multiple times and still have the error, your configuration may simply be too demanding of resources.
v4 drawing objects, most notably lines, can be highly taxing on the servers. That's why Pine has a limit on how many can be displayed in the first place.
By limiting the curve updates to only bar closes, this will significantly reduce the runtime needs of the lines since they will only be calculated once per bar.
Note that doing this will only limit the visual output of the curve segments. It has no impact on regression calculation, equation display, or LSMA and band displays.
-> Uncheck the display boxes for the drawing objects.
If you still have troubles after trying the above options, then simply stop displaying the curve - unless it's important to you.
As I mentioned, v4 drawing objects can be rather resource intensive. So a simple fix that often works when other things fail is to just stop them from being displayed.
-> Reduce sampling period, polynomial order, or curve drawing step size.
If you're having runtime errors and don't want to sacrifice the curve drawings, then you'll need to reduce the calculation complexity.
If you're using a large sampling period, or high order polynomial, the operational complexity becomes significantly higher than lower periods and orders.
When you have larger step sizes, more historical referencing is used for x-axis locations, which does have an impact as well.
By reducing these parameters, the runtime issue will often be solved.
Another important detail to note with this is that you may have configurations that work just fine in real time, but struggle to load properly in replay mode.
This is because the replay framework also requires its own allotment of runtime, so that must be taken into consideration as well.
- Please note that the line and label objects are reprinted as new data emerges. That's simply the nature of drawing objects vs standard plots.
I do not recommend or endorse basing your trading decisions based on the drawn curve. That component is merely to serve as a visual reference of the current polynomial relationship.
No repainting occurs with the Polynomial LSMA and bands though. Once the bar is closed, that bar's calculated values are set.
So when using the LSMA and bands for trading purposes, you can rest easy knowing that history won't change on you when you come back to view them.
- For those who intend on utilizing or modifying the functions and calculations in this script for their own scripts, I included debug dialogues in the script for all of the arrays to make the process easier.
To use the debugs, see the "Debugs" section at the bottom. All dialogues are commented out by default.
The debugs are displayed using label objects. By default, I have them all located to the right of current price.
If you wish to display multiple debugs at once, it will be up to you to decide on display locations at your leisure.
When using the debugs, I recommend commenting out the other drawing objects (or even all plots) in the script to prevent runtime issues and overlapping displays.
Matrix functions - JD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// The arrays provided in Pinescript are linear 1D strucures that can be seen either as a large vertical stack or
// a horizontal row containing a list of values, colors, bools,..
//
// With the FUNCTIONS in this script the 1D ARRAY LIST can be CONVERTED INTO A 2D MATRIX form
//
//
///////////////////////////////////////////
/// BASIC INFO ON THE MATRIX STRUCTURE: ///
///////////////////////////////////////////
//
// The matrix is set up as an 2D structure and is devided in ROWS and COLUMNS.
// following the standard mathematical notation:
//
// a 3 x 4 matrix = 4 columns
// 0 1 2 3 column index
// 0
// 3 rows 1
// 2
// row
// index
//
// With the use of some purpose-built functions, values can be placed or retrieved in a specific column of a certain row
// this can be done by intuitively using row_nr and column_nr coördinates,
// without having to worry on what exact index of the Pine array this value is located (the functions do these conversions for you)
//
//
// the syntax I propose for the 2D Matrix array has the following structure:
//
// - the array starts with 2 VALUES describing the DIMENSION INFORMATION, (rows, columns)
// these are ignored in the actual calculations and serve as a metadata header (similar to the "location, time,... etc." data that is stored in photo files)
// so the array always carries it's own info about the nr. of rows and columns and doesn't need is seperate "info" file!
//
// To stay consistent with the standard Pinescript (array and ) indexing:
// - indexes for sheets and columns start from 0 (first) and run up to the (total nr of sheets or columns) - 1
// - indexes for rows also start from 0 (most recent, cfr. ) and run up to the (total nr of rows) - 1
//
// - this 2 value metadata header is followed by the actual df data
// the actual data array can consist of (100,000 - 2) usable items,
//
// In a theoretical example, you can have a matrix with almost 20,000 rows with each 5 columns of data (eg. open, high, low, close, volume) in it!!!
//
//
///////////////////////////////////
/// SCHEMATIC OF THE STRUCTURE: ///
///////////////////////////////////
//
////// (metadata header with dimensions info)
//
// (0) (1) (array index)
//
ADR Metrics/MatrixI didn't see any such idea around for ADR on TV, so decided to do one myself for doing some testing.
It's very simple logic, what we are seeing on the chart are ADR and its intraday ranges. These can be S/R, SL, targets, and entries for your trading decisions.
Here is an example
Please note that this is only for intraday. It's a small and clean code.
Past performance is not an assurance of future success. This idea is for educational purposes only.
Enjoy~
Correlation MatrixIn financial terms, 'correlation' is the numerical measure of the relationship between two variables (in this case, the variables are Forex pairs).
The range of the correlation coefficient is between -1 and +1. A correlation of +1 indicates that two currency pairs will flow in the same direction.
A correlation of -1 indicates that two currency pairs will move in the opposite direction.
Here, I multiplied correlation coefficient by 100 so that it is easier to read. Range between 100 and -100.
Color Coding:-
The darker the color, the higher the correlation positively or negatively.
Extra Light Blue (up to +29) : Weak correlation. Positions on these symbols will tend to move independently.
Light Blue (up to +49) : There may be similarity between positions on these symbols.
Medium Blue (up to +75) : Medium positive correlation.
Navy Blue (up to +100) : Strong positive correlation.
Extra Light Red (up to -30) : Weak correlation. Positions on these symbols will tend to move independently
Light Red (up to -49) : There may be similarity between positions on these symbols.
Dark Red: (up to -75) : Medium negative correlation.
Maroon: (up to -100) : Strong negative correlation.
Correlation MATRIX (Flexible version)Hey folks
A quick unrelated but interesting foreword
Hope you're all good and well and tanned
Me? I'm preparing the opening of my website where we're going to offer the Algorithm Builder Single Trend, Multiple Trends, Multi-Timeframe and plenty of others across many platforms (TradingView, FXCM, MT4, PRT). While others are at the beach and tanning (Yes I'm jealous, so what !?!), we're working our a** off to deliver an amazing looking website and great indicators and strategies for you guys.
Today I worked in including the Trade Manager Pro version and the Risk/Reward Pro version into all our Algorithm Builders. Here's a teaser
We're going to have a few indicators/strategies packages and subscriptions will open very soon.
The website should open in a few weeks and we still have loads to do ... (#no #summer #holidays #for #dave)
I see every message asking me to allow access to my Algorithm Builders but with the website opening shortly, it will be better for me to manage the trials from there - otherwise, it's duplicated and I can't follow all those requests
As you can probably all understand, it becomes very challenging to publish once a day with all that workload so I'll probably slow down (just a bit) and maybe posting once every 2/3 days until the website will be over (please forgive me for failing you). But once it will open, the daily publishing will resume again :) (here's when you're supposed to be clapping guys....)
While I'm so honored by all the likes, private messages and comments encouraging me, you have to realize that a script always takes me about 2/3 hours of work (with research, coding, debugging) but I'm doing it because I like it. Only pushing the brake a bit because of other constraints
INDICATOR OF THE DAY
I made a more flexible version of my Correlation Matrix .
You can now select the symbols you want and the matrix will update automatically !!! Let me repeat it once more because this is very cool... You can now select the symbols you want and the matrix will update automatically :)
Actually, I have nothing more to say about it... that's all :) Ah yes, I added a condition to detect negative correlation and they're being flagged with a black dot
Definition : Negative correlation or inverse correlation is a relationship between two variables whereby they move in opposite directions.
A negative correlation is a key concept in portfolio construction, as it enables the creation of diversified portfolios that can better withstand portfolio volatility and smooth out returns.
Correlation between two variables can vary widely over time. Stocks and bonds generally have a negative correlation, but in the decade to 2018, their correlation has ranged from -0.8 to 0.2. (Source : www.investopedia.com
See you maybe tomorrow or in a few days for another script/idea.
Be sure to hit the thumbs up to cheer me up as your likes will be the only sunlight I'll get for the next weeks.... because working on building a great offer for you guys.
Dave
____________________________________________________________
- I'm an officially approved PineEditor/LUA/MT4 approved mentor on codementor. You can request a coaching with me if you want and I'll teach you how to build kick-ass indicators and strategies
Jump on a 1 to 1 coaching with me
- You can also hire for a custom dev of your indicator/strategy/bot/chrome extension/python
Correlation Matrix by DaveattHi everyone
A co-pinescripter friend told me this was impossible to do and we bet a free dinner tomorrow. Guess who's going to be invited to a very fancy restaurant tomorrow :) :) :) (hint: not him)
What's the today script is about?
This script is based on this MT4 correlation matrix
Asset correlation is a measure of how investments move in relation to one another and when. ... Under what is known as modern portfolio theory, you can reduce the overall risk in an investment portfolio and even boost your overall returns by investing in asset combinations that are not correlated.
I did it because it wasn't existing before with this format. What I discovered was only correlations shown as plot lines... #this #is #not #pretty
How does it work?
The correlation matrix will not be based on the current asset of the chart BUT will be based on the current timeframe (confusing? if yes, read it again until you'll get it)
- Numbers of bars back: numbers of bars used for the correlation calculation
- High correlation level: Correlation upper threshold. If above, then the correlation will be green
- Low correlation level: Correlation lower threshold. If below, then the correlation will be red
If the correlation is between the high and low levels, then it will be displayed in orange
- FOREX/INDEX: You can choose between displaying the correlation matrix between 3 FOREX or 3 INDEX assets
Also...
So far the scale doesn't respond too well to the matrix so you'll have to adapt the scale manually. I'll publish a V2 if I'll find a way to solve this issue from the code directly #new #challenge
A quick final note on why I'm sharing so much?
It challenges me to think out of the norm, get out of my bubble and explore areas of Pinescript that I still don't know. This "a script a day" challenge allows me to speed up my learning curve on Pinescript by a billion factor (and I get a few interesting gigs as well)
Let's bring this indicator to 100 LIKES guys !!!!! I think it deserves it, don't you think? :)
PS
Before all copy/pasters will add a version with crypto tomorrow, don't bother, I already did it and will post it in a few minutes for FREE :p
____________________________________________________________
Be sure to hit the thumbs up as it shows me that I'm not doing this for nothing and will motivate to deliver more quality content in the future.
- I'm an officially approved PineEditor/LUA/MT4 approved mentor on codementor. You can request a coaching with me if you want and I'll teach you how to build kick-ass indicators and strategies
Jump on a 1 to 1 coaching with me
- You can also hire for a custom dev of your indicator/strategy/bot/chrome extension/python
NIBIRU MATRIXThe Nibiru Matrix is an entry timing tool based on oscillators and trends. It's to provide an intuitive way of timing trades when price is at the resistance or on the support.
The Nibiru Matrix provides trade entry hints and information about the current market behavior (trending or ranging). If the market is trending, it also shows the trend strength and direction. It is a secondary indicator meaning it trade should be made on the support or resistance using Nibiru Matrix as a confluence indicator.
What it plots?
Slow, fast and stochastic oscillators
Bar coloring to warn about possible setups
Trending/ranging market indication
Current volatility
2 methods of trend confirmation based on 2 different algorithms
Indicator components:
Trend/range setup - provides information about current possible trade strategy. Following a RANGE indicator, Voodoo Matrix suggests that the safest way to trade will be between the local support and resistance shown by Voodoo Support and Resistance, and following a TREND indicator, it is likely that a trending strategy or taking profit on larger ranges is more profitable.
Fast trend indicator - providing color based information on direction of the short-term trend. This is the most reactive trend indication shown by Voodoo Matrix. This can even be used for counter-main-trend scalping.
Green - uptrend
Red - downtrend
Gray - indecision
Slow trend indicator - providing color based information on direction of the long-term trend. It is based on the behavior of a longer period EMAs.
Green - uptrend
Red - downtrend
Gray - indecision
Volatility histogram - information on current price strength. Best used in confluence with the short term trend indicator.
Fast oscillator - oscillator based on stochastic RSI, modified to provide better information on timing and price movement. It's fast moving which helps time the shorter-term moves.
Slow oscillator - oscillator based on stochastic RSI, modified to provide better information on timing and price movement. It's slow moving and provides useful information about the price direction and strength of the move.
Stochastic oscillator - simple stochastic oscillator. Best used with both Fast and Slow Oscillators to get best timing and price movement strength and direction.
Overbought zone - area of the chart where the modified stochastic oscillator suggests the market is currently overbought.
Oversold zone - area of the chart where the modified stochastic oscillator suggests the market is currently oversold.
Neutral zone - area of the chart where the modified stochastic oscillator suggests the market is currently neutral.
Timing confirmation hints - signaling confirmation of fast oscillator forming a buy/sell setup.
Fast oscillator buy/sell color hint s – bar coloring to bring a focus and attention to possible buy/sell signal forming on the fast oscillator.
Use the link below or PM me to gain access to the indicator.
Crypto Correlation Matrix Series [SHK]Hi everyone, Although everything's clear from the title but I should describe some basic points.
Currency Correlation is a statistical measure of how two securities move in relation to each other.
So this script is used to show if current pair (alt-coins) is moving in the same direction of bitcoin (or ethereum) or not. Consider that in crypto market most of alt-coins have correlation of +0.7 with bitcoin, So temporary changes in correlation may signal a reversal or sharp continuation for the alt-coin.
"1" : The alt coin is moving in same direction of Bitcoin (Or Ethereum).
"0" : The alt coin is moving in random direction compared to Bitcoin. (No movement relation)
"-1" : The alt coin is moving in opposite direction of Bitcoin.
Important Note: By default average of 15 bars back is measured to calculate the correlation by this script. Please test other periods and share the best options with us.
Comments are welcomed :)
Correlated Market Matrix - Correlation Computer - GyromaticalCorrelated Market Matrix - Correlation Computer
Works with up to 7 markets simultaneously to find price divergences.
Study Forex pairs, stocks, crypto alt coins.
Find potential entries quicker.
Short Description:
This indicator analyzes 6 markets and one spread (or 7 and no spread) against the currently loaded instrument,
with support for complex formulas. This indicator finds positive and negative correlations intrabar and throughout
the specified time frame simultaneously. It employs a weighting system and score threshold
(everything is user-definable) and signals upon positive or negative score. Alerts are included
for intrabar and overall positive and negative correlations.
Detailed description:
This indicator analyzes 6 different markets and 1 spread (or 7 different markets if no spread) and
measures correlations between them. The squares on the background are individual
correlations (intrabar) and the circles to the right-hand side depict whether the markets have risen
or fallen in price since the start of the specified time frame (red/green or gray for neutral).
To the right of the circles you have the instrument numbers. The numbers represent the instruments you
have specified, in order. Above these numbers and circles you will find two square icons.
You will notice the left-most icon has the caption of "Overall Score +" (or -) and the right-most icon
has the caption of "Intrabar Score +" (or -). The overall score measures the correlation score from the
start of the time frame to the present time. The intrabar icon measures the correlation score of
individual candles. The scoring system implements weighting which uses scores for each individual instrument
and all scores are user-definable (positive and negative). There is also a threshold level which is user-definable,
if the score reaches or crosses this level it will trigger the aforementioned signal icons.
The analyzation time frame is decided by the user. The Correlated Market Matrix can calculate from a
given date to present (real-time), or between two specified historic dates.
You are able to represent the correlations using the close (price) of the instrument or an EMA (speed is user-adjustable).
The spread has the individual option to use EMA or close (price) separately from the other instruments.
You have the option to assign the weight of any number (0 to 100) to any instrument if the instrument is bullish.
You additionally have the option of subtracting the numbers if it is bearish (-100 to 0).
You may assign both bullish and bearish weights to each instrument at the same time to obtain maximum balance.
If you do not desire custom weighting, simply leave the weights at 1.
The negative vs positive levels are then measured, and whichever score is the strongest determines if the
square icon displays "Overall Score +" or "Overall Score -" (same for Intrabar).
"Score +" means that the score is equal to or greater than the threshold.
"Score -" means that the score is less than the threshold.
Additionally you are provided the option of visualizing the actual correlation lines. This is useful in the sense that
you may view the direction of that particular secondary instrument without actually opening its chart. The color red
implies that the correlation is falling, while green implies it is rising. Please note that due to
limitations you cannot see the actual correlation value of these lines, and also this is an experimental feature so lines
may not always appear appropriately. In testing a line may vanish momentarily here and there but it is somewhat rare.
The background squares will tell you the actual state of the correlation.
HOW DO YOU READ IT?
The numbers represent the instrument you selected in that number slot.
The circles to the left of the numbers indicate if that market is up or down since the beginning of the specified timeframe.
Red means price is down, green means price is up, gray is neutral.
The icon "Intrabar Score +" or "Intrabar Score -" indicates whether the majority of markets are over their score threshold
(negative or positive correlation) for the current candle only.
If this is "Neutral" then there is no current score.
The icon "Overall Score +" or "Overall Score -" indicated the majority of markets are over their score threshold (negative or
positive correlation) for the OVERALL time frame (start to current, or start to finish if you are not using in real-time).
If this is "Neutral" then there is no current score.
For individual candle correlations, if the secondary instrument is up and the main instrument is down, the boxes are red.
If secondary instrument is down and main instrument is up, boxes are green.
If correlation lines are red then the correlation is becoming negative, if they're green then they're becoming positive.
This does not mean there is a negative or positive correlation, only that the correlation is rising or falling.
The background squares will tell you the state of the correlation.
PLEASE NOTE:
If you are using a white or bright colored chart, click the gear icon next to the indicator name.
Select the "Style" tab. The first option "Time frame Background Color" should be adjusted to either
black or white with no transparency (take note of the slider underneath the color squares).
This will make the matrix appear correctly.
INPUT MENU
By clicking the gear icon next to the indicator name, you are presented with a host of options.
The options are as follows, in order of appearance:
- Correlation Length : Amount of bars to look back for the correlation.
- Show Correlation Lines : Chose whether to display the correlation lines or not.
- Use Rising/Falling Colors : Use rising/falling colors for correlation lines instead of unique colors.
- Instrument Source : Chose from 'Price' or process the instrument through EMA instead.
- Price Source : This source works for both "Price" source and the EMA source.
- EMA Speed : Speed of the EMA if 'Instrument Source' is set to 'EMA'.
- Use EMA on Spread 1 : Use EMA on the 'Spread Instrument 1'. If unchecked, close is used by default.
- Use EMA on Spread 2 : Use EMA on the 'Spread Instrument 2'. If unchecked, close is used by default.
- EMA Speed for Spread 1 : Speed of EMA for Spread 1 if EMA is used instead of 'close'.
- EMA Speed for Spread 2 : Speed of EMA for Spread 2 if EMA is used instead of 'close'.
- Disable Spread and use Instrument 1 as correlated market instead : By default, the indicator takes both spread
instruments and calculates the spread between each (instrument1-instrument2=spread). If this feature is enabled, the indicator
will use only the 'Spread Instrument 1' and calculate it in the same manner as the other markets.
This is useful if you do not wish to use a spread and would rather have an extra market.
- Positive Weight of Instrument (1-7/spread) : Positive weight for the instrument.
It is recommended to enter only positive numbers here. If left 0, no weight will be added to the instrument but the indicator will
signal "Score -" if all others are also 0. If left at 1, if more markets are positive than negative, the indicator will present "Score +".
- Negative Weight of Instrument (1-7/spread) : This works in the same way as positive weight except it is recommended you enter
only negative numbers here (example: -1.5, -20). This number is subtracted from the overall score. If left 0, no weight will be
added to the instrument but the indicator will signal "Score -" if all others are also 0. If left at 1, if more markets are negative than positive,
the indicator will present "Score -".
- Threshold for score to be determined : if the weighting score of the instruments is this number or greater then
the square signal icon of + (greater) or - (lesser) is triggered.
- Instrument (1-6) : This is where you select which instruments/securities you wish to analyze. This input also
supports complex formulas, same as you'd enter them on your chart.
- Spread Instrument 1 : Instrument of part 1 of spread calculation
- Spread Instrument 2 : Instrument of part 2 of spread calculation
- From Month/Day/Year/Hour/Minute : Display data beginning at this specified time.
- To Month/Day/Year/Hour/Minute : Stop analyzing data at this specified time. To have it calculate indefinitely
in real-time, then the "To" settings should be left at Month: 12, Day: 31, Year: 2222, Hour: 23, Minute: 59.
STYLE MENU
- Time frame background color : The background color of the viewing area, especially helpful for white charts where colors may become faded.
- Correlation Line (1-7) : Properties for the displayed lines (if enabled). The first two colors are for rising and falling respectively
(if "Use rising/falling colors" is enabled), the last color is the default color of the line. This last color
will also be used for neutral if "rising/falling" is enabled.
- Instrument Label (1-7,Spread) : Properties for the right-hand numbered column, denoting which line is which instrument.
- Separator (1-8) : Solid lines between instruments
- Price Circle (1-7) : Circles between labels and background colors, denoting price rise/fall.
- Score + or - : Score icon above the instrument numbers
- Fill Row (1-6, Spread) : Background colors for the matrix. Default is red and green.
Have an idea? Customized logic is available for this framework.
This is not financial advice and this indicator system does not guarantee or claim to make profit.
The signals and ideas contained within this page and indicator are provided on an as-is basis. Use at your own risk.
Matrix. PA tool for analyzing the time on charts that can come in and out of the last time for open price, high, low, close and trading volume.
The idea began with the phrase, "Our past is our future."
Genesis Matrix Trading SystemThe original code and strategy was developed by "realjumper" for Metatrader 4:
www.forexfactory.com
The 5-15 Genesis Strategy and Genesis Summary PDF
www.forexfactory.com
EMA is configured as follows:
Length: 5
Source: hlc3
Offset: 2
Please always remember, there is no holy grail indicator!
Matrix ModThis is the Matrix oscillator made by glaz. So credit goes to him.
I made some minor modifications to it:
1. added a zeroline
2. added 3 options to color bars/candles depending on:
- if the oscillator is above/below 0
- if it's oversold/bought*
- if the matrix has a green bar or a red
That's all :)