EnableHighSpeedUpdates(true)
HideOrderSettings()
HideTradeAmountSettings()
--===================================================================
-- == Miscellaneous Usefulness
-- deep clone an object
function clone(original)
local copy = {}
for k, v in pairs(original) do
if GetType(v) == ArrayDataType then
v = clone(v)
end
copy[k] = v
end
return copy
end
--===================================================================
-- == Logger
local LoggerLevels = {
ErrorsOnly = 'Errors Only',
ErrorsAndWarnings = 'Erorrs & Warnings',
All = 'All'
}
local Logger = {
_level = InputOptions('DEBUG Level',
LoggerLevels.All,
LoggerLevels,
{group = ' DEBUG'}),
_in = 'Main',
_prevIn = {},
_log = Log,
_warn = LogWarning,
_error = LogError
}
function Logger:level()
if Logger._level == LoggerLevels.ErrorsOnly then
return 0
elseif Logger._level == LoggerLevels.ErrorsAndWarnings then
return 1
elseif Logger._level == LoggerLevels.All then
return 2
end
LogError('Logger level undefined: "' .. Logger._level .. '"')
end
function Logger:where()
local ret = ''
local prevs = self._prevIn
if #prevs > 0 then
for i = 1, #prevs do
if prevs[i] != '' and #prevs[i] > 0 then
ret = ret .. prevs[i] .. '::'
end
end
end
return ret .. self._in
end
function Logger:enter(to)
self._prevIn = ArrayAdd(self._prevIn, self._in)
self._in = to
end
function Logger:exit()
self._in = ArrayLast(self._prevIn)
self._prevIn = ArrayPop(self._prevIn)
end
function Logger:log(msg, color)
if self:level() >= 2 then
if not color then
color = ''
end
local _in = Logger:where()
self._log('['.._in..'] '..msg, color)
end
end
function Logger:warn(msg)
if self:level() >= 1 then
local _in = Logger:where()
self._warn('['.._in..'] '..msg)
end
end
function Logger:error(msg)
local _in = Logger:where()
self._error('['.._in..'] '..msg)
DeactivateBot('FCB Deactivation on Error')
end
--===================================================================
--===================================================================
--===================================================================
-- == Options for inputs
local options = {
SpreadTypes = {
Fixed = 'Fixed Amount',
Percentage = 'Percentage',
PercentageBoost = 'Percentage With Boost',
Exponential = 'Exponential'
},
StartControlTypes = {
AbovePrice = 'Above Price',
BelowPrice = 'Below Price'
},
Currencies = {
Base = 'Base',
Quote = 'Quote'
},
Jun 07, 23, 10:30:45 Bot deactivated
Jun 07, 23, 10:30:45 Backtest start date: 06/07/23 10:30:45 GTM+0
Jun 07, 23, 10:30:45 Backtest end date: 06/07/23 10:30:45 GTM+0
Jun 07, 23, 10:30:45 Backtest took: 00:00:01.6642358ms
Jun 07, 23, 10:30:45 ----- Custom Report -----
Jun 07, 23, 10:30:45 Estimated Profit: 0.01 BTC
Jun 07, 23, 10:30:45 ----- Backtest report BINANCE_BNB_BTC_ -----
Jun 07, 23, 10:30:45 Gross profits: 100.00000000 BNB
Jun 07, 23, 10:30:45 Fee costs: 10.00000000 BNB
Jun 07, 23, 10:30:45 Realized profits: 90.00000000 BNB
Jun 07, 23, 10:30:45 Return on investment: 10.0000 %
Jun 07, 23, 10:30:45 Price change: 0.0306%
Jun 07, 23, 10:30:45 Closed positions: 100x
Jun 07, 23, 10:30:45 Profitable positions: 60x (90.00%)
Jun 07, 23, 10:30:45 Losing positions: 40x (10.00%)
Jun 07, 23, 10:30:45 Average margin: 5.00000000 BNB
Jun 07, 23, 10:30:45 Average realized profits: 10.00000000 BNB
Jun 07, 23, 10:30:45 Executed orders: 100x
Jun 07, 23, 10:30:45 Completed order: 100x
Jun 07, 23, 10:30:45 Average open time: 10 seconds
Jun 07, 23, 10:30:45 ----- Performance report BINANCE_BNB_BTC_ -----
Jun 07, 23, 10:30:45 Max. DrawDown: 1.00% / 40.00000000 BNB
Jun 07, 23, 10:30:45 Sharpe Ratio: 1.00
Jun 07, 23, 10:30:45 Sortino Ratio: 1.00
Jun 07, 23, 10:30:45 Win %: 3.00 %
Jun 07, 23, 10:30:45 Profit Ratio: 3.00
Jun 07, 23, 10:30:45 Profit Factor: 3.00
Jun 07, 23, 10:30:45 CPC Index: 1.00
Jun 07, 23, 10:30:45 Tail Ratio: 2.00
Jun 07, 23, 10:30:45 Common Sense Ratio: 2.00
Jun 07, 23, 10:30:45 Outlier Win Ratio: 3.00
Jun 07, 23, 10:30:45 Outlier Loss Ratio: 1.00
Jun 07, 23, 10:30:45 Profit Margin Ratio: 54.00
Jun 07, 23, 10:30:45 Biggest Win: 100.00000000
Jun 07, 23, 10:30:45 Biggest Loss: -100.00000000
Jun 07, 23, 10:30:45 Highest Point in PNL: 5.00000000
Jun 07, 23, 10:30:45 Lowest Point in PNL: -5.00000000
*These numbers are for illustration only and do not reflect past or future performance.