Attachments forums

List of attachments posted on this forum.


All files on forums: 136172

Re: Volume Indicators for MT4

TransparentTrader, Sun Nov 26, 2023 6:10 pm

Woodyz wrote: Sun Nov 26, 2023 5:55 pm Thank's for the effort Mate
I have already looked at those & not what I'm wanting.
Again thank you
Trading view has it available as one of their std indi's
Image

Here's something interesting I found: https://www.tradingview.com/support/sol ... ored-vwap/

This is a basic tutorial explaining how the default drawing tool works, along with the options you have to adjust the bands and change the colors.

To be more specific:
Bands Calculation Mode can be set to "Standard Deviation" or "Percentage"
You have the option for up to 3 sets of bands, each with their own multiplier.
Source can be: Open, High, Low, Close, HL2, HLC3, OHLC4, HLCC4
You can change the color for the VWAP line and the upper/lower lines individually for each of the 3 sets of bands included.

Since it's a drawing tool, I first thought there isn't a script for it like there is for the other open-source indicators on TradingView.

But back in October 2021, when TradingView released a new interactive input mode for Pine scripts, they used the Anchored VWAP as an example and gave away the source code for doing so.

"This is code for an Anchored VWAP indicator where the anchor point is set interactively, just as with the drawing tool of the same name:"

Code: Select all

//@version=5
indicator("Anchored VWAP", overlay=true)
src = input.source(hlc3, "Source")
startCalculationDate = input.time(timestamp("20 Jan 2021"), "Start Calculation", confirm=true)
vwap_calc() =>
    var srcVolArray = array.new_float(na)
    var volArray = array.new_float(na)
    if startCalculationDate <= time
        array.push(srcVolArray, src*volume)
        array.push(volArray, volume)
    else
        array.clear(srcVolArray), array.clear(volArray)
    array.sum(srcVolArray)/array.sum(volArray)
anchoredVwap = vwap_calc()
plot(anchoredVwap, "VWAP", linewidth=3)
"When it is necessary to select both a price and time simultaneously, use an inline parameter with the same value in both function calls:"

Code: Select all

//@version=5
indicator("Point", overlay=true)
myPrice = input.price(100, inline="Point", confirm=true)
myTime = input.time(timestamp("2020-02-20"), inline="Point", confirm=true)
lblText = str.format("Price: {0, number}\nTime: {1, date} {1, time}", myPrice, myTime)
var l1 = label.new(myTime, myPrice, lblText, xloc=xloc.bar_time)
"After adding an indicator and making an initial interactive selection on the chart, you can modify the selection points by selecting the indicator and moving the points on the chart."

Someone then turned this into a script on TradingView and the code is below:

Code: Select all

//@version=5
indicator("Anchored VWAP", overlay=true)
src = input.source(hlc3, "Source")
startCalculationDate = input.time(timestamp("20 Jan 2021"), "Start Calculation", confirm=true)
vwap_calc() =>
    var srcVolArray = array.new_float(na)
    var volArray = array.new_float(na)
    if startCalculationDate <= time
        array.push(srcVolArray, src*volume)
        array.push(volArray, volume)
    else
        array.clear(srcVolArray), array.clear(volArray)
    array.sum(srcVolArray)/array.sum(volArray)
anchoredVwap = vwap_calc()
plot(anchoredVwap, "VWAP", linewidth=3)
mrtools, kvak, or any of the programmers here: Using the information provided above, would it be indeed possible to create the type of Anchored VWAP that Woodyz is looking for? Or does it already exist on MT4 in some fashion?
All files in topic