Volume Weighted Moving Average code (VWMA)  [SOLVED]

Questions about MultiCharts and user contributed studies.
StefanoSF
Posts: 116
Joined: 19 Aug 2012
Location: San Francisco
Has thanked: 23 times
Been thanked: 30 times
Contact:

Volume Weighted Moving Average code (VWMA)

Postby StefanoSF » 23 Jan 2017

Maybe someone can help me. In this months issue(2/17) of Stocks and Commodities there is a trading strategy which use Volume Weighted Moving Average to id breakouts.

I have searched hi and low for the MC or EL VWMA code and can't find one that works correctly. I've tried writing it myself with no success.

If someone has a running version, could you share?

User avatar
CrazyNasdaq
Posts: 319
Joined: 02 Sep 2009
Location: ITALY
Has thanked: 97 times
Been thanked: 86 times

Re: Volume Weighted Moving Average code (VWMA)  [SOLVED]

Postby CrazyNasdaq » 24 Jan 2017

Maybe this code can help you

Code: Select all

inputs:
Lunghezza(20);

vars:
PMi( 0 ),
Vi( 0 ),
PMvi( 0 ),
Sum.PMVi( 0 ),
Sum.Vi( 0 ),
VWMA( 0 );

PMi = avgPrice;
Vi = volume;
PMvi = Pmi * Vi;
Sum.PMVi = summation(PMVi, lunghezza);
Sum.Vi = summation(Vi, lunghezza);
VWMA = Sum.PMVi / Sum.Vi;


PLot1(vwma, "VWMA");

StefanoSF
Posts: 116
Joined: 19 Aug 2012
Location: San Francisco
Has thanked: 23 times
Been thanked: 30 times
Contact:

Re: Volume Weighted Moving Average code (VWMA)

Postby StefanoSF » 24 Jan 2017

Grazie. :D

User avatar
CrazyNasdaq
Posts: 319
Joined: 02 Sep 2009
Location: ITALY
Has thanked: 97 times
Been thanked: 86 times

Re: Volume Weighted Moving Average code (VWMA)

Postby CrazyNasdaq » 24 Jan 2017

Prego !!

TradeAlex
Posts: 9
Joined: 15 Jun 2021
Been thanked: 1 time

Re: Volume Weighted Moving Average code (VWMA)

Postby TradeAlex » 15 Jun 2021

Buonasera a tutti,
Ho un problema: quando applico il codice del Volume Weighted Moving Average sul Future Eurodollaro Molto spesso mi si apre un pop up rosso di errore, con scritto "Errore di eccezione: operazione non valida a virgola mobile" . Qualcuno mi può aiutare?
Grazie!

Good evening everyone,
I have a problem: when I use the code for the Volume Weight Average on the Fture Eur-Usd a red pop up appears to me saying " Exception Error; Operation not valid to mobile comma". Did it happen to someone else? How did you menage it?
Thank you!

User avatar
CrazyNasdaq
Posts: 319
Joined: 02 Sep 2009
Location: ITALY
Has thanked: 97 times
Been thanked: 86 times

Re: Volume Weighted Moving Average code (VWMA)

Postby CrazyNasdaq » 31 Oct 2021

Buonasera a tutti,
Ho un problema: quando applico il codice del Volume Weighted Moving Average sul Future Eurodollaro Molto spesso mi si apre un pop up rosso di errore, con scritto "Errore di eccezione: operazione non valida a virgola mobile" . Qualcuno mi può aiutare?
Grazie!

Good evening everyone,
I have a problem: when I use the code for the Volume Weight Average on the Fture Eur-Usd a red pop up appears to me saying " Exception Error; Operation not valid to mobile comma". Did it happen to someone else? How did you menage it?
Thank you!
ITA - Probabilmente perché inizia a plottare su una candela che ha volume = zero e un numero diviso zero è impossibile in matematica e ti ritorna l'errore. Cambia la data di inizio della serie storica su cui calcoli il codice e riattiva l'indicatore. Teoricamente dovrebbe risolversi.

ENG - Probably because it starts plotting on a candle that has volume = zero and a number divided by zero is impossible in math and returns the error to you. Change the start date of the time series on which you calculate the code and reactivate the indicator. Theoretically it should work.

TradeAlex
Posts: 9
Joined: 15 Jun 2021
Been thanked: 1 time

Re: Volume Weighted Moving Average code (VWMA)

Postby TradeAlex » 01 Nov 2021

Ok. Grazie

