[FEBE] Orders

0 58 Views No Comments 2 months ago
  • Order settings command for FEBE.

    More information about FEBE: https://www.haasscripts.com/blog/guides/first-ever-bot-engine-febe-for-haasscript/

    HaasScript Code
    DefineCommand('FEBE_Orders', 'Used to set order settings for FEBE')
    
    local params = DefineParameter(ListDynamicType, 'params', 'Parameters for FEBE', true, {}, 'NewArray')
    local max_open = DefineParameter(NumberType, 'max_open', 'Maximum amount of open orders. Default: 1', false, 1, 'Input, Number')
    local size = DefineParameter(NumberType, 'size', 'Size of the order(s). Default: TradeAmount()', false, TradeAmount(), 'Input, Number, TradeAmount')
    local spread = DefineParameter(NumberType, 'spread', 'Spread between orders in percentage. If only one order, will be considered as the distance from current prices. Default: 0.1', false, 0.1, 'Input, Number')
    local cancel_dist = DefineParameter(NumberType, 'cancel_dist', 'Cancel distance threshold percentage, after which orders will be cancelled and re-positioned. Default: 0 (deactivated)', false, 0, 'Input, Number')
    
    local p = {}
    for i=1, #params do
        p[i] = params[i]
    end
    
    p[#p + 1] = {
        's_orders',
        {
            {'max_open', max_open},
            {'size', size},
            {'spread', spread},
            {'cancel_dist', cancel_dist}
        }
    }
    
    DefineOutput(ListDynamicType, p, 'Input parameters with added order information', 'CC_FEBE_Execute, CC_FEBE_TakeProfit, CC_FEBE_StopLoss, CC_FEBE_Buy, CC_FEBE_Sell')
Login or Register to Comment

Unlock your crypto trading potential

Create a free account and enjoy everything we have to offer.

Join for Free