Re: Buy Sell Pressure indicator for MT4

101
josi wrote: Sat May 06, 2023 11:39 pm what are the yellow and magenta bars - possible reversal points?
how do you calculate them?
Yes, this is the usual convergence of the price and the oscillator. I don't call them all signals. Without a filter or strategy, they are not interesting.
I highlighted the convergence in color. To facilitate the search in this direction.

Probably, these are continuation signals.
Attachments
These users thanked the author andrei-1 for the post:
josi


Re: Buy Sell Pressure indicator for MT4

102
kvak, mrtools, there has been a brand new upgrade to this indicator from fract and I was wondering if it was possible to apply the changes towards the code we already have.

The new changes published on June 17 are as follows:

  • Ability to change the type of MA
  • Removed maxval limits
  • Separate fills coloring different stages of the market

Here is the updated code:

Code: Select all

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

// Inputs and Formula {
sw = input(false, 'No Wicks', 'Focus on body candles')
uw = high - math.max(open, close)
lw = math.min(open, close) - low 
bp = close - (math.min(low, close[1])) - (sw? lw : 0)                //buying_pressure
sp = (math.max(high, close[1])) - close - (sw? uw : 0)               //selling_pressure
typeMA = input.string(title = "MA Type", defval = "HMA", options=["SMA", "EMA", "HMA", "RMA", "WMA", "VWMA"])
ln = input.int(24, "BSP Length", 1)
//}
ma(source, length, type) =>
    switch type
        "SMA" => ta.sma(source, length)
        "EMA" => ta.ema(source, length)
        "HMA" => ta.hma(source, length)
        "RMA" => ta.rma(source, length)
        "WMA" => ta.wma(source, length)
        "VWMA" => ta.vwma(source, length)

bpma = ma(bp, ln, typeMA)
spma = ma(sp, ln, typeMA)
// Conditions {
//del
//}
// Colors {
bpgrow = #40af40
bpfall = #2962ff
spgrow = #f23645
spfall = #f57f17
//}
//{ Plots
bpp = plot(bpma, "BP", color= bpma > bpma[1] ? bpgrow : bpfall, linewidth= 1, trackprice = true)
spp = plot(spma, "SP", color= spma > spma[1] ? spgrow : spfall, linewidth = 1, trackprice = true)
//fill(bpp, spp, bpma > spma ? color.rgb(0, 255, 0, 90) : color.rgb(255, 0, 0, 90))
fill(bpp, spp, bpma > spma and bpma > bpma[1] ? color.rgb(0, 255, 0, 90) : na)
fill(bpp, spp, bpma > spma and bpma < bpma[1] ? color.rgb(0, 68, 255, 90) : na)
fill(bpp, spp, bpma < spma and spma > spma[1] ? color.rgb(255, 0, 0, 90) : na)
fill(bpp, spp, bpma < spma and spma < spma[1] ? color.rgb(255, 172, 48, 90) : na)
//}

As a result, here is what the indicator now looks like:


I believe the default settings are now a period length of 24 using the Hull Moving Average.

Always appreciate the efforts you guys undertake to make my indicator requests a reality.

Re: Buy Sell Pressure indicator for MT4

103
TransparentTrader wrote: Tue Jun 20, 2023 1:20 am kvak, mrtools, there has been a brand new upgrade to this indicator from fract and I was wondering if it was possible to apply the changes towards the code we already have.

The new changes published on June 17 are as follows:

  • Ability to change the type of MA
  • Removed maxval limits
  • Separate fills coloring different stages of the market

Here is the updated code:

Code: Select all

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

// Inputs and Formula {
sw = input(false, 'No Wicks', 'Focus on body candles')
uw = high - math.max(open, close)
lw = math.min(open, close) - low 
bp = close - (math.min(low, close[1])) - (sw? lw : 0)                //buying_pressure
sp = (math.max(high, close[1])) - close - (sw? uw : 0)               //selling_pressure
typeMA = input.string(title = "MA Type", defval = "HMA", options=["SMA", "EMA", "HMA", "RMA", "WMA", "VWMA"])
ln = input.int(24, "BSP Length", 1)
//}
ma(source, length, type) =>
    switch type
        "SMA" => ta.sma(source, length)
        "EMA" => ta.ema(source, length)
        "HMA" => ta.hma(source, length)
        "RMA" => ta.rma(source, length)
        "WMA" => ta.wma(source, length)
        "VWMA" => ta.vwma(source, length)

