Maydo

Market Sniper

This Pine Script is a simplified trading algorithm designed to detect and signal potential buying and selling points based on the WaveTrend Oscillator and the volume traded.

Inputs and Setup:
The script initiates by defining key parameters: 'Wave Channel Length' (n1) set at 9 and 'Wave Average Length' (n2) set at 12. It also establishes a 'Volume Multiplier' (set at 2), and a 'Lookback Period' for volume calculation (set at 60 minutes). These values can be customized according to user preferences.

WaveTrend Oscillator Calculation:
It then calculates the WaveTrend Oscillator. The WaveTrend Oscillator is a momentum-based indicator that determines trend direction and potential reversal points. This is accomplished by applying an exponential moving average (EMA) and a simple moving average (SMA) to the average price data.

Volume Average Calculation:
Simultaneously, the script calculates the simple moving average of the volume over the defined 'Lookback Period'.

Buy and Sell Signals Definition:
The core of the trading signals lies in the crossing of the two lines of the WaveTrend Oscillator (wt1 and wt2) and whether the volume is higher than a certain threshold (defined by the 'Volume Multiplier' times the average volume). Specifically:

A 'Buy' signal is defined when the wt1 line crosses up the wt2 line and the volume is greater than the 'Volume Multiplier' times the average volume.
Conversely, a 'Sell' signal is defined when the wt1 line crosses down the wt2 line and the volume is greater than the 'Volume Multiplier' times the average volume.
Signal Plotting and Alert Creation:
Each time a 'Buy' or 'Sell' condition is met, the script plots a corresponding label directly on the price chart: a 'Buy' label below the bars for buy signals, and a 'Sell' label above the bars for sell signals. Additionally, it sets alerts based on these 'Buy' and 'Sell' signals with corresponding messages.
Protected script
This script is published closed-source but you may use it freely. You can favorite it to use it on a chart. You cannot view or modify its source code.
Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?