User avatar
CrazyNasdaq
Posts: 319
Joined: 02 Sep 2009
Location: ITALY
Has thanked: 97 times
Been thanked: 86 times

Re: Volume Weighted Moving Average code (VWMA)

Postby CrazyNasdaq » 01 Nov 2021

Ok. Grazie
Risolto ??

SOLVED the problem?

TradeAlex
Posts: 9
Joined: 15 Jun 2021
Been thanked: 1 time

Re: Volume Weighted Moving Average code (VWMA)

Postby TradeAlex » 06 Nov 2021

Per ora si. Thanks

TradeAlex
Posts: 9
Joined: 15 Jun 2021
Been thanked: 1 time

Re: Volume Weighted Moving Average code (VWMA)

Postby TradeAlex » 23 Nov 2021

Salve,
purtroppo nell'intraday la curva scompare spesso probabilmente quando i volumi sono a zero. Non si potrebbe in qualche modo risolvere questo problema?

User avatar
CrazyNasdaq
Posts: 319
Joined: 02 Sep 2009
Location: ITALY
Has thanked: 97 times
Been thanked: 86 times

Re: Volume Weighted Moving Average code (VWMA)

Postby CrazyNasdaq » 23 Nov 2021

Salve,
purtroppo nell'intraday la curva scompare spesso probabilmente quando i volumi sono a zero. Non si potrebbe in qualche modo risolvere questo problema?
puoi provare a risolvere così

Code: Select all

inputs: Lunghezza(20); vars: PMi( 0 ), Vi( 0 ), PMvi( 0 ), Sum.PMVi( 0 ), Sum.Vi( 0 ), VWMA( 0 ); PMi = avgPrice; Vi = volume; PMvi = Pmi * Vi; Sum.PMVi = summation(PMVi, lunghezza); Sum.Vi = summation(Vi, lunghezza); if Sum.Vi <> 0 then begin VWMA = Sum.PMVi / Sum.Vi; end else being if Sum.Vi = 0 then VWMA = VWMA[1]; END; PLot1(vwma, "VWMA");
In questo modo dovrebbe funzionare e bypassare quelle situazioni in cui il volume = 0

TradeAlex
Posts: 9
Joined: 15 Jun 2021
Been thanked: 1 time

Re: Volume Weighted Moving Average code (VWMA)

Postby TradeAlex » 24 Nov 2021

Buongiorno,
purtroppo con questo nuovo codice, la curva non si vede. Non appare proprio sul grafico. Ho visto che nelle sue proprietà, precisamente in "Style" non c'è. Forse questo è il problema? Non lo so. Spero tanto che si possa risolvere. Grazie

TradeAlex
Posts: 9
Joined: 15 Jun 2021
Been thanked: 1 time

Re: Volume Weighted Moving Average code (VWMA)

Postby TradeAlex » 24 Nov 2021

Aspetta ora rifaccio la procedura Forse ho sbagliato io qualcosa nel copiare

TradeAlex
Posts: 9
Joined: 15 Jun 2021
Been thanked: 1 time

Re: Volume Weighted Moving Average code (VWMA)

Postby TradeAlex » 24 Nov 2021

Mi da questo errore
syntax error, unexpected 'if'
line 25, column 0

User avatar
CrazyNasdaq
Posts: 319
Joined: 02 Sep 2009
Location: ITALY
Has thanked: 97 times
Been thanked: 86 times

Re: Volume Weighted Moving Average code (VWMA)

Postby CrazyNasdaq » 24 Nov 2021

Mi da questo errore
syntax error, unexpected 'if'
line 25, column 0
correggi la scritta "else being" con "else begin" ho sbagliato a digitare
Vedrai che ora funziona

TradeAlex
Posts: 9
Joined: 15 Jun 2021
Been thanked: 1 time

Re: Volume Weighted Moving Average code (VWMA)

Postby TradeAlex » 25 Nov 2021

Grazie di tutto. Fino ad ora nessun problema. Non avrei saputo come fare. Veramente ti ringrazio. Saluti Alessandro

TradeAlex
Posts: 9
Joined: 15 Jun 2021
Been thanked: 1 time

Re: Volume Weighted Moving Average code (VWMA) WITH STANDARD DEVIATION

Postby TradeAlex » 25 Feb 2023

Hello,
I looking for the indicator Volume Weighted Moving Average with its Standard Deviation . Is there anabody who can help me?
I need code for multicharts
Thank you
Alex


Return to “MultiCharts”