bpma = ma(bp, ln, typeMA)
spma = ma(sp, ln, typeMA)
// Conditions {
//del
//}
// Colors {
bpgrow = #40af40
bpfall = #2962ff
spgrow = #f23645
spfall = #f57f17
//}
//{ Plots
bpp = plot(bpma, "BP", color= bpma > bpma[1] ? bpgrow : bpfall, linewidth= 1, trackprice = true)
spp = plot(spma, "SP", color= spma > spma[1] ? spgrow : spfall, linewidth = 1, trackprice = true)
//fill(bpp, spp, bpma > spma ? color.rgb(0, 255, 0, 90) : color.rgb(255, 0, 0, 90))
fill(bpp, spp, bpma > spma and bpma > bpma[1] ? color.rgb(0, 255, 0, 90) : na)
fill(bpp, spp, bpma > spma and bpma < bpma[1] ? color.rgb(0, 68, 255, 90) : na)
fill(bpp, spp, bpma < spma and spma > spma[1] ? color.rgb(255, 0, 0, 90) : na)
fill(bpp, spp, bpma < spma and spma < spma[1] ? color.rgb(255, 172, 48, 90) : na)
//}

As a result, here is what the indicator now looks like:


Image



I believe the default settings are now a period length of 24 using the Hull Moving Average.

Always appreciate the efforts you guys undertake to make my indicator requests a reality.

Hello Mrtools and kvak, I was just wondering if you were able to see this indicator request. It's not urgent so please have a look whenever you get the chance. Thank you!

Re: Buy Sell Pressure indicator for MT4

104
TransparentTrader wrote: Thu Jun 22, 2023 12:31 am Hello Mrtools and kvak, I was just wondering if you were able to see this indicator request. It's not urgent so please have a look whenever you get the chance. Thank you!
Looks like with the averages version the first part is done the second not sure what maxval limits refers to and think the extra coloring for the fill is possible but would like to know about the second part before continuing.
These users thanked the author mrtools for the post:
TransparentTrader

Re: Buy Sell Pressure indicator for MT4

105
mrtools wrote: Thu Jun 22, 2023 4:57 am Looks like with the averages version the first part is done the second not sure what maxval limits refers to and think the extra coloring for the fill is possible but would like to know about the second part before continuing.

To be honest I'm not sure either, I was hoping you knew :lmao:

But I can contact fract on TradingView and asks what he meant by that. Perhaps he can tell us so we can make his updates possible.

EDIT: Just reached out to fract. I'll see if he responds.
These users thanked the author TransparentTrader for the post:
mrtools


Re: Buy Sell Pressure indicator for MT4

106
TransparentTrader wrote: Thu Jun 22, 2023 6:59 am To be honest I'm not sure either, I was hoping you knew :lmao:

But I can contact fract on TradingView and asks what he meant by that. Perhaps he can tell us so we can make his updates possible.

EDIT: Just reached out to fract. I'll see if he responds.
fract responded to me around an hour ago and here is what he had to say. Mrtools, let me know if this clears up any confusion or requires any further modification of the BSP code we already have.

"Thank you very much for caring. Not a big deal there. That change was for those who builds custom strategies.

Before there was maxval = 144, because I thought there was no need for a volatility indicator to have higher averaging. Yet some people were writing me about the issue so I removed the limit.

By the way bsp can be very useful for filtering signals from specific market noises. Having no maxval allows to filter the market in lower tf where value of bsp might require a higher input number."

Re: Buy Sell Pressure indicator for MT4

107
TransparentTrader wrote: Thu Jun 22, 2023 9:05 am fract responded to me around an hour ago and here is what he had to say. Mrtools, let me know if this clears up any confusion or requires any further modification of the BSP code we already have.

"Thank you very much for caring. Not a big deal there. That change was for those who builds custom strategies.

Before there was maxval = 144, because I thought there was no need for a volatility indicator to have higher averaging. Yet some people were writing me about the issue so I removed the limit.

By the way bsp can be very useful for filtering signals from specific market noises. Having no maxval allows to filter the market in lower tf where value of bsp might require a higher input number."
Looks like it will basically be the same except for the fill, in mt4 the fill won't be as pretty but think it can be done.

Re: Buy Sell Pressure indicator for MT4

108
mrtools wrote: Thu Jun 22, 2023 10:05 am Looks like it will basically be the same except for the fill, in mt4 the fill won't be as pretty but think it can be done.

Hello mrtools, would it be possible to do the fill assuming it hasn't already been done in the prior MT4 versions you and kvak have coded?

I do have one other modification to the BSP indicator I'd like to make afterward once the fill is finished. Thanks for your efforts as always.

Re: Buy Sell Pressure indicator for MT4

109
TransparentTrader wrote: Sat Jun 24, 2023 8:26 am Hello mrtools, would it be possible to do the fill assuming it hasn't already been done in the prior MT4 versions you and kvak have coded?

I do have one other modification to the BSP indicator I'd like to make afterward once the fill is finished. Thanks for your efforts as always.
Not to pretty but think it is close.
These users thanked the author mrtools for the post (total 4):
kvak, TransparentTrader, andrei-1, Krunal Gajjar


Who is online

Users browsing this forum: Ahrefs [Bot], Applebot [Crawler], Bing [Bot], dininurin, DotNetDotCom [Bot], Grapeshot [Bot], hasper, samtidar, TransparentTrader and 196 guests