YAML config file for managing cBots instances and params.

Created at 05 Feb 2019, 11:21
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
OL

oliveira.phc

Joined 15.11.2018

YAML config file for managing cBots instances and params.
05 Feb 2019, 11:21


Hello there.

Manually handling many instances of cBots is tedious and error-prone. This becomes specially true when dealing with VPS.

I suspect that cTrader already handles this internally, because it is capable of reminding the instances and its params when closed. So I propose to make a public API for that.

I would like that cTrader to bring along one single YAML file, which could be edited directly on Automate and possibly saved in the cloud, just like the workspaces. I can relate with the idea of opening a file anywhere, possibly having many of them, but I still would prefer to have it embedded in cTrader.

Such configuration could be done in JSON or XML, but YAML would provide a much better and DRYer experience, for it is likely for many instances to share most of its params.

I suggest two forms for structuring the config file. I would be satisfied with both of them.

# 1st proposition: one ruleset per account
account_a:
  autostart: boolean # having one ruleset per account would make it possible when opening cTrader.
  cBots:
    "Robot A": # The name of any given cBot.
      base: &robot_a
        Symbol: # Required.
          value: EURUSD
        Timeframe: # Required.
          value: m5 # t5, re5, ra5
        Param1:
          type: Float
          value: 1.2
        Param2:
          type: String
          value: "ABCDEFG"
      
      instances:
        - <<: *robot_a
        - <<: *robot_a
          Timeframe:
            value: t5
        - <<: *robot_a
          Param1:
            type: Float
            value: 1.5
        - <<: *robot_a
          Param2:
            type: String
            value: "HIJKLMN"
        # Instances...
    # Robots...
# Accounts...


# 2nd proposition: named rulesets would require a selector
ruleset_a:
  display_name: "Majors"
  cBots:
    "Robot C":
      # Same as above.
# Rulesets...

A possible place for putting the ruleset selector.

Best regards.


@oliveira.phc