Class TimeframeManager

java.lang.Object
com.strategyquant.datalib.TimeframeManager

public class TimeframeManager extends Object
Helper object to compare and manage timeframes
  • Field Details

  • Constructor Details

    • TimeframeManager

      public TimeframeManager()
      Instantiates a new timeframe manager.
  • Method Details

    • getTimeframes

      public static ArrayList<String> getTimeframes()
      Gets the timeframes.
      Returns:
      the timeframes
    • getPredefinedTimeframes

      public static ArrayList<String> getPredefinedTimeframes()
      Gets the predefined timeframes.
      Returns:
      the predefined timeframes
    • addTimeframe

      public static void addTimeframe(String tf) throws Exception
      Adds the timeframe.
      Parameters:
      tf - the tf
      Throws:
      Exception - the exception
    • translateSQ3TFToString

      public static String translateSQ3TFToString(int timeframe)
      Translate SQ 3 TF to string.
      Parameters:
      timeframe - the timeframe
      Returns:
      the string
    • translateToMTConstant

      public static int translateToMTConstant(String timeframe)
      Translate to MT constant.
      Parameters:
      timeframe - the timeframe
      Returns:
      the int
    • M

      public static String M(int minutes)
      M.
      Parameters:
      minutes - the minutes
      Returns:
      the string
    • getMillis

      public static long getMillis(String tf) throws TradingException
      Gets the millis.
      Parameters:
      tf - the tf
      Returns:
      the millis
      Throws:
      TradingException - the trading exception
    • getTFHash

      public static long getTFHash(String tf) throws TradingException
      Gets the TF hash.
      Parameters:
      tf - the tf
      Returns:
      the TF hash
      Throws:
      TradingException - the trading exception
    • getTFName

      public static String getTFName(long millis)
      Gets the TF name.
      Parameters:
      millis - the millis
      Returns:
      the TF name
    • TFExists

      public static boolean TFExists(String timeframe)
      TF exists.
      Parameters:
      timeframe - the timeframe
      Returns:
      true, if successful