[FEBE] TakeProfit

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

Description

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

local params = DefineParameter(ListDynamicType, 'params', 'Parameters for FEBE', true, {}, 'NewArray')
local percent = DefineParameter(NumberType, 'percent', 'Take-profit percentage value. Default: 0.1', false, 0.1, 'Input, Number')
local order_type = DefineParameter(EnumType, 'order_type', 'Type of the take-profit order. If using natives, such as stops, FEBE will place them beforehand. Default: LimitOrderType', false, LimitOrderType, 'InputOrderType, LimitOrderType, MarketOrderType, MakerOrCancelOrderType, StopLimitOrderType, StopMarketOrderType, TakeProfitLimitOrderType, TakeProfitMarketOrderType')

local p = {}
for i=1, #params do
    p[i] = params[i]
end

p[#p + 1] = {
    's_tp',
    {
        {'percent', percent},
        {'order_type', CC_FEBE_ParseOrderType(order_type)}
    }
}

DefineOutput(ListDynamicType, p, 'Input parameters with added take-profit information', 'CC_FEBE_Execute, CC_FEBE_Orders, CC_FEBE_StopLoss, CC_FEBE_Buy, CC_FEBE_Sell')

0 Comments

Sign in to leave a comment.

No comments yet. Be the first!