{%- set intraday_regions = ["useu", "cnhkusadr"] -%}
{% if ny5 is defined and ny5 -%}
global.ny5 = true
{% else -%}
global.ny5 = false
{% endif -%}
{% if inject_exmodules_common is defined and inject_exmodules_common -%}
{% if ny5 is defined and ny5 -%}
use("cfg-template/pulse_configrc/inject_exmodules_common_ny5.pconf")
{% else -%}
use("cfg-template/pulse_configrc/inject_exmodules_common.pconf")
{% endif -%}
{% else -%}
{% if bundle_alphatype != "pulse_s" and bundle_alphatype != "s" -%}
{% if ny5 is defined and ny5 -%}
use("cfg-template/pulse_configrc/inject_exmodules_common_ny5.pconf")
{% else -%}
use("cfg-template/pulse_configrc/inject_exmodules_common.pconf")
{% endif -%}
{% endif -%}
{% endif -%}
{%- if user is defined and user != "" %}
{%- if ny5 is defined and ny5 -%}
user_exmodules = "exmodules_trd_oper/pulse_users/{{user}}.exmodules_ny5.pconf"
{% else -%}
user_exmodules = "exmodules_trd_oper/pulse_users/{{user}}.exmodules.pconf"
{% endif -%}
use(user_exmodules) if File.exists?(user_exmodules)
{% endif -%}
{% block region_config -%}
{% if region_config is defined -%}
use("{{ region_config }}")
{% else -%}
use("cfg-template/pulse_configrc/{{ bundle_region }}.pconf")
{% endif -%}
{% endblock region_config -%}
{%- block global %}
# GLOBAL CONFIGS
global.cache_home = "{{ cache_home | default("/path/to/cache_home")}}"
global.bundle_region = "{{ bundle_region }}"
global.bundle_alphatype = "{{ bundle_alphatype }}"
global.portf_nm = "{{ portf_nm }}"
global.beam_alpha = {{ beam_alpha | default(false) | tojson }}
{% if dataroot is defined -%}
global.dataroot = "{{ dataroot }}"
{%- endif -%}
{%- if global_dict is defined %}
# additional variables
{%- for key, value in global_dict.items() %}
global.{{key}} = {{value | tojson }}
{%- endfor -%}
{%- endif -%}
{% endblock global -%}
{%- block env %}
# ENV CONFIGS
{% if ny5 is defined and ny5 -%}
use "cfg-template/pulse_configrc/ny5.pconf"
{% endif -%}
{% if environment is defined and environment == "test" %}
{% endif -%}
{% if bundle_alphatype != "pulse_s" and bundle_alphatype != "s" -%}
use "modules/beam/beam.pconf" if global.beam_alpha
{% endif -%}
env.data_dir = "{{ data_dir | default("$(cache_home)/$(bundle_alphatype)/$(bundle_region)/$(portf_nm)/cache") }}"
{% if output_dir is defined -%}
env.output_dir = "{{ output_dir }}"
{% endif -%}
{% if alpha_dump_dir is defined and alpha_dump_dir -%}
env.alpha_dump_dir = "{{ alpha_dump_dir }}"
{% endif -%}
env.alpha_dump_max_tmp_files = 100
env.live = {{ live | default(true) | tojson }}
env.production = {{ production | default(true) | tojson }}
{% if fixed_num_refreshes is defined -%}
env.fixed_num_refreshes = {{ fixed_num_refreshes }}
{% endif -%}
{% if simulated_now is defined and simulated_now -%}
env.simulated_now = {{ simulated_now }}
{% endif -%}
# Should not be true in production
printer.force_print = {{ force_print | default(false) | tojson }}
{% if upd_univ is defined and upd_univ -%}
# change all alpha universe to UNIVSTORE
preprocess do |mods|
if mods.map { |m| m.name }.include?("UNIVSTORE")
mods.each do |a|
if a.is_a?(Alpha)
a.conf[:universe_id] = "UNIVSTORE"
end
end
end
end
{% endif -%}
{% endblock env -%}
{% block pf %}
# PORTFOLIO CONFIGS
portfolio.name = "{{portf_nm}}"
{% if bundle_booksize != "no-change" -%}
portfolio.scale[:booksize] = {{ bundle_booksize }}
{% endif -%}
{% if univ_start_date is defined and univ_start_date -%}
env.univ_start_date = {{ univ_start_date }}
{% endif -%}
{% if sim_start_date is defined and sim_start_date -%}
env.sim_start_date = {{ sim_start_date }}
{% endif -%}
{% if univ_end_date is defined and univ_end_date -%}
env.univ_end_date = {{ univ_end_date }}
{% endif -%}
{% if sim_end_date is defined and sim_end_date -%}
env.sim_end_date = {{ sim_end_date }}
{% endif -%}
env.refresh_days = {{ refresh_days | default(2) }}
# always set the univ_end_date_exclude_days = env.refresh_days (which is 2 by default).
# so that after running hist, universe data is only be built until
# univ_end_date - exclude_days, and be able to run live mode with refresh_days > 0.
env.univ_end_date_exclude_days = env.refresh_days
{%- if alpha_dump is defined and alpha_dump -%}
{%-block alpha_dump %}
# dump alpha
mod("dump_alpha", factory: "DumpAlpha")
{% endblock alpha_dump -%}
global.alpha_dump_max_level = {{alpha_dump_max_level | default (1000)}}
use("cfg-template/pulse_configrc/alpha_dump_helper.pconf")
{%- endif -%}
{%- if pos_dump is defined and pos_dump -%}
{%- block pos_dump %}
# dump position
{% if (intraday_regions is defined and bundle_region in intraday_regions) or ("itd_" in bundle_region) -%}
factory("IntradayLegacyPosDump", lang: "cpp", path: "modules/intraday/libintraday_legacy_pos_dump.so")
{% else -%}
factory("LegacyPosDump", lang: "cpp")
{% endif -%}
{%- if (intraday_regions is defined and bundle_region in intraday_regions) or ("itd_" in bundle_region) -%}
portfolio.trade.operation(
"IntradayLegacyPosDump",
dump_mode: "daily",
dump_dir: "pos",
{%- else -%}
portfolio.trade.operation(
"LegacyPosDump",
dump_dir: "pos",
{%- endif -%}
{%- if bundle_region in ["eu", "ea_eu", "za", "lamr", "tw", "au", "useu"]%}
use_sedol: true,
{%- else %}
use_sedol: false,
{%- endif %}
)
{% endblock pos_dump -%}
{%- endif -%}
{%- if future_pos_dump is defined and future_pos_dump -%}
{%- block future_pos_dump %}
# dump future position
portfolio.trade.operation("FutureLegacyPosDump", dump_dir: "pos")
{% endblock future_pos_dump -%}
{%- endif -%}
{%- if pos_push is defined and pos_push -%}
{%- block pos_push %}
# position push to OMS
{% if bundle_region in ["itd_fx_usd", "itd_fx_usd_utc"] -%}
portfolio.trade.operation(
"IntradayFxPosPush",
addr: "{pos_push_addr_map['fx']}",
strategy: "{{ portf_nm }}",
country: "FX",
dump_dir: "pos_push",
timeout: 5,
end_time: 163000,
replace: true,
)
{% else -%}
{%- if (intraday_regions is defined and bundle_region in intraday_regions) or ("itd_" in bundle_region) -%}
portfolio.trade.operation(
"IntradayPosPush",
addr: "{{pos_push_addr_map[bundle_region]}}",
strategy: "{{ portf_nm }}",
dump_dir: "pos_push",
timeout: 5,
)
{% else -%}
portfolio.trade.operation(
"PosPush",
addr: "{{pos_push_addr_map[bundle_region]}}",
strategy: "{{ portf_nm }}",
dump_dir: "pos_push",
timeout: 5,
)
{% endif -%}
{% endif -%}
{%- endblock pos_push -%}
{%- endif -%}
{%- if is_fict_pf is defined and is_fict_pf %}
global.user_alpha_ids = {{ user_alpha_ids }}
use "cfg-template/pulse_configrc/fict_pf.pconf"
{% endif -%}
{% if group_stats_names is defined %}
factory("GroupStatsSimple", lang: "cpp")
{% for name in group_stats_names %}
{% if (intraday_regions is defined and bundle_region in intraday_regions) or ("itd_" in bundle_region) %}
portfolio.stats_list << global.intraday_stock_group_stats[:{{name}}]
{% else -%}
portfolio.stats_list << global.stock_group_stats[:{{name}}]
{% endif -%}
{%- endfor -%}
{% endif -%}
{% endblock pf -%}
{%- block external %}
# EXTERNAL SERVICES
{% block alpha_store -%}
{% if alpha_store is defined and alpha_store -%}
env.alpha_store = {
{% for key, value in alpha_store.items() %} {{key}}: {{value | tojson }},
{% endfor -%}
}
{% endif -%}
{% endblock alpha_store -%}
{% if alpha_store_sender is defined and alpha_store_sender -%}
env.alpha_store_sender = {
{% for key, value in alpha_store_sender.items() %} {{key}}: {{ value | tojson }},
{% endfor -%}}
{% endif -%}
{% if alpha_store_hosts is defined and alpha_store_hosts -%}
if env.to_h.has_key?(:alpha_store)
env.alpha_store[:hosts] = {{ alpha_store_hosts | tojson }}
end
{% endif -%}
{% if alpha_store_auth_token is defined and alpha_store_auth_token -%}
if env.to_h.has_key?(:alpha_store)
env.alpha_store[:auth_token] = {{ alpha_store_auth_token | tojson }}
end
{% endif -%}
{% block price_server_map %}
{% if price_server_map is defined and price_server_map -%}
if defined?(basedata)
basedata.delete_field(:price_server)
basedata.price_server_map = {
{% for key, value in price_server_map.items() %} {{key}}: {{ value | tojson }},
{% endfor -%}}
end
{%- endif -%}
{% endblock price_server_map %}
{% block future_price_server_map -%}
{% if future_price_server_map is defined and future_price_server_map -%}
if defined?(contract_basedata)
contract_basedata.delete_field(:price_server)
contract_basedata.price_server_map = {
{% for key, value in future_price_server_map.items() %} {{key}}: {{ value | tojson }},
{% endfor -%}}
end
{%- endif -%}
{% endblock future_price_server_map %}
{%- if monitor is defined %}
env.monitor = {
{% for key, value in monitor.items() %} {{key}}: {{value | tojson }},
{% endfor -%}}
{% endif -%}
{% endblock external -%}
{%- if extra_pconf_lines is defined %}
# Extra pconfs
{%- for line in extra_pconf_lines %}
{{line}}
{%- endfor -%}
{% endif -%}
{%- if ny5 is defined and ny5 -%}
{%- if ny5_extra_pconf_lines is defined %}
# Extra pconfs (only applicable on ny5)
{%- for line in ny5_extra_pconf_lines %}
{{line}}
{%- endfor -%}
{% endif -%}
{%- else -%}
{%- if gr_extra_pconf_lines is defined %}
# Extra pconfs (only applicable for GR)
{%- for line in gr_extra_pconf_lines %}
{{line}}
{%- endfor -%}
{% endif -%}
{% endif -%}
Always see this
[Error (where: parser) in base.pconf | Line 1 Col 28 near '['] Expected either a number, string, keyword or identifier.
this file base.pconf
Always see this [Error (where: parser) in base.pconf | Line 1 Col 28 near '['] Expected either a number, string, keyword or identifier.