Package com.strategyquant.datalib
Class TimeframeManager
java.lang.Object
com.strategyquant.datalib.TimeframeManager
Helper object to compare and manage timeframes
-
Field Summary
Modifier and TypeFieldDescriptionstatic String
The file path.static org.slf4j.Logger
The Constant Log.static int
The Constant PRECISION_BASE_TF.static int
The Constant PRECISION_SELECTED_TF.static String
The Constant TF_D1.static String
The Constant TF_H1.static String
The Constant TF_H12.static String
The Constant TF_H2.static String
The Constant TF_H3.static String
The Constant TF_H4.static String
The Constant TF_H6.static String
The Constant TF_H8.static int
The Constant TF_INT_UNKNOWN.static String
The Constant TF_INTRADAY.static String
The Constant TF_M1.static String
The Constant TF_M15.static String
The Constant TF_M3.static String
The Constant TF_M30.static String
The Constant TF_M5.static String
The Constant TF_MONTHLY.static String
The Constant TF_TICK.static String
period constants, it doesn't need to be only time-based period, but also Range and Renko periodstatic String
The Constant TF_WEEKLY. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addTimeframe(String tf)
Adds the timeframe.static long
Gets the millis.Gets the predefined timeframes.static long
Gets the TF hash.static String
getTFName(long millis)
Gets the TF name.Gets the timeframes.static String
M(int minutes)
M.static boolean
TF exists.static String
translateSQ3TFToString(int timeframe)
Translate SQ 3 TF to string.static int
translateToMTConstant(String timeframe)
Translate to MT constant.
-
Field Details
-
Log
public static final org.slf4j.Logger LogThe Constant Log. -
TF_UNKNOWN
period constants, it doesn't need to be only time-based period, but also Range and Renko period- See Also:
- Constant Field Values
-
TF_INTRADAY
The Constant TF_INTRADAY.- See Also:
- Constant Field Values
-
TF_INT_UNKNOWN
public static final int TF_INT_UNKNOWNThe Constant TF_INT_UNKNOWN.- See Also:
- Constant Field Values
-
TF_TICK
The Constant TF_TICK.- See Also:
- Constant Field Values
-
TF_M1
The Constant TF_M1.- See Also:
- Constant Field Values
-
TF_M3
The Constant TF_M3.- See Also:
- Constant Field Values
-
TF_M5
The Constant TF_M5.- See Also:
- Constant Field Values
-
TF_M15
The Constant TF_M15.- See Also:
- Constant Field Values
-
TF_M30
The Constant TF_M30.- See Also:
- Constant Field Values
-
TF_H1
The Constant TF_H1.- See Also:
- Constant Field Values
-
TF_H2
The Constant TF_H2.- See Also:
- Constant Field Values
-
TF_H3
The Constant TF_H3.- See Also:
- Constant Field Values
-
TF_H4
The Constant TF_H4.- See Also:
- Constant Field Values
-
TF_H6
The Constant TF_H6.- See Also:
- Constant Field Values
-
TF_H8
The Constant TF_H8.- See Also:
- Constant Field Values
-
TF_H12
The Constant TF_H12.- See Also:
- Constant Field Values
-
TF_D1
The Constant TF_D1.- See Also:
- Constant Field Values
-
TF_WEEKLY
The Constant TF_WEEKLY.- See Also:
- Constant Field Values
-
TF_MONTHLY
The Constant TF_MONTHLY.- See Also:
- Constant Field Values
-
PRECISION_SELECTED_TF
public static final int PRECISION_SELECTED_TFThe Constant PRECISION_SELECTED_TF.- See Also:
- Constant Field Values
-
PRECISION_BASE_TF
public static final int PRECISION_BASE_TFThe Constant PRECISION_BASE_TF.- See Also:
- Constant Field Values
-
filePath
The file path.
-
-
Constructor Details
-
TimeframeManager
public TimeframeManager()Instantiates a new timeframe manager.
-
-
Method Details
-
getTimeframes
Gets the timeframes.- Returns:
- the timeframes
-
getPredefinedTimeframes
Gets the predefined timeframes.- Returns:
- the predefined timeframes
-
addTimeframe
Adds the timeframe.- Parameters:
tf
- the tf- Throws:
Exception
- the exception
-
translateSQ3TFToString
Translate SQ 3 TF to string.- Parameters:
timeframe
- the timeframe- Returns:
- the string
-
translateToMTConstant
Translate to MT constant.- Parameters:
timeframe
- the timeframe- Returns:
- the int
-
M
M.- Parameters:
minutes
- the minutes- Returns:
- the string
-
getMillis
Gets the millis.- Parameters:
tf
- the tf- Returns:
- the millis
- Throws:
TradingException
- the trading exception
-
getTFHash
Gets the TF hash.- Parameters:
tf
- the tf- Returns:
- the TF hash
- Throws:
TradingException
- the trading exception
-
getTFName
Gets the TF name.- Parameters:
millis
- the millis- Returns:
- the TF name
-
TFExists
TF exists.- Parameters:
timeframe
- the timeframe- Returns:
- true, if successful
-