Attachments forums

List of attachments posted on this forum.


All files on forums: 137572

Re: Buy Sell Pressure indicator for MT4

mrtools, Sat Feb 18, 2023 4:13 pm

TransparentTrader wrote: Thu Feb 16, 2023 10:01 am mrtools / kvak, I have one final request to make for the time being. Please do this at your own convenience whenever you have the time to do so.

In an earlier discussion on this thread for the NET BSP indicator, there was this standout quote I pulled from the official TradingView page for this indicator

One of the quotes was the following:

"To smooth things out for normal candles I found a good solution. With this new script we can use different types of MA's (moving averages). Default is set to HMA because it groups well the NORMAL candlesticks and is reactive even with 24 (length?). Change to SMA or EMA when it comes to dealing with HA candles."

I had also mentioned that the Heikin Ashi charts on TradingView produce different values for the open, close and highs and lows than normal candlestick charts.

One of the comments on the TradingView page for NET BSP had the following to say, accompanied by what a custom code would look like if NET BSP only used Heikin Ashi values:

My point in the question was that using "Heikin Ashi" produces different values for the open, close and highs and lows than the plain "Candles", as if you had written different code for the indicator with some sort of pre-filtering:

// Heikin Ashi smoothing {
// average price of the current bar
heikin_ashi_close = (open+high+low+close) / 4
// the midpoint of the previous bar
heikin_ashi_open = (open(1)+close(1)) / 2
heikin_ashi_high = math.max(high, open, close)
heikin_ashi_low = math.min(low, open, close)
//}

// Inputs and Formula {
ln = input(24, "BSP Average")
high_ = math.max(heikin_ashi_high, heikin_ashi_close(1))
low_ = math.min(heikin_ashi_low, heikin_ashi_close(1))
bd = math.abs(heikin_ashi_close - heikin_ashi_open)
uw = heikin_ashi_high - math.max(heikin_ashi_open, heikin_ashi_close)
lw = math.min(heikin_ashi_open, heikin_ashi_close) - heikin_ashi_low
bp = heikin_ashi_close - low_ - lw //buying_pressure
sp = high_ - heikin_ashi_close - uw //selling_pressure
bal = bp - sp
bsp = ta.ema(bal, ln)
//}


But as you can see under "Inputs and Formula", this would create V2 of our BSP indicator on MT4 that eliminated wicks from the equation. We now know better than to do this thanks to Fract.

If we were to apply only the Heikin Ashi prices to the formula we now use in V2.01 of BSP (or NET BSP for that matter), I believe it would look like what is down below. This is my amateur attempt at trying to create such a BSP indicator that only uses Heikin Ashi prices:

Code: Select all

// Inputs and Formula {
bp = heikin_ashi_close - math.min(heikin_ashi_low, heikin_ashi_close(1))                //buying_pressure
sp = math.max(heikin_ashi_high, heikin_ashi_close(1)) - heikin_ashi_close              //selling_pressure
ln = input.int(24, "BSP Length", 1, 200, 1)
bpma = ta.ema(bp, ln)
spma = ta.ema(sp, ln)

We would have to make this change for MT4 since the platform only treats Heikin Ashi as an overlay and not as separate open/high/low/close prices to be used as part of an indicator's mathematical calculations.

What do you think? Would it be worth our while to do this special modification for the BSP and/or NET BSP indicators, allowing us to change moving averages depending on the type of chart we are using?

Eager to hear other traders' thoughts!
This is a Gann adaptive jma smoothed Heiken Ashi think maybe whomever codes this maybe it will help to make the Heiken Ashi version, could maybe even use the ha smoothing. Just my 2 cents.
All files in topic