-
Notifications
You must be signed in to change notification settings - Fork 156
/
TSVolatility.h
50 lines (44 loc) · 1.8 KB
/
TSVolatility.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/************************************************************************
* Copyright(c) 2012, One Unified. All rights reserved. *
* email: [email protected] *
* *
* This file is provided as is WITHOUT ANY WARRANTY *
* without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
* This software may not be used nor distributed without proper license *
* agreement. *
* *
* See the file LICENSE.txt for redistribution information. *
************************************************************************/
#pragma once
#include "TSNorm.h"
#include "TSDifferential.h"
namespace ou { // One Unified
namespace tf { // TradeFrame
namespace hf { // high frequency
// page 69
// tauprime - return interval
// tau - length of moving sample
// z - irregular time series
// equation 3.68
class TSVolatility: public Prices {
public:
TSVolatility( Prices& series, time_duration dtTau, time_duration dtTauPrime, double p, unsigned int n = 4 );
TSVolatility( const TSVolatility& );
~TSVolatility(void);
protected:
private:
time_duration m_dtTau;
time_duration m_dtTauByTwo;
time_duration m_dtTauPrime;
double m_p;
unsigned int m_n;
Prices& m_seriesSource;
TSDifferential m_tsDif; // needs to be before norm
TSNorm m_tsNorm;
void HandleUpdate( const Price& price );
};
} // namespace hf
} // namespace tf
} // namespace ou