{"$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "additionalProperties": false, "required": ["symbol", "start", "end", "strategy"], "properties": {"symbol": {"type": "string", "pattern": "^[A-Z0-9][A-Z0-9._-]{0,19}$"}, "start": {"type": "string", "format": "date"}, "end": {"type": "string", "format": "date"}, "publish": {"type": "boolean", "default": false}, "nickname": {"type": "string", "maxLength": 30, "pattern": "^[가-힣A-Za-z0-9 _-]*$"}, "strategy": {"type": "object", "additionalProperties": false, "required": ["type"], "properties": {"type": {"enum": ["rules", "dca"]}, "entry": {"$ref": "#/$defs/condition"}, "exit": {"$ref": "#/$defs/condition"}, "interval": {"enum": ["monthly"]}, "amount": {"type": "number", "minimum": 1, "maximum": 1000000}, "stop_loss": {"type": "number", "minimum": 0.001, "maximum": 0.99}, "take_profit": {"type": "number", "minimum": 0.001, "maximum": 10}, "fee_bps": {"type": "number", "minimum": 0, "maximum": 100}, "slippage_bps": {"type": "number", "minimum": 0, "maximum": 100}}, "allOf": [{"if": {"properties": {"type": {"const": "rules"}}}, "then": {"required": ["entry", "exit"], "not": {"anyOf": [{"required": ["amount"]}, {"required": ["interval"]}]}}}, {"if": {"properties": {"type": {"const": "dca"}}}, "then": {"required": ["amount", "interval"], "not": {"anyOf": [{"required": ["entry"]}, {"required": ["exit"]}, {"required": ["stop_loss"]}, {"required": ["take_profit"]}]}}}]}}, "$defs": {"operand": {"oneOf": [{"type": "number", "minimum": -1000000, "maximum": 1000000}, {"type": "object", "additionalProperties": false, "required": ["indicator"], "properties": {"indicator": {"enum": ["PRICE", "SMA", "EMA", "RSI", "MACD", "MACD_SIGNAL", "BB_UPPER", "BB_LOWER", "BREAKOUT_HIGH", "BREAKOUT_LOW"]}, "period": {"type": "integer", "minimum": 2, "maximum": 500}, "std": {"type": "number", "minimum": 0.5, "maximum": 5}, "fast": {"type": "integer", "minimum": 2, "maximum": 100}, "slow": {"type": "integer", "minimum": 3, "maximum": 300}, "signal": {"type": "integer", "minimum": 2, "maximum": 100}}, "allOf": [{"if": {"properties": {"indicator": {"enum": ["SMA", "EMA", "RSI", "BB_UPPER", "BB_LOWER", "BREAKOUT_HIGH", "BREAKOUT_LOW"]}}}, "then": {"required": ["period"]}}]}]}, "condition": {"oneOf": [{"type": "object", "additionalProperties": false, "required": ["op", "left", "right"], "properties": {"op": {"enum": ["gt", "gte", "lt", "lte", "cross_above", "cross_below"]}, "left": {"$ref": "#/$defs/operand"}, "right": {"$ref": "#/$defs/operand"}}}, {"type": "object", "additionalProperties": false, "required": ["all"], "properties": {"all": {"type": "array", "minItems": 1, "maxItems": 8, "items": {"$ref": "#/$defs/condition"}}}}, {"type": "object", "additionalProperties": false, "required": ["any"], "properties": {"any": {"type": "array", "minItems": 1, "maxItems": 8, "items": {"$ref": "#/$defs/condition"}}}}]}}}