$pumpPercent = 3.8;
$dumpPercent = -3.8;
$debug = $_GET['debug'];
$bitfinexAPI = new Bitfinex(BITFINEX_API_KEY, BITFINEX_API_SECRET);
$candleData = new Database($db);
if ($debug == 1) {
    //debug mode - no trading, output only
    echo '<< debug mode >>';
    $newline = '<br>';
} else {
    //live mode - output is sent to email - \n is newline in emails
    $newline = "\n";
}
$bitfinexOptions = $candleData->get_options();
$bitfinexTrading = $bitfinexOptions['bitfinex_trading'];
$bitfinexAPI->isBitfinexTrading($bitfinexTrading);
$optionsArray = array('bitfinex_currency', 'bitfinex_balance', 'bitfinex_pd_percent', 'bitfinex_sl_range', 'bitfinex_trading');
$output .= $newline . $newline . 'api_options' . $newline;
foreach ($optionsArray as $thisOpt) {
    $output .= ' ' . $thisOpt . ': ' . $bitfinexOptions[$thisOpt] . ' | ';
}
if ($bitfinexTrading == 1) {
    $output .= 'Bitfinex trading is ON';
} else {
    $output .= 'Bitfinex trading is OFF';
}
$currency = $bitfinexOptions['bitfinex_currency'];
//currency defined in api_options
$symbol = strtoupper($currency . 'usd');
//currency symbol used for making orders
$rangePercent = $bitfinexOptions['bitfinex_sl_range'];