Attachments forums

List of attachments posted on this forum.


All files on forums: 135975

Buy Sell Pressure indicator for MT4

TransparentTrader, Tue Jan 31, 2023 8:25 am

Buy Sell Pressure indicator for MT4, project by Fract, TransparentTrader & Mrtools

@kvak and @mrtools, I have a request that involves modifying the "Buying and Selling Pressure (BSP)" indicator on TradingView I originally requested to convert into MT4 back in December.


mrtools was the first to convert the indicator to its original form and even provided the source code.



mrtools then provided an updated version that came with price options, MTF, and the ability to have separate average types and lengths for the bpma/spma. However, the price pack works for BOTH the bpma/spma and you can't change it separately (for instance, I'd like to see one price option for bpma and a separate one for spma). It also does not have candle coloring, alerts, or arrows.



kvak provided his version of the BSP indicator that came with eAverages, MTF, ability to edit length of bpma/spma individually, ability to change the type of moving average used by bpma/spma separately, arrows and alerts. Only thing missing is the price pack.



There are features from the version of kvak that are missing in the version from mrtools, and likewise there are features from the version of mrtools that are missing in the version from kvak. If you look at the pictures, you will also notice they are visually different. While mrtools focuses on the blue and red lines crossing one another, kvak has his set up in a way where there's one green/red line to reflect the trend and another dotted line to reflect the crossover.

I bring all of this up because over the weekend, the indicator's author provided a major update to the code:

"Now BSP is based on candle's actual body without excluding wick measurement out of formula. It was very sensitive to market noises, giving us confusing signals. Eliminating wicks metrics contributed to more accurate capture of bullish and bearish market and their timing. For example capture of covid19 lockdown 📉 bearish wave."

Here is the code:

Code: Select all

// © fract
//@version=5
indicator(title='Buying & Selling Pressure', shorttitle='BSP', overlay=false, timeframe = "")

// Inputs and Formula {
high_ = math.max(high, close[1])
low_ = math.min(low, close[1])
uw = high - math.max(open, close)
lw = math.min(open, close) - low
bp = close - low_ - lw //raw_body_buying_pressure
sp = high_ - close - uw //raw_body_selling_pressure
ln = input(24, "BSP Length")
bpma = ta.ema(bp, ln)
spma = ta.ema(sp, ln)
//}
// Colors {
bpgrow = #40af40
bpfall = #2962ff
sprise = #f23645
spfall = #f57f17
//}
//{ Plots
bpp = plot(bpma, "Buying Pressure", color= bpma > bpma[1] ? bpgrow : bpfall, linewidth= 1)
spp = plot(spma, "Selling Pressure", color= spma > spma[1] ? sprise : spfall, linewidth = 1)
fill(bpp, spp, bpma > spma ? color.rgb(0, 255, 0, 90) : color.rgb(255, 0, 0, 90))
//}

And this is what it's supposed to look like on the charts:


Which brings me to the point of my request: Could we perhaps create a "BSP v2.0" indicator that addresses the change in the indicator's code and combine the features from the mrtools version and the kvak version?

As a recap, here is what I would like to see in the order of highest importance to lowest importance:

  • Adding all averages via the eAverages pack
  • Adding all price options via the Price pack
  • Adding MTF/AHTF capabilities
  • Separately editing the TYPE of moving average you use for "bpma" and "spma"
  • Separately editing the PRICE OPTION you use for "bpma" and "spma"
  • Separately editing the LENGTH you use for "bpma" and "spma"
  • The slope line changes as seen in lines 16-24 of the PineScript code ("bpma" slope is green when going up and blue when going down, "spma" slope is red when going up and orange when going down)
  • The option to "fill" the space in-between the bpma/spma as seen in line 25 of the PineScript code
  • Arrows for buy/sell entries
  • Coloring the candles to reflect when the indicator reflects buying/selling pressure
  • Alerts to help us know when to look for a trade, especially on the higher timeframes
  • A button so we can turn the indicator appearance on and off when we want

It would be really awesome to see what this simple yet powerful indicator could do with all of the above features. Thanks to mrtools, kvak, and all the programmers here again for their tireless hard work.

PS - mrtools I know you are recovering from illness. Please take your time because I'm in no rush and your health is most important.
All files in topic