[FEBE] StopLoss

0 42 Views No Comments 3 weeks ago
  • StopLoss command for FEBE.

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

    HaasScript Code
    DefineCommand('FEBE_StopLoss', 'Used to set stop-loss settings for FEBE')
    
    local params = DefineParameter(ListDynamicType, 'params', 'Parameters for FEBE', true, {}, 'NewArray')
    local percent = DefineParameter(NumberType, 'percent', 'Stop-loss percentage value. Default: 0.1', false, 0.1, 'Input, Number')
    local order_type = DefineParameter(EnumType, 'order_type', 'Type of the stop-loss order. If using natives, such as stops, FEBE will place them beforehand. Default: LimitOrderType', false, LimitOrderType, 'InputOrderType, LimitOrderType, MarketOrderType, MakerOrCancelOrderType, StopLimitOrderType, StopMarketOrderType, TakeProfitLimitOrderType, TakeProfitMarketOrderType')
    
    params[#params + 1] = {
        's_sl',
        {
            {'percent', percent},
            {'order_type', CC_FEBE_ParseOrderType(order_type)}
        }
    }
    
    DefineOutput(ListDynamicType, params, 'Input parameters with added stop-loss information', 'CC_FEBE_Execute, CC_FEBE_Orders, 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