Turn around Tuesday on Steroids Strategy█ STRATEGY DESCRIPTION
The "Turn around Tuesday on Steroids Strategy" is a mean-reversion strategy designed to identify potential price reversals at the start of the trading week. It enters a long position when specific conditions are met and exits when the price shows strength by exceeding the previous bar's high. This strategy is optimized for ETFs, stocks, and other instruments on the daily timeframe.
█ WHAT IS THE STARTING DAY?
The Starting Day determines the first day of the trading week for the strategy. It can be set to either Sunday or Monday, depending on the instrument being traded. For ETFs and stocks, Monday is recommended. For other instruments, Sunday is recommended.
█ SIGNAL GENERATION
1. LONG ENTRY
A Buy Signal is triggered when:
The current day is the first day of the trading week (either Sunday or Monday, depending on the Starting Day setting).
The close price is lower than the previous day's close (`close < close `).
The previous day's close is also lower than the close two days ago (`close < close `).
The signal occurs within the specified time window (between `Start Time` and `End Time`).
If the MA Filter is enabled, the close price must also be above the 200-period Simple Moving Average (SMA).
2. EXIT CONDITION
A Sell Signal is generated when the current closing price exceeds the high of the previous bar (`close > high `). This indicates that the price has shown strength, potentially confirming the reversal and prompting the strategy to exit the position.
█ ADDITIONAL SETTINGS
Starting Day: Determines the first day of the trading week. Options are Sunday or Monday. Default is Sunday.
Use MA Filter: Enables or disables the 200-period SMA filter for long entries. Default is disabled.
Start Time and End Time: The time window during which the strategy is allowed to execute trades.
█ PERFORMANCE OVERVIEW
This strategy is designed for markets with frequent weekly reversals.
It performs best in volatile conditions where price movements are significant at the start of the trading week.
Backtesting results should be analysed to optimize the Starting Day and MA Filter settings for specific instruments.
指标和策略
Consecutive Bearish Candle Strategy█ STRATEGY DESCRIPTION
The "Consecutive Bearish Candle Strategy" is a momentum-based strategy designed to identify potential reversals after a sustained bearish move. It enters a long position when a specific number of consecutive bearish candles occur and exits when the price shows strength by exceeding the previous bar's high. This strategy is optimized for use on various timeframes and instruments.
█ SIGNAL GENERATION
1. LONG ENTRY
A Buy Signal is triggered when:
The close price has been lower than the previous close for at least `Lookback` consecutive bars. This indicates a sustained bearish move, suggesting a potential reversal.
The signal occurs within the specified time window (between `Start Time` and `End Time`).
2. EXIT CONDITION
A Sell Signal is generated when the current closing price exceeds the high of the previous bar (`close > high `). This indicates that the price has shown strength, potentially confirming the reversal and prompting the strategy to exit the position.
█ ADDITIONAL SETTINGS
Lookback: The number of consecutive bearish bars required to trigger a Buy Signal. Default is 3.
Start Time and End Time: The time window during which the strategy is allowed to execute trades.
█ PERFORMANCE OVERVIEW
This strategy is designed for markets with frequent momentum shifts.
It performs best in volatile conditions where price movements are significant.
Backtesting results should be analysed to optimize the `Lookback` parameter for specific instruments.
4 Bar Momentum Reversal strategy█ STRATEGY DESCRIPTION
The "4 Bar Momentum Reversal Strategy" is a mean-reversion strategy designed to identify price reversals following a sustained downward move. It enters a long position when a reversal condition is met and exits when the price shows strength by exceeding the previous bar's high. This strategy is optimized for indices and stocks on the daily timeframe.
█ WHAT IS THE REFERENCE CLOSE?
The Reference Close is the closing price from X bars ago, where X is determined by the Lookback period. Think of it as a moving benchmark that helps the strategy assess whether prices are trending upwards or downwards relative to past performance. For example, if the Lookback is set to 4, the Reference Close is the closing price 4 bars ago (`close `).
█ SIGNAL GENERATION
1. LONG ENTRY
A Buy Signal is triggered when:
The close price has been lower than the Reference Close for at least `Buy Threshold` consecutive bars. This indicates a sustained downward move, suggesting a potential reversal.
The signal occurs within the specified time window (between `Start Time` and `End Time`).
2. EXIT CONDITION
A Sell Signal is generated when the current closing price exceeds the high of the previous bar (`close > high `). This indicates that the price has shown strength, potentially confirming the reversal and prompting the strategy to exit the position.
█ ADDITIONAL SETTINGS
Buy Threshold: The number of consecutive bearish bars needed to trigger a Buy Signal. Default is 4.
Lookback: The number of bars ago used to calculate the Reference Close. Default is 4.
Start Time and End Time: The time window during which the strategy is allowed to execute trades.
█ PERFORMANCE OVERVIEW
This strategy is designed for trending markets with frequent reversals.
It performs best in volatile conditions where price movements are significant.
Backtesting results should be analysed to optimize the Buy Threshold and Lookback parameters for specific instruments.
Supertrend with Buy/Sell SignalsThis simple Supertrend with Buy/Sell Signals is a trend-following indicator that helps identify market direction and potential entry/exit points. It uses the Average True Range (ATR) to calculate a dynamic support and resistance line:
Buy Signal: A green "BUY" label appears when the price crosses above the Supertrend line, indicating a possible bullish trend.
Sell Signal: A red "SELL" label appears when the price crosses below the Supertrend line, signaling a potential bearish trend.
The indicator also adapts to market volatility and displays the trend line in green for uptrends and red for downtrends. It is best used in trending markets.
DCA Simulation for CryptoCommunity v1.1Overview
This script provides a detailed simulation of a Dollar-Cost Averaging (DCA) strategy tailored for crypto traders. It allows users to visualize how their DCA strategy would perform historically under specific parameters. The script is designed to help traders understand the mechanics of DCA and how it influences average price movement, budget utilization, and trade outcomes.
Key Features:
Combines Interval and Safety Order DCA:
Interval DCA: Regular purchases based on predefined time intervals.
Safety Order DCA: Additional buys triggered by percentage price drops.
Interactive Visualization:
Displays buy levels, average price, and profit-taking points on the chart.
Allows traders to assess how their strategy adapts to price movements.
Comprehensive Dashboard:
Tracks money spent, contracts acquired, and budget utilization.
Shows maximum amounts used if profit-taking is active.
Dynamic Safety Orders:
Resets safety orders when a new higher high is established.
Customizable Parameters:
Adjustable buy frequency, safety order settings, and profit-taking levels.
Suitable for traders with varying budgets and risk tolerances.
Default Strategy Settings:
Account Size: Default account size is set to $10,000 to represent a realistic budget for the average trader.
Commission & Slippage: Includes realistic trading fees and slippage assumptions to ensure accurate backtesting results.
Risk Management: Defaults to risking no more than 5% of the account balance per trade.
Sample Size: Optimized to generate a minimum of 100 trades for meaningful statistical analysis. Users can adjust parameters to fit longer timeframes or different datasets.
Usage Instructions:
Configure Your Strategy: Set the base order, safety order size, and buy frequency based on your preferred DCA approach.
Analyze Historical Performance: Use the chart and dashboard to understand how the strategy performs under different market conditions.
Optimize Parameters: Adjust settings to align with your risk tolerance and trading objectives.
Important Notes:
This script is for educational and simulation purposes. It is not intended to provide financial advice or guarantee profitability.
If the strategy's default settings do not meet your needs, feel free to adjust them while keeping risk management in mind.
TradingView limits the number of open trades to 999, so reduce the buy frequency if necessary to fit longer timeframes.
One Shot One Kill ICT [TradingFinder] Liquidity MMXM + CISD OTE🔵 Introduction
The One Shot One Kill trading setup is one of the most advanced methods in the field of Smart Money Concept (SMC) and ICT. Designed with a focus on concepts such as Liquidity Hunt, Discount Market, and Premium Market, this strategy emphasizes precise Price Action analysis and market structure shifts. It enables traders to identify key entry and exit points using a structured Trading Model.
The core process of this setup begins with a Liquidity Hunt. Initially, the price targets areas like the Previous Day High and Previous Day Low to absorb liquidity. Once the Change in State of Delivery(CISD)is broken, the market structure shifts, signaling readiness for trade entry. At this stage, Fibonacci retracement levels are drawn, and the trader enters a position as the price retraces to the 0.618 Fibonacci level.
Part of the Smart Money approach, this setup combines liquidity analysis with technical tools, creating an opportunity for traders to enter high-accuracy trades. By following this setup, traders can identify critical market moves and capitalize on reversal points effectively.
Bullish :
Bearish :
🔵 How to Use
The One Shot One Kill setup is a structured and advanced trading strategy based on Liquidity Hunt, Fibonacci retracement, and market structure shifts (CISD). With a focus on precise Price Action analysis, this setup helps traders identify key market movements and plan optimal trade entries and exits. It operates in two scenarios: Bullish and Bearish, each with distinct steps.
🟣 Bullish One Shot One Kill
In the Bullish scenario, the process starts with the price moving toward the Previous Day Low, where liquidity is absorbed. At this stage, retail sellers are trapped as they enter short trades at lower levels. Following this, the market reverses upward and breaks the CISD, signaling a shift in market structure toward bullishness.
Once this shift is identified, traders draw Fibonacci levels from the lowest point to the highest point of the move. When the price retraces to the 0.618 Fibonacci level, conditions for a buy position are met. The target for this trade is typically the Previous Day High or other significant liquidity zones where major buyers are positioned, offering a high probability of price reversal.
🟣 Bearish One Shot One Kill
In the Bearish scenario, the price initially moves toward the Previous Day High to absorb liquidity. Retail buyers are trapped as they enter long trades near the highs. After the liquidity hunt, the market reverses downward, breaking the CISD, which signals a bearish shift in market structure. Following this confirmation, Fibonacci levels are drawn from the highest point to the lowest point of the move.
When the price retraces to the 0.618 Fibonacci level, a sell position is initiated. The target for this trade is usually the Previous Day Low or other key liquidity zones where major sellers are active.
This setup provides a precise and logical framework for traders to identify market movements and enter trades at critical reversal points.
🔵 Settings
🟣 CISD Logical settings
Bar Back Check : Determining the return of candles to identify the CISD level.
CISD Level Validity : CISD level validity period based on the number of candles.
🟣 LIQUIDITY Logical settings
Swing period : You can set the swing detection period.
Max Swing Back Method : It is in two modes "All" and "Custom". If it is in "All" mode, it will check all swings, and if it is in "Custom" mode, it will check the swings to the extent you determine.
Max Swing Back : You can set the number of swings that will go back for checking.
🟣 CISD Display settings
Displaying or not displaying swings and setting the color of labels and lines.
🟣 LIQUIDITY Display settings
Displaying or not displaying swings and setting the color of labels and lines.
🔵 Conclusion
The One Shot One Kill setup is one of the most effective and well-structured trading strategies for identifying and capitalizing on key market movements. By incorporating concepts such as Liquidity Hunt, CISD, and Fibonacci retracement, this setup allows traders to enter trades with high precision at optimal points.
The strategy emphasizes detailed Price Action analysis and the identification of Smart Money behavior, helping traders to execute successful trades against the general market trend.
With a focus on identifying liquidity in the Previous Day High and Low and aligning it with Fibonacci retracement levels, this setup provides a robust framework for entering both bullish and bearish trades.
The combination of liquidity analysis and Fibonacci retracement at the 0.618 level enables traders to minimize risk and exploit major market moves effectively.
Ultimately, success with the One Shot One Kill setup requires practice, patience, and strict adherence to its rules. By mastering its concepts and focusing on high-probability setups, traders can enhance their decision-making skills and build a sustainable and professional trading approach.
RSI MACD Combined Color StrategyOverview
This indicator combines RSI and MACD signals to create a powerful visual trading system, inspired by TrendSpider's AI Strategy Coder examples. It colors candles based on the alignment of three key technical conditions, providing clear visual signals for potential trend strength and direction.
Technical Components
Core Conditions
RSI (Relative Strength Index) > 50
Indicates bullish momentum when price is trading above the centerline
Traditional indicator of trend strength
MACD Line > Signal Line
Shows positive momentum
Classic signal for potential upward movement
MACD Line > 0
Confirms bullish territory
Indicates overall positive momentum
Color Coding System
🟢 Green Candles: All three conditions are met
Strongest bullish signal
Suggests high probability trading opportunities
⚪ Grey Candles: One or two conditions are met
Neutral or transitioning market
Suggests caution or waiting for stronger confirmation
🔴 Red Candles: No conditions are met
Bearish signal
Suggests potential downward pressure
How to Use This Indicator
For Entry Signals
Look for transitions from red or grey to green candles
Green candles suggest strong bullish alignment
Consider entering long positions when candles turn green
For Exit Signals
Watch for color transitions from green to grey or red
Consider taking profits when candles change from green to grey
Consider stop losses when candles turn red
Risk Management
Use color transitions as part of your broader strategy
Don't rely solely on color changes for trading decisions
Combine with other technical analysis tools and risk management practices
Customizable Parameters
RSI Length (default: 14)
MACD Fast Length (default: 12)
MACD Slow Length (default: 26)
MACD Signal Length (default: 9)
Best Practices
Use multiple timeframes for confirmation
Look for confluences with support/resistance levels
Consider volume and market context
Start with default settings and adjust based on your trading style
Backtest different parameter combinations
Notes
This indicator works best in trending markets
Grey candles can indicate transition periods
Consider market conditions and volatility when interpreting signals
Credits
Inspired by TrendSpider's AI Strategy Coder examples and adapted for TradingView using Pine Script v5.
Disclaimer
This technical indicator is for informational purposes only. Always conduct your own analysis and consider risk management principles before making trading decisions. Past performance does not guarantee future results.
Professional GBP/JPY Analysis ToolThe foundation of professional trading begins with analyzing individual currencies first, not just currency pairs. By understanding the relative strength of each currency in the pair, traders can anticipate potential market moves with greater accuracy.
This indicator simplifies that process by:
Analyzing Individual Currency Strength:
The strength of GBP is calculated by averaging its performance across seven major GBP currency pairs:
GBP/EUR
GBP/USD
GBP/CAD
GBP/CHF
GBP/AUD
GBP/NZD
GBP/JPY
The strength of JPY is calculated by averaging its performance across seven major JPY currency pairs:
JPY/USD
JPY/CAD
JPY/EUR
JPY/GBP
JPY/AUD
JPY/NZD
JPY/CHF
The values are normalized to allow direct comparison on the same scale.
Identifying Correlation Between GBP and JPY:
The histogram displays the correlation between GBP and JPY strength:
Positive Correlation (Green): Both GBP and JPY are trending up or down together, indicating a less strong trend. This is a market condition to avoid, as both currencies are strengthening or weakening simultaneously.
Negative Correlation (Red): One currency is strong while the other is weak, indicating a stronger trend in GBP/JPY. This scenario presents a better trading opportunity, as you are trading one strong currency against one weak currency, amplifying the potential for a clearer price movement in GBP/JPY.
Visualizing Long/Short Bias:
GBP Strength > JPY Strength: Bullish bias for GBP/JPY (green background).
JPY Strength > GBP Strength: Bearish bias for GBP/JPY (red background).
This indicator equips traders with a deeper understanding of GBP/JPY dynamics by first breaking down the individual currencies. With insights into currency strength, their correlation, and the optimal conditions for trading, it provides a solid foundation for making informed trading decisions.
How to Use:
Check the Histogram for Correlation:
Wait for the histogram to be red. This indicates that GBP and JPY are moving in opposite directions, signaling a stronger trend where you're trading a strong currency against a weak one—a more favorable setup.
Align with Background Color for Confirmation:
Wait for the background color to match your trade plan:
Green Background: Confirms a bullish bias, supporting long positions on the GBP/JPY pair.
Red Background: Confirms a bearish bias, supporting short positions on the GBP/JPY pair.
By following these steps, you can identify stronger trade opportunities and align them with your strategy.
Bearish Gap Down DetectionThis indicator is designed to identify bearish gap downs in price action and visually mark them on your chart. A gap down occurs when today's opening price is below the previous day's low, and the closing price remains below that low, signaling a potential bearish continuation or reversal.
Features:
Precise Gap Down Detection: Identifies only confirmed bearish gap downs, avoiding false signals.
Clear Visual Markers: Marks detected gap downs with a red downward triangle above the bar for easy identification.
Minimalist Design: Focuses solely on gap down detection, without any reliance on moving averages or additional noise.
Use Cases:
Trend Reversals: Spot potential downward trends as they develop.
Momentum Confirmation: Use alongside other indicators or strategies to confirm bearish momentum.
Swing Trading Opportunities: Ideal for traders looking to capitalize on significant price movements.
How It Works:
The script detects a gap down when:
Today's opening price is below the previous day's low.
Today's closing price stays below the previous day's low.
When these conditions are met, the indicator plots a red triangle above the price bar, signaling a bearish gap down.
Best Practices:
Apply this script to daily or higher timeframes for more reliable results.
Combine it with other indicators, such as support/resistance levels or volume analysis, for enhanced decision-making.
PV's Dual RSI Crossover StrategyIntroduction to the Dual RSI Two-Cross Indicator
The Relative Strength Index (RSI) is a widely used technical indicator in finance that measures the magnitude of recent price changes to determine overbought or oversold conditions. The RSI Two-Cross indicator takes this concept a step further by introducing a unique twist: it plots two RSI lines with different lengths and generates alerts based on their crossovers.
Key Features:
Dual RSI Lines: The indicator plots two RSI lines with user-defined lengths, allowing traders to compare the short-term and long-term momentum of an asset.
Crossover Alerts: The indicator generates alerts when the shorter RSI line crosses above or below the longer RSI line, indicating potential trend reversals or continuations.
Customizable Parameters: Users can adjust the lengths of the RSI lines, oversold and overbought levels, and other parameters to suit their trading strategy and asset of choice.
Visual Aids: The indicator features colored bars and backgrounds to highlight crossover events, making it easy to identify trading opportunities at a glance.
Trading Applications:
Trend Reversal Detection: The RSI Two-Cross indicator can help traders identify potential trend reversals by monitoring crossovers between the two RSI lines.
Momentum Confirmation: The indicator can be used to confirm momentum shifts in an asset's price, helping traders to filter out false signals and make more informed trading decisions.
Scalping and Day Trading: The indicator's short-term focus makes it suitable for scalping and day trading strategies, where traders aim to capitalize on small price movements.
By combining the versatility of the RSI with the power of crossover analysis, the RSI Two-Cross indicator offers a unique perspective on market momentum and trend dynamics. Whether you're a seasoned trader or just starting out, this indicator can help you navigate the markets with greater confidence and precision.
Custom ROCThe Custom ROC allows you to set the length of the ROC. You can also set a reference value and an upward deviation. The sum of the reference value and deviation is shown as a green line.
Price Move DetectorThe Price Move Detector is a powerful technical analysis tool that automatically detects and highlights significant price movements over a user-defined time frame. This indicator allows traders to quickly identify instances where an asset has experienced a large price change, making it easier to spot potential trading opportunities.
Key Features
Customizable Parameters: Adjust the percentage change and time period (bars or sessions) to define what qualifies as a "significant" price move.
Automatic Highlighting: The indicator overlays a background highlight on the chart whenever the price moves by the specified percentage within the chosen time period.
Flexible Time Frame: Use this indicator across various timeframes and adjust the settings to suit your trading strategy, such as detecting 100% price moves over 20 sessions.
Ideal for Historical Analysis: Perfect for backtesting and screening for past price surges, helping traders spot explosive price action and market trends.
Use Cases
Spot Potential Breakouts: Use the detector to identify stocks or assets that have made significant moves, potentially signaling the start of a breakout or new trend.
Quickly Identify Major Market Moves: Scan historical data to pinpoint times when an asset experienced substantial price changes, providing insight into past performance and future potential.
How to Use
Customize the Settings
Percentage Threshold: Set the minimum percentage increase (e.g., 50%, 100%) that qualifies as a significant move. You can experiment with different percentages to suit your analysis.
Time Period (Bars): Define the lookback period (in bars/sessions) over which the price move should be measured. For example, set it to 20 bars for a one-month time frame on a daily chart.
Analyze the Highlights
Whenever the price increases by the defined percentage over the set period, the indicator will highlight that section of the chart with a background color.
The highlighted sections will make it easy to identify historical periods of large price movements, which can be useful for spotting trends, potential breakouts, or other market behaviors.
Adjust the Parameters for Your Strategy
You can fine-tune the settings to detect smaller or larger price moves depending on your trading goals.
The indicator is flexible enough for use on different timeframes and assets, providing valuable insights across various markets.
TD Supply & Demand Points ```
TD Supply & Demand Points Indicator
This technical indicator helps identify potential supply and demand zones using price action pattern recognition. It scans for specific candle formations that may indicate institutional trading activity and potential reversal points.
Features:
• Two pattern detection modes:
Level 1: Basic 3-candle pattern for faster signals
Level 2: Advanced 5-candle pattern for higher probability setups
• Clear visual markers:
- Red X above bars for supply points
- Green X below bars for demand points
- Automatic offset adjustment based on pattern level
Pattern Definitions:
Level 1 (3-candle pattern):
Supply: Middle candle's high is higher than both surrounding candles
Demand: Middle candle's low is lower than both surrounding candles
Level 2 (5-candle pattern):
Supply: Sequence showing distribution with higher highs followed by lower highs
Demand: Sequence showing accumulation with lower lows followed by higher lows
Usage Tips:
• Use Level 1 for more frequent signals and Level 2 for stronger setups
• Look for confluence with key support/resistance levels
• Consider overall market context and trend
• Can be used across multiple timeframes
• Best combined with volume and price action analysis
Settings:
Pattern Level: Toggle between Level 1 (3-candle) and Level 2 (5-candle) patterns
Note: This indicator is designed to assist in identifying potential trading opportunities but should be used as part of a comprehensive trading strategy with proper risk management.
Version: 5.0
```
I've written this description to be:
1. Clear and concise
2. Technically accurate
3. Helpful for both new and experienced traders
4. Professionally formatted for TradingView
5. Focused on the key features and practical usage
Would you like me to modify any part of it or add more specific details about certain aspects?
Cumulative Price AverageThe Cumulative Price Average (CPA) indicator calculates and plots the overall average of candlestick prices, providing a smoothed representation of the market's long-term price trend. This is achieved by aggregating the averages of each candle (Open, High, Low, Close) and dynamically updating the overall average as new candles are added.
Key Features
Long-Term Price Perspective: Displays the cumulative average of all candles from the start of the chart.
Trend Visualization: Smooths out short-term price fluctuations to highlight the overall trend.
Dynamic Updates: The average adjusts with each new bar for real-time analysis.
Usage
Trend Analysis:
Identify long-term bullish or bearish trends by observing the slope of the CPA line.
Support/Resistance:
The CPA line can act as a dynamic support or resistance level for the price.
Price Comparison:
Compare the current price to the CPA to assess whether the market is overbought or oversold relative to its historical average.
This indicator is especially useful for traders seeking to incorporate a historical perspective into their analysis, providing insights into the broader market behavior beyond short-term volatility.
Three Candle Breakout Marker**Title: Three Candle Breakout Marker**
**Description:**
The **Three Candle Breakout Marker** is a powerful trading indicator designed for traders who want to identify significant price movements based on recent price action. This script marks candles that break above the highest high or below the lowest low of the previous three candles, providing clear visual signals for potential trading opportunities.
### Key Features:
- **Visual Indicators**: The indicator uses upward blue triangles to signify when a candle closes above the highest high of the last three candles, indicating a bullish breakout. Conversely, it uses downward orange triangles to mark when a candle closes below the lowest low of the last three candles, signaling a bearish breakout.
- **Customizable Alerts**: Traders can easily customize this indicator to suit their trading strategies by adjusting colors and sizes for better visibility on their charts.
- **Enhanced Chart Analysis**: With optional horizontal lines drawn at the breakout levels, traders can quickly assess key support and resistance areas, enhancing their decision-making process.
### How to Use:
1. **Add to Chart**: Simply add the indicator to your TradingView chart for any asset or timeframe you are analyzing.
2. **Identify Breakouts**: Look for blue triangles above candles for bullish breakout signals and orange triangles below candles for bearish breakout signals.
3. **Combine with Other Tools**: Use this indicator in conjunction with other technical analysis tools and indicators to confirm signals and improve your trading strategy.
### Conclusion:
The **Three Candle Breakout Marker** is an essential tool for traders looking to capitalize on momentum shifts in the market. By clearly marking breakout points, it helps traders make informed decisions and enhances their ability to react swiftly to changing market conditions.
Feel free to explore and customize this indicator to fit your trading style! Happy trading!
Wick Volume AlertThis indicator is intended to find a possible price reversal and is well suited for scalping in the smaller timeframes from 1 to 15min chart. It is important to use it in conjunction with other indicators such as order blocks or price levels.
The advantage over other Wick indicators is that volume is also taken into account.
Unfortunately, the markers on the chart do not work properly as they do not attach themselves when moving vertically. I would be happy if someone could fix the problem, as I am not a professional in Pine scripting.
Yearly Open LevelsThe Yearly Open Levels indicator is designed to help traders visualize the opening price of each year on a price chart.
Key Features:
Yearly Open Display: Automatically calculates and displays the opening price for each year starting from a user-defined starting year. This helps traders quickly spot where the price opens each year.
Customizable Start Year: Users can set a specific year to begin displaying opening levels. The default starting year is 2022, but this can be adjusted based on individual trader needs.
Visual Lines and Labels: Each yearly open is represented by a horizontal line that extends to the right of the chart, making it easy to see the level throughout the year.
A label is placed next to the line, indicating the year and the opening price, enhancing clarity and reference while analyzing price movements.
Color Customization: Traders can choose the color of the lines and labels to fit their charting style or preferences, enhancing the visual representation on different market charts.
Demand and Supply Zones Intraday Strategy(SAMARESH PANDA)Explanation:
Input Parameters:
length: Determines the number of bars to look back for identifying the highest and lowest prices to mark demand and supply zones.
zoneBuffer: A buffer in pips to place the stop and limit orders near the identified demand and supply zones.
Demand and Supply Zones:
The script identifies demand zones as the lowest low over the past length bars and supply zones as the highest high over the same period.
Buy (Long) Condition:
A buy signal is generated when the price crosses above the demand zone from below and the price closes above the demand zone.
Sell (Short) Condition:
A sell signal is generated when the price crosses below the supply zone from above and the price closes below the supply zone.
Stop and Limit Orders:
For long trades, the stop is placed just below the demand zone (zoneBuffer), and the limit is placed just above the demand zone.
For short trades, the stop is placed just above the supply zone (zoneBuffer), and the limit is placed just below the supply zone.
Exit Conditions:
The long position is closed when the price moves above the supply zone.
The short position is closed when the price moves below the demand zone.
Additional Notes:
Customization: You can modify the length and zoneBuffer values to adjust how sensitive the strategy is to price action and the zone buffers.
Risk Management: You may want to add additional filters for volume, indicators like RSI/MACD, or other market conditions to filter out false signals.
Testing & Optimization: As with any strategy, it's important to backtest and optimize it according to your preferred market conditions and risk tolerance.
Using the Strategy:
Apply the script to a 1-hour or 30-minute chart for identifying the demand and supply zones.
For better precision in entry, you can switch to a lower timeframe (like 5-minute or 15-minute) to execute your trades more accurately when the price reaches a demand or supply zone.
The buy and sell signals will appear on the chart as green (BUY) and red (SELL) labels.
Example of Execution:
Long Entry: The price closes above the demand zone and crosses up. A long position is opened with a stop below the demand zone and a limit near it.
Short Entry: The price closes below the supply zone and crosses down. A short position is opened with a stop above the supply zone and a limit near it.
This strategy works best in trending markets where price tends to respect these zones. Make sure to monitor the strategy closely and adjust it based on market volatility or changes in the broader trend.
You said:
create a pine script pivot point standard for buy sell
ChatGPT said:
ChatGPT
Sure! Below is a Pine Script that implements the Pivot Point Standard for intraday trading, with buy and sell signals based on the pivot point strategy.
Pivot points are calculated based on the previous day’s high, low, and close prices, and they are widely used in intraday trading to determine potential support and resistance levels.
Intraday Chaos FilterIntraday trading requires precise tools and strategies to navigate the chaotic fluctuations of the market. The "Intraday Chaos Filter" indicator is designed to provide traders with a systematic approach to managing market noise. This Pine Script™ indicator helps identify potential trend shifts and provides a visual representation of price action, aiding in making informed trading decisions. By focusing on reducing market chaos, it aims to provide a clearer picture of the underlying trend, regardless of the volatility.
At the heart of the indicator lies the multiplier input, a customizable setting that adjusts the sensitivity of the filter. The multiplier directly influences the chaos threshold by determining the percentage deviation allowed before signaling a trend reversal. A higher multiplier results in a less sensitive filter, reducing the number of signals during minor price fluctuations. This flexibility allows traders to adapt the indicator to different trading styles and market conditions, making it versatile for a range of intraday strategies.
The "Intraday Chaos Filter" operates by tracking two key price levels: src1 and src2, representing the highest and lowest prices during a trend. These levels are dynamically adjusted based on the closing price, ensuring that the indicator adapts in real time. The trend direction is determined by comparing the current price against a calculated filter level. When the price crosses the threshold in either direction, it signals a potential trend reversal, marked by a change in candle colors on the chart. Green represents an upward trend, while red signifies a downward trend, making it visually intuitive for traders.
This indicator's simplicity and clarity make it a valuable addition to any trader's toolkit. By focusing on trend direction and filtering out minor fluctuations, it helps traders stay focused on significant market movements. The integration of customizable settings ensures adaptability to various trading preferences, providing both novice and experienced traders with a reliable tool for intraday decision-making. The "Intraday Chaos Filter" offers an effective way to navigate market noise, enabling traders to identify opportunities with confidence.
Previous D, W, M High/LowThis indicator plots previous day's high,low,open and close values and plots previous week's and month's high and low value on the chart.
Composite Indicator (CCI + ATR)Composite Indicator (CCI + ATR)
The Composite Indicator (CCI + ATR) combines the Commodity Channel Index (CCI) with the Average True Range (ATR) , providing traders with a dynamic tool for identifying entry and exit points based on momentum and volatility. This indicator is particularly useful for markets like cryptocurrencies, which often exhibit sharp sell-offs and gradual upward trends.
Key Features
Momentum Analysis with CCI: The CCI calculates price momentum by comparing the current price level to its average over a specific period. The indicator generates signals when CCI crosses predefined thresholds.
- Buy Signal: Triggered when CCI crosses above the lower threshold (e.g., -100).
- Sell Signal: Triggered when CCI crosses below the upper threshold (e.g., +100).
Volatility Filtering with ATR: The ATR measures market volatility, ensuring signals occur only during significant price movements.
Separate multipliers for buy and sell signals allow tailored filtering based on market behavior.
Stop Loss Calculation: Dynamic stop loss levels are calculated using the ATR multiplier to adapt to market volatility, offering better risk management.
How It Works
CCI Calculation: The CCI is calculated using the typical price ((High + Low + Close) / 3) and a user-defined length. It detects momentum changes by measuring deviations from the average price.
ATR Calculation: The ATR determines the average price range over a specified period, identifying the market’s volatility. The ATR SMA acts as a baseline to filter signals.
Buy Signal: A buy signal is triggered when:
- CCI crosses above the lower threshold (e.g., -100).
- ATR exceeds its SMA multiplied by the buy multiplier (e.g., 1.0).
Sell Signal: A sell signal is triggered when:
- CCI crosses below the upper threshold (e.g., +100).
- ATR exceeds its SMA multiplied by the sell multiplier (e.g., 0.95).
Stop Loss Integration:
- Long positions: Stop loss = Low – (ATR * ATR Multiplier)
- Short positions: Stop loss = High + (ATR * ATR Multiplier)
Advantages
Combines momentum (CCI) and volatility (ATR) for precise signal generation.
Customizable thresholds and multipliers for different market conditions.
Dynamic stop loss ensures better risk management in volatile markets.
Suggested Parameter Settings
CCI Length: 20 (default). Adjust as follows:
- 10–15: Shorter timeframes (e.g., 5-15 minutes).
- 20: General use for 1-hour timeframes.
- 30–50: Longer timeframes (e.g., 4-hour or daily charts).
CCI Threshold: 100 (default). Adjust as follows:
- 50–75: For more frequent signals in ranging markets.
- 100: Balanced for most trading conditions.
- 150–200: For strong trends to reduce noise.
ATR Length: 14 (default). Adjust as follows:
- 10–14: For assets with moderate volatility.
- 20: For assets with lower volatility.
ATR Buy Multiplier: 1.0 (default). Adjust as follows:
- 0.9–1.0: For gradual uptrends in crypto markets.
- 1.1–1.2: For stronger trend filtering.
ATR Sell Multiplier: 0.95 (default). Adjust as follows:
- 0.8–0.95: For sharp sell-offs.
- 1.0–1.1: For stable downward trends.
ATR Multiplier (Stop Loss): 1.5 (default). Adjust as follows:
- 1.0–1.2: For shorter timeframes or less volatile markets.
- 2.0–2.5: For highly volatile markets like cryptocurrencies.
Example Use Cases
Scalping (5-15 minute charts): Use CCI Length = 10, CCI Threshold = 75, ATR Buy Multiplier = 0.9, ATR Sell Multiplier = 0.8.
Day Trading (1-hour charts): Use CCI Length = 20, CCI Threshold = 100, ATR Buy Multiplier = 1.0, ATR Sell Multiplier = 0.95.
Swing Trading (4-hour or daily charts): Use CCI Length = 30, CCI Threshold = 150, ATR Buy Multiplier = 1.2, ATR Sell Multiplier = 1.0.
Final Thoughts The Composite Indicator (CCI + ATR) is a versatile tool designed to enhance trading decisions by combining momentum analysis with volatility filtering. Whether scalping or swing trading, this indicator provides actionable insights and robust risk management to navigate complex markets effectively.
Dynamic Customizable 50% Line & Daily High/Low + True Day OpenA Unique Indicator for Precise Market-Level Analysis
This indicator is a fully integrated solution that automates complex market-level calculations and visualizations, offering traders a tool that goes beyond the functionality of existing open-source alternatives. By seamlessly combining several trading concepts into a single script, it delivers efficiency, accuracy, and customization that cater to both novice and professional traders.
Key Features: A Breakdown of What Makes It Unique
1. Adaptive Daily Highs and Lows
Automatically detects and plots daily high and low levels based on the selected time frame, dynamically updating in real time.
Features session-based adjustments, allowing traders to focus on levels that matter for specific trading sessions (e.g., London, New York).
Fully customizable styling, visibility, and alerts tailored to each trader’s preferences.
How It Works:
The indicator calculates daily high and low levels directly from price data, integrating session-specific time offsets to account for global trading hours. These levels provide traders with clear visual markers for key liquidity zones.
2. Automated ICT 50% Range Line
A pioneering implementation of ICT’s mid-range concept, this feature dynamically calculates and displays the midpoint of the daily range.
Offers traders a visual guide to identify premium and discount zones, aiding in determining market bias and potential trade setups.
How It Works:
The script calculates the range between the day’s high and low, dividing it by two to generate the midline. This line updates in real-time, ensuring that traders always see the most current premium and discount levels as price action evolves.
3. Dynamic Market Open Levels
Plots session opens (e.g., Asia, London, New York) and the True Day Open to provide actionable reference points for intra-day trading strategies.
Enhances precision in identifying liquidity shifts and aligning trades with institutional price movements.
How It Works:
The indicator uses predefined session times to calculate and display the opening levels for key trading sessions. It dynamically adjusts for time zones, ensuring accuracy regardless of the trader’s location.
4. Custom Watermark for Enhanced Visualization
Includes an optional watermark feature that allows users to display custom text on their charts.
Ideal for personalization, branding, or highlighting session notes without disrupting the clarity of the chart.
Why This Indicator Stands Out
First-to-Market Automation:
While the ICT 50% range line is a widely recognized concept, this is the first script to automate its calculation, combining it with other pivotal trading levels in a single tool.
All-in-One Functionality:
Unlike open-source alternatives that focus on individual features, this script integrates daily highs/lows, mid-range levels, session opens, and customizable watermarks into one cohesive system. The consolidation reduces the need for multiple indicators and ensures a clean, efficient chart setup.
Dynamic Customization:
Every feature can be adjusted to align with a trader’s strategy, time zone, or aesthetic preferences. This level of adaptability is unmatched in existing tools.
Proprietary Logic:
The indicator’s underlying calculations are built from scratch, leveraging advanced programming techniques to ensure accuracy and reliability. These proprietary methods differentiate it from similar open-source scripts.
How to Use This Indicator
Apply the Indicator:
Add it to your TradingView chart from the library.
Configure Settings:
Use the intuitive settings panel to adjust plotted levels, colors, styles, and visibility. Tailor the indicator to your trading strategy.
Incorporate into Analysis:
Combine the plotted levels with your preferred trading approach to identify liquidity zones, establish market bias, and pinpoint potential reversals or entries.
Stay Focused:
With all key levels automated and updated in real time, traders can focus on execution rather than manual plotting.
Originality and Justification for Closed Source
This script is closed-source due to its unique combination of features and proprietary logic that automates complex trading concepts like the ICT 50% range line and session-specific levels. Open-source alternatives lack this level of integration and customization, making this indicator a valuable and original contribution to the TradingView ecosystem.
What Sets It Apart from Open-Source Scripts?
Unlike open-source tools, this indicator doesn’t just replicate individual features—it enhances and integrates them into a seamless, all-in-one solution that offers traders a more efficient and effective way to analyze the market.
Geo. Geo.
This library provides a comprehensive set of geometric functions based on 2 simple types for point and line manipulation, point array calculations, some vector operations (Borrowed from @ricardosantos ), angle calculations, and basic polygon analysis. It offers tools for creating, transforming, and analyzing geometric shapes and their relationships.
View the source code for detailed documentation on each function and type.
═════════════════════════════════════════════════════════════════════════
█ OVERVIEW
This library enhances TradingView's Pine Script with robust geometric capabilities. It introduces the Point and Line types, along with a suite of functions for various geometric operations. These functionalities empower you to perform advanced calculations, manipulations, and analyses involving points, lines, vectors, angles, and polygons directly within your Pine scripts. The example is at the bottom of the script. ( Commented out )
█ CONCEPTS
This library revolves around two fundamental types:
• Point: Represents a point in 2D space with x and y coordinates, along with optional 'a' (angle) and 'v' (value) fields for versatile use. Crucially, for plotting, utilize the `.to_chart_point()` method to convert Points into plottable chart.point objects.
• Line: Defined by a starting Point and a slope , enabling calculations like getting y for a given x, or finding intersection points.
█ FEATURES
• Point Manipulation: Perform operations like addition, subtraction, scaling, rotation, normalization, calculating distances, dot products, cross products, midpoints, and more with Point objects.
• Line Operations: Create lines, determine their slope, calculate y from x (and vice versa), and find the intersection points of two lines.
• Vector Operations: Perform vector addition, subtraction, multiplication, division, negation, perpendicular vector calculation, floor, fractional part, sine, absolute value, modulus, sign, round, scaling, rescaling, rotation, and ceiling operations.
• Angle Calculations: Compute angles between points in degrees or radians, including signed, unsigned, and 360-degree angles.
• Polygon Analysis: Calculate the area, perimeter, and centroid of polygons. Check if a point is inside a given polygon and determine the convex hull perimeter.
• Chart Plotting: Conveniently convert Point objects to chart.point objects for plotting lines and points on the chart. The library also includes functions for plotting lines between individual and series of points.
• Utility Functions: Includes helper functions such as square root, square, cosine, sine, tangent, arc cosine, arc sine, arc tangent, atan2, absolute distance, golden ratio tolerance check, fractional part, and safe index/check for chart plotting boundaries.
█ HOW TO USE
1 — Include the library in your script using:
import kaigouthro/geo/1
2 — Create Point and Line objects:
p1 = geo.Point(bar_index, close)
p2 = geo.Point(bar_index , open)
myLine = geo.Line(p1, geo.slope(p1, p2))
// maybe use that line to detect a crossing for an alert ... hmmm
3 — Utilize the provided functions:
distance = geo.distance(p1, p2)
intersection = geo.intersection(line1, line2)
4 — For plotting labels, lines, convert Point to chart.point :
label.new(p1.to_chart_point(), " Hi ")
line.new(p1.to_chart_point(),p2.to_chart_point())
█ NOTES
This description provides a concise overview. Consult the library's source code for in-depth documentation, including detailed descriptions, parameter types, and return values for each function and method. The source code is structured with comprehensive comments using the `//@` format for seamless integration with TradingView's auto-documentation features.
█ Possibilities..
Library "geo"
This library provides a comprehensive set of geometric functions and types, including point and line manipulation, vector operations, angle calculations, and polygon analysis. It offers tools for creating, transforming, and analyzing geometric shapes and their relationships.
sqrt(value)
Square root function
Parameters:
value (float) : (float) - The number to take the square root of
Returns: (float) - The square root of the input value
sqr(x)
Square function
Parameters:
x (float) : (float) - The number to square
Returns: (float) - The square of the input value
cos(v)
Cosine function
Parameters:
v (float) : (series float) - The value to find the cosine of
Returns: (series float) - The cosine of the input value
sin(v)
Sine function
Parameters:
v (float) : (series float) - The value to find the sine of
Returns: (series float) - The sine of the input value
tan(v)
Tangent function
Parameters:
v (float) : (series float) - The value to find the tangent of
Returns: (series float) - The tangent of the input value
acos(v)
Arc cosine function
Parameters:
v (float) : (series float) - The value to find the arc cosine of
Returns: (series float) - The arc cosine of the input value
asin(v)
Arc sine function
Parameters:
v (float) : (series float) - The value to find the arc sine of
Returns: (series float) - The arc sine of the input value
atan(v)
Arc tangent function
Parameters:
v (float) : (series float) - The value to find the arc tangent of
Returns: (series float) - The arc tangent of the input value
atan2(dy, dx)
atan2 function
Parameters:
dy (float) : (float) - The y-coordinate
dx (float) : (float) - The x-coordinate
Returns: (float) - The angle in radians
gap(_value1, __value2)
Absolute distance between any two float values
Parameters:
_value1 (float) : First value
__value2 (float)
Returns: Absolute Positive Distance
phi_tol(a, b, tolerance)
Check if the ratio is within the tolerance of the golden ratio
Parameters:
a (float) : (float) The first number
b (float) : (float) The second number
tolerance (float) : (float) The tolerance percennt as 1 = 1 percent
Returns: (bool) True if the ratio is within the tolerance, false otherwise
frac(x)
frad Fractional
Parameters:
x (float) : (float) - The number to convert to fractional
Returns: (float) - The number converted to fractional
safeindex(x, limit)
limiting int to hold the value within the chart range
Parameters:
x (float) : (float) - The number to limit
limit (int)
Returns: (int) - The number limited to the chart range
safecheck(x, limit)
limiting int check if within the chartplottable range
Parameters:
x (float) : (float) - The number to limit
limit (int)
Returns: (int) - The number limited to the chart range
interpolate(a, b, t)
interpolate between two values
Parameters:
a (float) : (float) - The first value
b (float) : (float) - The second value
t (float) : (float) - The interpolation factor (0 to 1)
Returns: (float) - The interpolated value
gcd(_numerator, _denominator)
Greatest common divisor of two integers
Parameters:
_numerator (int)
_denominator (int)
Returns: (int) The greatest common divisor
method set_x(self, value)
Set the x value of the point, and pass point for chaining
Namespace types: Point
Parameters:
self (Point) : (Point) The point to modify
value (float) : (float) The new x-coordinate
method set_y(self, value)
Set the y value of the point, and pass point for chaining
Namespace types: Point
Parameters:
self (Point) : (Point) The point to modify
value (float) : (float) The new y-coordinate
method get_x(self)
Get the x value of the point
Namespace types: Point
Parameters:
self (Point) : (Point) The point to get the x-coordinate from
Returns: (float) The x-coordinate
method get_y(self)
Get the y value of the point
Namespace types: Point
Parameters:
self (Point) : (Point) The point to get the y-coordinate from
Returns: (float) The y-coordinate
method vmin(self)
Lowest element of the point
Namespace types: Point
Parameters:
self (Point) : (Point) The point
Returns: (float) The lowest value between x and y
method vmax(self)
Highest element of the point
Namespace types: Point
Parameters:
self (Point) : (Point) The point
Returns: (float) The highest value between x and y
method add(p1, p2)
Addition
Namespace types: Point
Parameters:
p1 (Point) : (Point) - The first point
p2 (Point) : (Point) - The second point
Returns: (Point) - the add of the two points
method sub(p1, p2)
Subtraction
Namespace types: Point
Parameters:
p1 (Point) : (Point) - The first point
p2 (Point) : (Point) - The second point
Returns: (Point) - the sub of the two points
method mul(p, scalar)
Multiplication by scalar
Namespace types: Point
Parameters:
p (Point) : (Point) - The point
scalar (float) : (float) - The scalar to multiply by
Returns: (Point) - the multiplied point of the point and the scalar
method div(p, scalar)
Division by scalar
Namespace types: Point
Parameters:
p (Point) : (Point) - The point
scalar (float) : (float) - The scalar to divide by
Returns: (Point) - the divided point of the point and the scalar
method rotate(p, angle)
Rotate a point around the origin by an angle (in degrees)
Namespace types: Point
Parameters:
p (Point) : (Point) - The point to rotate
angle (float) : (float) - The angle to rotate by in degrees
Returns: (Point) - the rotated point
method length(p)
Length of the vector from origin to the point
Namespace types: Point
Parameters:
p (Point) : (Point) - The point
Returns: (float) - the length of the point
method length_squared(p)
Length squared of the vector
Namespace types: Point
Parameters:
p (Point) : (Point) The point
Returns: (float) The squared length of the point
method normalize(p)
Normalize the point to a unit vector
Namespace types: Point
Parameters:
p (Point) : (Point) - The point to normalize
Returns: (Point) - the normalized point
method dot(p1, p2)
Dot product
Namespace types: Point
Parameters:
p1 (Point) : (Point) - The first point
p2 (Point) : (Point) - The second point
Returns: (float) - the dot of the two points
method cross(p1, p2)
Cross product result (in 2D, this is a scalar)
Namespace types: Point
Parameters:
p1 (Point) : (Point) - The first point
p2 (Point) : (Point) - The second point
Returns: (float) - the cross of the two points
method distance(p1, p2)
Distance between two points
Namespace types: Point
Parameters:
p1 (Point) : (Point) - The first point
p2 (Point) : (Point) - The second point
Returns: (float) - the distance of the two points
method Point(x, y, a, v)
Point Create Convenience
Namespace types: series float, simple float, input float, const float
Parameters:
x (float)
y (float)
a (float)
v (float)
Returns: (Point) new point
method angle(p1, p2)
Angle between two points in degrees
Namespace types: Point
Parameters:
p1 (Point) : (Point) - The first point
p2 (Point) : (Point) - The second point
Returns: (float) - the angle of the first point and the second point
method angle_between(p, pivot, other)
Angle between two points in degrees from a pivot point
Namespace types: Point
Parameters:
p (Point) : (Point) - The point to calculate the angle from
pivot (Point) : (Point) - The pivot point
other (Point) : (Point) - The other point
Returns: (float) - the angle between the two points
method translate(p, from_origin, to_origin)
Translate a point from one origin to another
Namespace types: Point
Parameters:
p (Point) : (Point) - The point to translate
from_origin (Point) : (Point) - The origin to translate from
to_origin (Point) : (Point) - The origin to translate to
Returns: (Point) - the translated point
method midpoint(p1, p2)
Midpoint of two points
Namespace types: Point
Parameters:
p1 (Point) : (Point) - The first point
p2 (Point) : (Point) - The second point
Returns: (Point) - The midpoint of the two points
method rotate_around(p, angle, pivot)
Rotate a point around a pivot point by an angle (in degrees)
Namespace types: Point
Parameters:
p (Point) : (Point) - The point to rotate
angle (float) : (float) - The angle to rotate by in degrees
pivot (Point) : (Point) - The pivot point to rotate around
Returns: (Point) - the rotated point
method multiply(_a, _b)
Multiply vector _a with _b
Namespace types: Point
Parameters:
_a (Point) : (Point) The first point
_b (Point) : (Point) The second point
Returns: (Point) The result of the multiplication
method divide(_a, _b)
Divide vector _a by _b
Namespace types: Point
Parameters:
_a (Point) : (Point) The first point
_b (Point) : (Point) The second point
Returns: (Point) The result of the division
method negate(_a)
Negative of vector _a
Namespace types: Point
Parameters:
_a (Point) : (Point) The point to negate
Returns: (Point) The negated point
method perp(_a)
Perpendicular Vector of _a
Namespace types: Point
Parameters:
_a (Point) : (Point) The point
Returns: (Point) The perpendicular point
method vfloor(_a)
Compute the floor of argument vector _a
Namespace types: Point
Parameters:
_a (Point) : (Point) The point
Returns: (Point) The floor of the point
method fractional(_a)
Compute the fractional part of the elements from vector _a
Namespace types: Point
Parameters:
_a (Point) : (Point) The point
Returns: (Point) The fractional part of the point
method vsin(_a)
Compute the sine of argument vector _a
Namespace types: Point
Parameters:
_a (Point) : (Point) The point
Returns: (Point) The sine of the point
lcm(a, b)
Least common multiple of two integers
Parameters:
a (int) : (int) The first integer
b (int) : (int) The second integer
Returns: (int) The least common multiple
method vabs(_a)
Compute the absolute of argument vector _a
Namespace types: Point
Parameters:
_a (Point) : (Point) The point
Returns: (Point) The absolute of the point
method vmod(_a, _b)
Compute the mod of argument vector _a
Namespace types: Point
Parameters:
_a (Point) : (Point) The point
_b (float) : (float) The mod
Returns: (Point) The mod of the point
method vsign(_a)
Compute the sign of argument vector _a
Namespace types: Point
Parameters:
_a (Point) : (Point) The point
Returns: (Point) The sign of the point
method vround(_a)
Compute the round of argument vector _a
Namespace types: Point
Parameters:
_a (Point) : (Point) The point
Returns: (Point) The round of the point
method normalize_y(p, height)
normalizes the y value of a point to an input height
Namespace types: Point
Parameters:
p (Point) : (Point) - The point to normalize
height (float) : (float) - The height to normalize to
Returns: (Point) - the normalized point
centroid(points)
Calculate the centroid of multiple points
Parameters:
points (array) : (array) The array of points
Returns: (Point) The centroid point
random_point(_height, _width, _origin, _centered)
Random Point in a given height and width
Parameters:
_height (float) : (float) The height of the area to generate the point in
_width (float) : (float) The width of the area to generate the point in
_origin (Point) : (Point) The origin of the area to generate the point in (default: na, will create a Point(0, 0))
_centered (bool) : (bool) Center the origin point in the area, otherwise, positive h/w (default: false)
Returns: (Point) The random point in the given area
random_point_array(_origin, _height, _width, _centered, _count)
Random Point Array in a given height and width
Parameters:
_origin (Point) : (Point) The origin of the area to generate the array (default: na, will create a Point(0, 0))
_height (float) : (float) The height of the area to generate the array
_width (float) : (float) The width of the area to generate the array
_centered (bool) : (bool) Center the origin point in the area, otherwise, positive h/w (default: false)
_count (int) : (int) The number of points to generate (default: 50)
Returns: (array) The random point array in the given area
method sort_points(points, by_x)
Sorts an array of points by x or y coordinate
Namespace types: array
Parameters:
points (array) : (array) The array of points to sort
by_x (bool) : (bool) Whether to sort by x-coordinate (true) or y-coordinate (false)
Returns: (array) The sorted array of points
method equals(_a, _b)
Compares two points for equality
Namespace types: Point
Parameters:
_a (Point) : (Point) The first point
_b (Point) : (Point) The second point
Returns: (bool) True if the points are equal, false otherwise
method max(origin, _a, _b)
Maximum of two points from origin, using dot product
Namespace types: Point
Parameters:
origin (Point)
_a (Point) : (Point) The first point
_b (Point) : (Point) The second point
Returns: (Point) The maximum point
method min(origin, _a, _b)
Minimum of two points from origin, using dot product
Namespace types: Point
Parameters:
origin (Point)
_a (Point) : (Point) The first point
_b (Point) : (Point) The second point
Returns: (Point) The minimum point
method avg_x(points)
Average x of point array
Namespace types: array
Parameters:
points (array) : (array) The array of points
Returns: (float) The average x-coordinate
method avg_y(points)
Average y of point array
Namespace types: array
Parameters:
points (array) : (array) The array of points
Returns: (float) The average y-coordinate
method range_x(points)
Range of x values in point array
Namespace types: array
Parameters:
points (array) : (array) The array of points
Returns: (float) The range of x-coordinates
method range_y(points)
Range of y values in point array
Namespace types: array
Parameters:
points (array) : (array) The array of points
Returns: (float) The range of y-coordinates
method max_x(points)
max of x values in point array
Namespace types: array
Parameters:
points (array) : (array) The array of points
Returns: (float) The max of x-coordinates
method min_y(points)
min of x values in point array
Namespace types: array
Parameters:
points (array) : (array) The array of points
Returns: (float) The min of x-coordinates
method scale(_a, _scalar)
Scale a point by a scalar
Namespace types: Point
Parameters:
_a (Point) : (Point) The point to scale
_scalar (float) : (float) The scalar value
Returns: (Point) The scaled point
method rescale(_a, _length)
Rescale a point to a new magnitude
Namespace types: Point
Parameters:
_a (Point) : (Point) The point to rescale
_length (float) : (float) The new magnitude
Returns: (Point) The rescaled point
method rotate_rad(_a, _radians)
Rotate a point by an angle in radians
Namespace types: Point
Parameters:
_a (Point) : (Point) The point to rotate
_radians (float) : (float) The angle in radians
Returns: (Point) The rotated point
method rotate_degree(_a, _degree)
Rotate a point by an angle in degrees
Namespace types: Point
Parameters:
_a (Point) : (Point) The point to rotate
_degree (float) : (float) The angle in degrees
Returns: (Point) The rotated point
method vceil(_a, _digits)
Ceil a point to a certain number of digits
Namespace types: Point
Parameters:
_a (Point) : (Point) The point to ceil
_digits (int) : (int) The number of digits to ceil to
Returns: (Point) The ceiled point
method vpow(_a, _exponent)
Raise both point elements to a power
Namespace types: Point
Parameters:
_a (Point) : (Point) The point
_exponent (float) : (float) The exponent
Returns: (Point) The point with elements raised to the power
method perpendicular_distance(_a, _b, _c)
Distance from point _a to line between _b and _c
Namespace types: Point
Parameters:
_a (Point) : (Point) The point
_b (Point) : (Point) The start point of the line
_c (Point) : (Point) The end point of the line
Returns: (float) The perpendicular distance
method project(_a, _axis)
Project a point onto another
Namespace types: Point
Parameters:
_a (Point) : (Point) The point to project
_axis (Point) : (Point) The point to project onto
Returns: (Point) The projected point
method projectN(_a, _axis)
Project a point onto a point of unit length
Namespace types: Point
Parameters:
_a (Point) : (Point) The point to project
_axis (Point) : (Point) The unit length point to project onto
Returns: (Point) The projected point
method reflect(_a, _axis)
Reflect a point on another
Namespace types: Point
Parameters:
_a (Point) : (Point) The point to reflect
_axis (Point) : (Point) The point to reflect on
Returns: (Point) The reflected point
method reflectN(_a, _axis)
Reflect a point to an arbitrary axis
Namespace types: Point
Parameters:
_a (Point) : (Point) The point to reflect
_axis (Point) : (Point) The axis to reflect to
Returns: (Point) The reflected point
method angle_rad(_a)
Angle in radians of a point
Namespace types: Point
Parameters:
_a (Point) : (Point) The point
Returns: (float) The angle in radians
method angle_unsigned(_a, _b)
Unsigned degree angle between 0 and +180 by given two points
Namespace types: Point
Parameters:
_a (Point) : (Point) The first point
_b (Point) : (Point) The second point
Returns: (float) The unsigned angle in degrees
method angle_signed(_a, _b)
Signed degree angle between -180 and +180 by given two points
Namespace types: Point
Parameters:
_a (Point) : (Point) The first point
_b (Point) : (Point) The second point
Returns: (float) The signed angle in degrees
method angle_360(_a, _b)
Degree angle between 0 and 360 by given two points
Namespace types: Point
Parameters:
_a (Point) : (Point) The first point
_b (Point) : (Point) The second point
Returns: (float) The angle in degrees (0-360)
method clamp(_a, _vmin, _vmax)
Restricts a point between a min and max value
Namespace types: Point
Parameters:
_a (Point) : (Point) The point to restrict
_vmin (Point) : (Point) The minimum point
_vmax (Point) : (Point) The maximum point
Returns: (Point) The restricted point
method lerp(_a, _b, _rate_of_move)
Linearly interpolates between points a and b by _rate_of_move
Namespace types: Point
Parameters:
_a (Point) : (Point) The starting point
_b (Point) : (Point) The ending point
_rate_of_move (float) : (float) The rate of movement (0-1)
Returns: (Point) The interpolated point
method slope(p1, p2)
Slope of a line between two points
Namespace types: Point
Parameters:
p1 (Point) : (Point) - The first point
p2 (Point) : (Point) - The second point
Returns: (float) - The slope of the line
method gety(self, x)
Get y-coordinate of a point on the line given its x-coordinate
Namespace types: Line
Parameters:
self (Line) : (Line) - The line
x (float) : (float) - The x-coordinate
Returns: (float) - The y-coordinate
method getx(self, y)
Get x-coordinate of a point on the line given its y-coordinate
Namespace types: Line
Parameters:
self (Line) : (Line) - The line
y (float) : (float) - The y-coordinate
Returns: (float) - The x-coordinate
method intersection(self, other)
Intersection point of two lines
Namespace types: Line
Parameters:
self (Line) : (Line) - The first line
other (Line) : (Line) - The second line
Returns: (Point) - The intersection point
method calculate_arc_point(self, b, p3)
Calculate a point on the arc defined by three points
Namespace types: Point
Parameters:
self (Point) : (Point) The starting point of the arc
b (Point) : (Point) The middle point of the arc
p3 (Point) : (Point) The end point of the arc
Returns: (Point) A point on the arc
approximate_center(point1, point2, point3)
Approximate the center of a spiral using three points
Parameters:
point1 (Point) : (Point) The first point
point2 (Point) : (Point) The second point
point3 (Point) : (Point) The third point
Returns: (Point) The approximate center point
createEdge(center, radius, angle)
Get coordinate from center by radius and angle
Parameters:
center (Point) : (Point) - The center point
radius (float) : (float) - The radius of the circle
angle (float) : (float) - The angle in degrees
Returns: (Point) - The coordinate on the circle
getGrowthFactor(p1, p2, p3)
Get growth factor of spiral point
Parameters:
p1 (Point) : (Point) - The first point
p2 (Point) : (Point) - The second point
p3 (Point) : (Point) - The third point
Returns: (float) - The growth factor
method to_chart_point(point)
Convert Point to chart.point using chart.point.from_index(safeindex(point.x), point.y)
Namespace types: Point
Parameters:
point (Point) : (Point) - The point to convert
Returns: (chart.point) - The chart.point representation of the input point
method plotline(p1, p2, col, width)
Draw a line from p1 to p2
Namespace types: Point
Parameters:
p1 (Point) : (Point) First point
p2 (Point) : (Point) Second point
col (color)
width (int)
Returns: (line) Line object
method drawlines(points, col, ignore_boundary)
Draw lines between points in an array
Namespace types: array
Parameters:
points (array) : (array) The array of points
col (color) : (color) The color of the lines
ignore_boundary (bool) : (bool) The color of the lines
method to_chart_points(points)
Draw an array of points as chart points on the chart with line.new(chartpoint1, chartpoint2, color=linecolor)
Namespace types: array
Parameters:
points (array) : (array) - The points to draw
Returns: (array) The array of chart points
polygon_area(points)
Calculate the area of a polygon defined by an array of points
Parameters:
points (array) : (array) The array of points representing the polygon vertices
Returns: (float) The area of the polygon
polygon_perimeter(points)
Calculate the perimeter of a polygon
Parameters:
points (array) : (array) Array of points defining the polygon
Returns: (float) Perimeter of the polygon
is_point_in_polygon(point, _polygon)
Check if a point is inside a polygon
Parameters:
point (Point) : (Point) The point to check
_polygon (array)
Returns: (bool) True if the point is inside the polygon, false otherwise
method perimeter(points)
Calculates the convex hull perimeter of a set of points
Namespace types: array
Parameters:
points (array) : (array) The array of points
Returns: (array) The array of points forming the convex hull perimeter
Point
A Point, can be used for vector, floating calcs, etc. Use the cp method for plots
Fields:
x (series float) : (float) The x-coordinate
y (series float) : (float) The y-coordinate
a (series float) : (float) An Angle storage spot
v (series float) : (float) A Value
Line
Line
Fields:
point (Point) : (Point) The starting point of the line
slope (series float) : (float) The slope of the line
GOMTRY.