-
Notifications
You must be signed in to change notification settings - Fork 164
/
Copy pathTSSWRateOfChange.cpp
50 lines (39 loc) · 1.75 KB
/
TSSWRateOfChange.cpp
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) 2011, 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. *
************************************************************************/
#include "stdafx.h"
#include "TSSWRateOfChange.h"
namespace ou { // One Unified
namespace tf { // TradeFrame
TSSWRateOfChange::TSSWRateOfChange( Prices& prices, time_duration tdWindowWidth )
: TimeSeriesSlidingWindow<TSSWRateOfChange, Price>( prices, tdWindowWidth ),
m_tail( 0.0 ), m_head( 0.0 )
{
}
TSSWRateOfChange::TSSWRateOfChange( const TSSWRateOfChange& rhs )
: TimeSeriesSlidingWindow<TSSWRateOfChange, Price>( rhs ),
m_tail( rhs.m_tail ), m_head( rhs.m_head )
{
}
TSSWRateOfChange::~TSSWRateOfChange(void) {
}
void TSSWRateOfChange::Add( const Price& price ) {
m_head = price.Value();
}
void TSSWRateOfChange::Expire( const Price& price ) {
m_tail = price.Value();
}
void TSSWRateOfChange::PostUpdate( void ) {
}
} // namespace tf
} // namespace ou