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: 7765
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2232 times
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".
- TJ
- Posts: 7765
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2232 times
What is your chart resolution?
- TJ
- Posts: 7765
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2232 times
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: 7765
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2232 times