[FEBE] Buy

stable
By pshai in Other Published October 2020 👁 1,689 views 💬 0 comments

Description

Buy command for FEBE. More information about FEBE: https://www.haasscripts.com/blog/guides/first-ever-bot-engine-febe-for-haasscript/
HaasScript
DefineCommand('FEBE_Buy', 'Used to set buy settings for FEBE')

-- the input for parameters
local params = DefineParameter(ListDynamicType, 'params', 'Parameters for FEBE', true, {}, 'NewArray')

-- command related parameters
local order_timeout = DefineParameter(NumberType, 'order_timeout', 'Order timeout in seconds. Default: 600 (10 minutes)', false, 600, 'Input, Number')
local order_refill = DefineParameter(BooleanType, 'order_refill', 'Whether or not the filled/cancelled orders should be refilled. Default: false', false, false, 'True, False')
local order_type = DefineParameter(EnumType, 'order_type', 'Order type used for the buy orders. If MarketOrderType is used, the buy order(s) will execute immediately and will re-trigger after order_timeout if order_refill is set to TRUE. Default: LimitOrderType',
        false, LimitOrderType, 'LimitOrderType, MarketOrderType, MakerOrCancelOrderType')

-- a little hack to bypass private vs shared resources error
local p = {}
for i=1, #params do
    p[i] = params[i]
end

p[#p + 1] = {
    's_buy', -- the command for CC_FEBE_Execute()
    {
        -- the parameters for this particular block
        {'order_timeout', order_timeout},
        {'order_refill', order_refill},
        {'order_type', CC_FEBE_ParseOrderType(order_type)}
    }
}

-- the output for parameters, for easy continuation
DefineOutput(ListDynamicType, p, 'Input parameters with added buy information', 'CC_FEBE_Execute')

0 Comments

Sign in to leave a comment.

No comments yet. Be the first!