com.mytrendtimer.trendtimer
Class MyTrendTimer

java.lang.Object
  extended by com.mytrendtimer.trendtimer.MyTrendTimer

public class MyTrendTimer
extends java.lang.Object

The MyTrendTimer main class implement a mathematical model to provide Buy and Sell signals for major indexes.

Version:
v0.99.98.2
Author:
FRM

Field Summary
static java.lang.String baseDir
          The baseDir (found in xml config file) at runtime.
static java.lang.String CSV_EXTENSION
          The extension used in comma-separated value file
static java.lang.String DATE_FMT_CSV_QUOTE_FILE
          The date format found in the CSV source Quote File
static java.lang.String DATE_FMT_IN_QUOTE_FILE_NAME
          The date format in the quote file name
static java.lang.String DATE_FMT_US_OUTPUT
          The date format displayed in some results (eg on the chart image, the signal date etc...)
static java.lang.String IMG_WEB_DIR
          The image directory relative to the webRoot
static java.lang.String IN_CSV_SEPARATOR
          The csv separator/delimiter for the input file
static java.lang.String INTRA_FILE_NAME_SEPARATOR
          What we use in file name to separate the fields.
static java.lang.String LOG4J_PROPERTIES_FILE
          The log4j propertie file path (relative to dirTTHOME !)
static java.lang.String[] MONTHS
          The months of the year
 int nbrWarningsAtRunTime
          The number of warnings found at run time.
static java.lang.String OUT_CSV_FILE_PATH
          The path (relative to baseDir !)
static java.lang.String OUT_CSV_SEPARATOR
          The csv separator/delimiter for the output file
static java.lang.String OUT_HTML_FILE_PATH
          The path (relative to baseDir !)
static java.lang.String OUT_XML_FILE_PATH
          The path (relative to baseDir !)
static java.lang.String PROG_NAME_AND_VERSION
          The program name and version.
static java.lang.String QUOTE_FILE_DATA_DIR
          The path (relative to dirTTHOME !)
static java.lang.String QUOTE_FILE_WEB_DIR
          The quote file dir relative to webroot
 long startTimeMillis
          The time when the MyTrendTimer object was instanciated
static java.lang.String XML_CONFIG_FILE
          The config file path (relative to dirTTHOME !)
static java.lang.String XSL_FILE_NAME
          The xsl file name used for xalan transformation
static java.lang.String XSL_FILE_PATH
          The path (relative to baseDir !)
 
Constructor Summary
MyTrendTimer()
          Constructor for the controller MyTrendTimer object
 
Method Summary
static void appendInDelimittedAccumul(java.lang.StringBuffer accumulatorArg, java.lang.String dataToAppendArg)
          Append data in a string buffer and make it delimitted (such as CSV)
static int calcDateDiff(java.util.Date fromDateArg, java.util.Date tillDateArg)
          Calculate the datediff between 2 date strings
static java.lang.String composeXmlCommentLine(java.lang.String dataArg)
          The XML (one line) comment element Composer.
static java.lang.String composeXmlLine(java.lang.String elementNameArg, java.lang.String dataArg)
          The XML element Composer
static org.jfree.data.xy.XYDataset createBuyDataset()
          Return a dataset for the JFreeChart.
static org.jfree.data.xy.IntervalXYDataset createOsc1Dataset()
          Return a dataset for the JFreeChart.
static org.jfree.data.xy.IntervalXYDataset createOsc2Dataset()
          Return a dataset for the JFreeChart.
static org.jfree.data.xy.IntervalXYDataset createQuoteDataset()
          Return a dataset for the JFreeChart.
static org.jfree.data.xy.XYDataset createSellDataset()
          Return a dataset for the JFreeChart.
 void incrementWarningsAtRuntime()
          Increase the number of warnings found during run time
static void main(java.lang.String[] args)
          This is the MAIN method of the MyTrendTimer Class.
