-
Notifications
You must be signed in to change notification settings - Fork 164
/
Copy pathTSMA.h
47 lines (40 loc) · 1.74 KB
/
TSMA.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
/************************************************************************
* 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 <vector>
#include "TSEMA.h"
namespace ou { // One Unified
namespace tf { // TradeFrame
namespace hf { // high frequency
class TSMA: public Prices {
public:
TSMA( Prices& series, time_duration td, unsigned int nInf, unsigned int nSup ); // pg 63
TSMA( Prices& series, time_duration td, unsigned int n ); // eq 3.56, pg 61, n typically 2, 3, 4
TSMA( const TSMA& rhs );
~TSMA(void);
double GetMA( void ) { return m_dblRecentMA; };
protected:
private:
time_duration m_tdTimeRange;
unsigned int m_nInf;
unsigned int m_nSup;
double m_dblRecentMA;
Prices& m_seriesSource;
std::vector<TSEMA<Price>*> m_vEMA;
void Initialize( void );
void HandleUpdate( const Price& );
};
} // namespace hf
} // namespace tf
} // namespace ou