Download details

ichinscratchy v0.3, released on December, 17th 2017

changes from v0.2.1

New features:

  • changed symbol file contents and layout, new symbol file includes information that is needed for money management:
    # Indices =========================================================================================
    #symbol     filename        tradeable?      ticks/pips     contract size    cur     type        # comment
    DAX         DAX.csv             1           0.01              1             EUR     CFDFUT      # DAX30
    DJI         DOW.csv             1           0.01              1             USD     CFDFUT      # Dow Jones
    # Futures =========================================================================================
    #symbol     filename        tradeable?      ticks/pips     contract size    cur     type        # comment
    #BuFu        BuFu.csv           1           0.01              1             EUR     CFDFUT      # Euro Bund Future
    # Forex ===========================================================================================
    #symbol     filename        tradeable?      ticks/pips     contract size    cur     type        # comment
    EURJPY      EURJPY.csv          1           0.001           100000          EUR     CFDCUR      # Euro/ Japanese Yen
    EURUSD      EURUSD.csv          0           0.00001         100000          EUR     CFDCUR      # Euro/US Dollar
    comments still start with a '#', can be as a separate comment line or at the end of a line.
    Basic parsing and sanity checks are implemented, still user has to put some thought into the config. This change breaks compatibility of the symbol file with former releases.
  • changed/ new program start parameters:
    • added command line option -c/--configfile which specifies the name of the configuration under /config. This allows to run several systems/configurations from within one main folder (adjust database name accordingly)
    • when using verbose option -v/--verbose the program now spits out the account info (balance, equity and risk- free equity) each day, together with the already known buy-/sell signals.
    • when using the portfolio option -p/--portfolio the program shows the current account info (balance, equity and risk- free equity) in account currency, for each position current value (and risk free value) is shown
    • when using the report option -r/--report all wins/losses are now calculated in account currency
  • database changes: Please note that the changes mentioned below break compatibility with prior program versions!
    • changed all float fields to decimal(x,y). With float under certain circumstances strange behaviour occured, as floats are not represented/stored exactly. Fixed decimals are exact representations instead.
    • added new table account that stores some values which are needed to calculate profit/losses, your current cash, equity and such. The table hosts variables with their corresponding values. As in theory this table can store arbitrary variables and values, the following variables are currently needed by the program (and expected in the table):
      • balance (current free cash in account)
      • equity (free cash plus current value of positions- if sold right NOW)
      • risk_free_equity (free cash plus current value of positions if all their stop losses were hit NOW)
      • virgin_flag (initialized with 1 when creating db, valid until first position is bought- after that 0)
    • added new table currency_translation that holds all information for translations from/to account currency
    • added new fields to indicators_daily: ADXregime_filter
    • the tables quotes_dailyindicators_dailyichimoku_daily and ichimoku_daily_signals now have an additional column: daynr, which holds the date as "days since 1900-01-01"
    • the table orderbook_daily now has 2 price fields: price which holds the price in the symbol´s currency and cost_per_item which holds the buying price in account´s currency
    • the table portfolio now has 3 price fields: price_buy and price_last which hold the buying and the latest price in market´s currency and cost_per_item which holds the buying costs in accounts currency
  • changed/new config file options:
    • new: ACCOUNT_CURRENCY. This parameter sets the currency of your account. Currently implemented and valid values are:
      • EUR (Euro)
      • USD (US Dollar)
      • JPY (Japanese Yen)
    • new: INDI_ADX_PERIOD. This option specifies the period, over which the ADX shall be smoothed. Basically, the ADX is an exponential average of the DMI, which in turn contains the ATR, an exponential average of the True Range. INDI_ADX_PERIOD specifies the number of periods in those exponential moving averages. Default 14
    • new: SIGNAL_REGIME_FILTER. This option switches the market regime filter on (and choses which one to use). In sideways/non- trending markets signals will not be executed, resulting in lower trading frequency but higher quality signals. Following options are valid:
      • none (Turn market regime filter off)
      • ADX (Use Average Directional Index)
      • TNI (Trend Normality Indicator by @tasciccac)
    • new: SIGNAL_REGIME_ADX_THRESH. When SIGNAL_REGIME_FILTER is set to ADX, this option specifies the threshhold under which a market will be considered as sideways (=trendless). In this case signals in this specific market won't be executed. Default is 30.
    • new: STARTING_BALANCE, which sets starting account balance at begin of backtest/live trading
    • new: RISK_PER_POSITION which sets risk of a new position in % of current equity. In conjunction with the calculated initial stop loss this determines the size of the new position (in terms of how many units will be bought).
  • under /tools a new script sql2csv was created. This little helper reads in the config, executes a sql script within the same directory and gives the results in a .csv file. Two example files get_adx.sql (which gets date, close and ADX for a specific symbol) and export_orderbook.sql (which replaces the former script) are already included (and likely to get more in the future)
  • now expects a command line option -c followed by config file name (located under ../config)
  • small update to statistics report: now also display overall win/loss


  • fixed a (longtime) bug that caused execution to exclude the last day of available data
Size:2.11 MB