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'
},
Nov 30, 23, 12:15:14 Bot deactivated
Nov 30, 23, 12:15:14 Backtest start date: 11/30/23 12:15:14 GTM+0
Nov 30, 23, 12:15:14 Backtest end date: 11/30/23 12:15:14 GTM+0
Nov 30, 23, 12:15:14 Backtest took: 00:00:01.6642358ms
Nov 30, 23, 12:15:14 ----- Custom Report -----
Nov 30, 23, 12:15:14 Estimated Profit: 0.01 BTC
Nov 30, 23, 12:15:14 ----- Backtest report BINANCE_BNB_BTC_ -----
Nov 30, 23, 12:15:14 Gross profits: 100.00000000 BNB
Nov 30, 23, 12:15:14 Fee costs: 10.00000000 BNB
Nov 30, 23, 12:15:14 Realized profits: 90.00000000 BNB
Nov 30, 23, 12:15:14 Return on investment: 10.0000 %
Nov 30, 23, 12:15:14 Price change: 0.0306%
Nov 30, 23, 12:15:14 Closed positions: 100x
Nov 30, 23, 12:15:14 Profitable positions: 60x (90.00%)
Nov 30, 23, 12:15:14 Losing positions: 40x (10.00%)
Nov 30, 23, 12:15:14 Average margin: 5.00000000 BNB
Nov 30, 23, 12:15:14 Average realized profits: 10.00000000 BNB
Nov 30, 23, 12:15:14 Executed orders: 100x
Nov 30, 23, 12:15:14 Completed order: 100x
Nov 30, 23, 12:15:14 Average open time: 10 seconds
Nov 30, 23, 12:15:14 ----- Performance report BINANCE_BNB_BTC_ -----
Nov 30, 23, 12:15:14 Max. DrawDown: 1.00% / 40.00000000 BNB
Nov 30, 23, 12:15:14 Sharpe Ratio: 1.00
Nov 30, 23, 12:15:14 Sortino Ratio: 1.00
Nov 30, 23, 12:15:14 Win %: 3.00 %
Nov 30, 23, 12:15:14 Profit Ratio: 3.00
Nov 30, 23, 12:15:14 Profit Factor: 3.00
Nov 30, 23, 12:15:14 CPC Index: 1.00
Nov 30, 23, 12:15:14 Tail Ratio: 2.00
Nov 30, 23, 12:15:14 Common Sense Ratio: 2.00
Nov 30, 23, 12:15:14 Outlier Win Ratio: 3.00
Nov 30, 23, 12:15:14 Outlier Loss Ratio: 1.00
Nov 30, 23, 12:15:14 Profit Margin Ratio: 54.00
Nov 30, 23, 12:15:14 Biggest Win: 100.00000000
Nov 30, 23, 12:15:14 Biggest Loss: -100.00000000
Nov 30, 23, 12:15:14 Highest Point in PNL: 5.00000000
Nov 30, 23, 12:15:14 Lowest Point in PNL: -5.00000000
*These numbers are for illustration only and do not reflect past or future performance.