static void writeInstrument(OutFileWritter xmlResultFileObjArg, java.lang.String xmlElementArg, java.lang.String fullNameArg, java.lang.String symbNameArg, java.lang.String currencyNameArg, java.lang.String commentNameArg, java.lang.String underlyingNameArg)
          Write instrument data into output xml file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

baseDir

public static java.lang.String baseDir
The baseDir (found in xml config file) at runtime.


CSV_EXTENSION

public static final java.lang.String CSV_EXTENSION
The extension used in comma-separated value file

See Also:
Constant Field Values

DATE_FMT_CSV_QUOTE_FILE

public static final java.lang.String DATE_FMT_CSV_QUOTE_FILE
The date format found in the CSV source Quote File

See Also:
Constant Field Values

DATE_FMT_IN_QUOTE_FILE_NAME

public static final java.lang.String DATE_FMT_IN_QUOTE_FILE_NAME
The date format in the quote file name

See Also:
Constant Field Values

DATE_FMT_US_OUTPUT

public static final java.lang.String DATE_FMT_US_OUTPUT
The date format displayed in some results (eg on the chart image, the signal date etc...)

See Also:
Constant Field Values

IMG_WEB_DIR

public static final java.lang.String IMG_WEB_DIR
The image directory relative to the webRoot

See Also:
Constant Field Values

IN_CSV_SEPARATOR

public static final java.lang.String IN_CSV_SEPARATOR
The csv separator/delimiter for the input file

See Also:
Constant Field Values

INTRA_FILE_NAME_SEPARATOR

public static final java.lang.String INTRA_FILE_NAME_SEPARATOR
What we use in file name to separate the fields. (f.i. "_" in INDEX_YYYMMDD.csv)

See Also:
Constant Field Values

LOG4J_PROPERTIES_FILE

public static final java.lang.String LOG4J_PROPERTIES_FILE
The log4j propertie file path (relative to dirTTHOME !) and name

See Also:
Constant Field Values

MONTHS

public static final java.lang.String[] MONTHS
The months of the year


nbrWarningsAtRunTime

public int nbrWarningsAtRunTime
The number of warnings found at run time.


OUT_CSV_FILE_PATH

public static final java.lang.String OUT_CSV_FILE_PATH
The path (relative to baseDir !) where the output (.csv) file is going to be created

See Also:
Constant Field Values

OUT_CSV_SEPARATOR

public static final java.lang.String OUT_CSV_SEPARATOR
The csv separator/delimiter for the output file

See Also:
Constant Field Values

OUT_HTML_FILE_PATH

public static final java.lang.String OUT_HTML_FILE_PATH
The path (relative to baseDir !) where the html output file in going to be created

See Also:
Constant Field Values

OUT_XML_FILE_PATH

public static final java.lang.String OUT_XML_FILE_PATH
The path (relative to baseDir !) where the xml output file in going to be created

See Also:
Constant Field Values

PROG_NAME_AND_VERSION

public static final java.lang.String PROG_NAME_AND_VERSION
The program name and version. Independant from the javadoc version.

See Also:
Constant Field Values

QUOTE_FILE_DATA_DIR

public static final java.lang.String QUOTE_FILE_DATA_DIR
The path (relative to dirTTHOME !) where the quote files are

See Also:
Constant Field Values

QUOTE_FILE_WEB_DIR

public static final java.lang.String QUOTE_FILE_WEB_DIR
The quote file dir relative to webroot

See Also:
Constant Field Values

startTimeMillis

public long startTimeMillis
The time when the MyTrendTimer object was instanciated


XML_CONFIG_FILE

public static final java.lang.String XML_CONFIG_FILE
The config file path (relative to dirTTHOME !) and name

See Also:
Constant Field Values

XSL_FILE_NAME

public static final java.lang.String XSL_FILE_NAME
The xsl file name used for xalan transformation

See Also:
Constant Field Values

