-
Notifications
You must be signed in to change notification settings - Fork 163
/
Copy pathTSSWDonchianChannel.h
63 lines (49 loc) · 2.25 KB
/
TSSWDonchianChannel.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
51
52
53
54
55
56
57
58
59
60
61
62
/************************************************************************
* Copyright(c) 2019, 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. *
************************************************************************/
/*
* File: TSSWDonchianChannel.h
* Author: rpb
*
* Created on May 3, 2019, 1:25 PM
*/
#ifndef TSSWDONCHIANCHANNEL_H
#define TSSWDONCHIANCHANNEL_H
#include "RunningMinMax.h"
#include "TimeSeriesSlidingWindow.h"
namespace ou { // One Unified
namespace tf { // TradeFrame
class TSSWDonchianChannel:
public RunningMinMax<TSSWDonchianChannel,double>,
public TimeSeriesSlidingWindow<TSSWDonchianChannel,Price>
{
friend RunningMinMax<TSSWDonchianChannel,double>;
friend TimeSeriesSlidingWindow<TSSWDonchianChannel,Price>;
public:
TSSWDonchianChannel( Prices& prices, time_duration tdWindowWidth, size_t nWindowWidth );
//TSSWDonchianChannel( const TSSWDonchianChannel& orig );
virtual ~TSSWDonchianChannel( );
using minmax = RunningMinMax<TSSWDonchianChannel,double>;
double Max() const { return minmax::Max(); }
double Min() const { return minmax::Min(); }
protected:
void Add( const Price& ); // sliding window crtp recipient
void Expire( const Price& ); // sliding window crtp recipient
//void PostUpdate(); // sliding window crtp recipient
//void UpdateMax( const double& ); // CRTP runningminmax callback recipient
//void UpdateMin( const double& ); // CRTP runningminmax callback recipient
private:
};
} // namespace tf
} // namespace ou
#endif /* TSSWDONCHIANCHANNEL_H */