Skip to content
All library documents

Bar-Color Reversal Signals for a GBPUSD Expert Advisor

Code WonderTrader

Summary

This trading system uses the JFatl_Digit_System indicator to generate signals when a bar closes with a colored state that differs from the previous bar, including a transition from an uncolored state. An Expert Advisor acts on those indicator transitions. The document describes the required compiled indicator and notes that the example testing used default inputs without stop-loss or take-profit settings.

The only performance context provided is that a test was run on GBPUSD using six-hour bars for 2015; no numerical returns, drawdowns, trade statistics, or benchmark comparisons are included. The signal rule is therefore described more clearly than its effectiveness. Results may depend on indicator behavior, execution assumptions, and the absence of protective exits in the cited test setup. The document does not specify position sizing or a complete risk framework, so those aspects cannot be assessed from the available description.

Key ideas

  • The system trades transitions between colored indicator bars and the prior bar's state.
  • Signals are evaluated when a bar closes.
  • The described test used GBPUSD six-hour bars in 2015 with default inputs and no stop-loss or take-profit.
  • The document provides no numerical performance statistics or position-sizing rules.

Tags

Full text
# config.yaml


```yaml
basefiles:
    commodity: ../common/stk_comms.json
    contract: ../common/stocks.json
    holiday: ../common/holidays.json
    session: ../common/sessions.json

data:
    store:
        module: WtDataStorage
        path: ../storage/
env:
    name: cta               #引擎名称:cta/hft/sel
    fees: ../common/fees_stk.json   #佣金配置文件
    filters: filters.yaml       #过滤器配置文件,这个主要是用于盘中不停机干预的
    product:
        session: TRADING    #驱动交易时间模板,TRADING是一个覆盖国内全部交易品种的最大的交易时间模板,从夜盘21点到凌晨1点,再到第二天15:15,详见sessions.json
    riskmon:                #组合风控设置
        active: true            #是否开启
        module: WtRiskMonFact   #风控模块名,会根据平台自动补齐模块前缀和后缀
        name: SimpleRiskMon     #风控策略名,会自动创建对应的风控策略
        #以下为风控指标参数,该风控策略的主要逻辑就是日内和多日的跟踪止损风控,如果回撤超过阈值,则降低仓位
        base_amount: 5000000    #组合基础资金,WonderTrader只记录资金的增量,基础资金是用来模拟组合的基本资金用的,和增量相加得到动态权益
        basic_ratio: 101        #日内高点百分比,即当日最高动态权益是上一次的101%才会触发跟踪侄止损
        calc_span: 5            #计算时间间隔,单位s
        inner_day_active: true  #日内跟踪止损是否启用
        inner_day_fd: 20.0      #日内跟踪止损阈值,即如果收益率从高点回撤20%,则触发风控
        multi_day_active: false #多日跟踪止损是否启用
        multi_day_fd: 60.0      #多日跟踪止损阈值
        risk_scale: 0.3         #风控系数,即组合给执行器的目标仓位,是组合理论仓位的0.3倍,即真实仓位是三成仓
        risk_span: 30           #风控触发时间间隔,单位s。因为风控计算很频繁,如果已经触发风控,不需要每次重算都输出风控日志,加一个时间间隔,友好一些
executers: executers.yaml   #执行器配置文件
parsers: tdparsers.yaml
traders: tdtraders.yaml
bspolicy: actpolicy.yaml

notifier:
    active: true                    #是否向外发布消息
    url: ipc:///wtpy/wt_cat_stk.ipc #MQ发布地址,可以根据需要改成自己的地址

```

Shown in full with attribution under the source's licence. Licence: MIT

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.