XSL_FILE_PATH

public static final java.lang.String XSL_FILE_PATH
The path (relative to baseDir !) where the xsl file for xalan transformation should be stored

See Also:
Constant Field Values
Constructor Detail

MyTrendTimer

public MyTrendTimer()
Constructor for the controller MyTrendTimer object

Method Detail

appendInDelimittedAccumul

public static void appendInDelimittedAccumul(java.lang.StringBuffer accumulatorArg,
                                             java.lang.String dataToAppendArg)
Append data in a string buffer and make it delimitted (such as CSV)

Parameters:
accumulatorArg - the accumulator name
dataToAppendArg - the string data to append

calcDateDiff

public static int calcDateDiff(java.util.Date fromDateArg,
                               java.util.Date tillDateArg)
                        throws java.lang.Exception
Calculate the datediff between 2 date strings

Parameters:
fromDateArg - From date
tillDateArg - Till date
Returns:
differenceInDays An integer of the number of days
Throws:
java.lang.Exception

composeXmlCommentLine

public static java.lang.String composeXmlCommentLine(java.lang.String dataArg)
The XML (one line) comment element Composer. The comment line length is fixed.

Parameters:
dataArg - the data between the opening and the closing XML comment * element.
Returns:
XMLCommentLine

composeXmlLine

public static java.lang.String composeXmlLine(java.lang.String elementNameArg,
                                              java.lang.String dataArg)
The XML element Composer

Parameters:
elementNameArg - the name of the xml element
dataArg - the data between the opening and the closing element. Keyword open or close can be used.
Returns:
XMLLine

createBuyDataset

public static org.jfree.data.xy.XYDataset createBuyDataset()
Return a dataset for the JFreeChart. Dataset was populated in the main loop.

Returns:
A dataset with Buy signals

createOsc1Dataset

public static org.jfree.data.xy.IntervalXYDataset createOsc1Dataset()
Return a dataset for the JFreeChart. Dataset was populated in the main loop..

Returns:
A dataset with Osc1 (detailed chart).

createOsc2Dataset

public static org.jfree.data.xy.IntervalXYDataset createOsc2Dataset()
Return a dataset for the JFreeChart. Dataset was populated in the main loop.

Returns:
AA dataset with Osc2 (detailed chart).

createQuoteDataset

public static org.jfree.data.xy.IntervalXYDataset createQuoteDataset()
Return a dataset for the JFreeChart. Dataset was populated in the main loop.

Returns:
A dataset with quotes.

createSellDataset

public static org.jfree.data.xy.XYDataset createSellDataset()
Return a dataset for the JFreeChart. Dataset was populated in the main loop.

Returns:
A dataset with Sell signals

incrementWarningsAtRuntime

public void incrementWarningsAtRuntime()
Increase the number of warnings found during run time


main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
This is the MAIN method of the MyTrendTimer Class. This class (especially the main method) should act as a controler for the other classes.

Used to regenerate :

grep BIGSTEP MyTrendTimer.java | sed 's/* BIGSTEP : /\<\l\i\>/'

The BIGSTEPS are :

For more information on the different features of MyTrendTimer, visit MyTrendTimer.com

Throws:
java.lang.Exception

writeInstrument

public static void writeInstrument(OutFileWritter xmlResultFileObjArg,
                                   java.lang.String xmlElementArg,
                                   java.lang.String fullNameArg,
                                   java.lang.String symbNameArg,
                                   java.lang.String currencyNameArg,
                                   java.lang.String commentNameArg,
                                   java.lang.String underlyingNameArg)
Write instrument data into output xml file.

Parameters:
xmlResultFileObjArg - the xml file
xmlElementArg - the xmlElementArg
fullNameArg - the fullNameArg
symbNameArg - the symbNameArg
currencyNameArg - the currencyNameArg
commentNameArg - the commentNameArg
underlyingNameArg - the underlyingNameArg