Hi ,
I want to create a turnover variable (defined as Close Price * Volume) and save the data as an array.
Then from that array i would like to be able to calculate average values, for example what is the average turnover over the past month, or 10 weeks etc.
Any ideas on how i can create something like this most welcome!
TURNOVER variable [SOLVED]
- TJ
- Posts: 7720
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1032 times
- Been thanked: 2216 times
Re: TURNOVER variable
Do you need an array?
If you want to know the average, then just calculate the moving average of the "Turnover".
If you want to know the average, then just calculate the moving average of the "Turnover".
Re: TURNOVER variable
Hi TJ,
thanks for your quick reply!
So how could i do that?
assume i define Turnover as follows:
vars: Turnover(0)
Turnover = C * Volume
How can i then calculate the moving average of the past 10 weeks of the above variable?
thanks for your quick reply!
So how could i do that?
assume i define Turnover as follows:
vars: Turnover(0)
Turnover = C * Volume
How can i then calculate the moving average of the past 10 weeks of the above variable?
- TJ
- Posts: 7720
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1032 times
- Been thanked: 2216 times
- TJ
- Posts: 7720
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1032 times
- Been thanked: 2216 times
Re: TURNOVER variable
Try this:
input:
TOMA.Length( 50 ); // 50 days approx 10 weeks
vars:
Turnover( 0 ),
TOMA( 0 ); // Turnover moving average
Turnover = C * Volume ;
TOMA = Average( Turnover , TOMA.length );
- TJ
- Posts: 7720
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1032 times
- Been thanked: 2216 times