{# 趋势户:两级开仓类型 → 自动 trade_style;日内户:假破 / 结构突破 #}

{% macro order_entry_type_fields() -%}

{% if order_entry_profile == 'trend_div' %}

<div class="order-entry-model-row">

    <select id="order-entry-category" class="order-entry-category" required title="反转 / 顺势 / 波段" aria-label="开仓性质">

        <option value="">性质</option>

        {% for cat in entry_model_categories %}

        <option value="{{ cat.key }}">{{ cat.label }}</option>

        {% endfor %}

    </select>

    <select name="entry_model" id="order-entry-model" class="order-entry-model-sub" required disabled title="启动A/B,大分歧A/B,小分歧" aria-label="开仓类型">

        <option value="">类型</option>

        {% for cat in entry_model_categories %}

        {% for opt in cat.options %}

        <option value="{{ opt.code }}" data-entry-category="{{ cat.key }}" data-trade-style="{{ opt.trade_style }}"{% if opt.help %} title="{{ opt.help }}"{% endif %} hidden disabled>{{ opt.label }}</option>

        {% endfor %}

        {% endfor %}

    </select>

    <input type="hidden" name="trade_style" id="order-trade-style-hidden" value="trend">

    <span id="order-trade-style-hint" class="order-trade-style-hint" title="由开仓类型自动设定">趋势单</span>

</div>

{% elif order_entry_profile == 'intraday' %}

<select name="entry_model" id="order-entry-model" class="order-entry-intraday" required title="日内开仓类型" aria-label="开仓类型">

    <option value="">开仓类型</option>

    {% for opt in intraday_entry_model_options %}

    <option value="{{ opt.code }}"{% if opt.help %} title="{{ opt.help }}"{% endif %}>{{ opt.label }}</option>

    {% endfor %}

</select>

<input type="hidden" name="trade_style" value="trend">

{% else %}

<select name="trade_style" required>

    <option value="trend">趋势单</option>

    <option value="swing">波段单</option>

</select>

{% endif %}

{%- endmacro %}

