Every method of client.template in the Python SDK.
apply#
Apply a template · tool template_apply
Applies a saved template — or blank, no studies — to a chart or every chart of its workbench, as the templates menu does; what could not be applied is said, one line each. Answers the chart and those lines.
Declaration
client.template
def apply(self, chart: str, *, all_charts: Optional[bool] = None, blank: Optional[bool] = None, name: Optional[str] = None) -> Dict[str, Any]Parameters
| Name | Type | What it is | |
|---|---|---|---|
chart | str | required | |
all_charts | Optional[bool] | optional | Onto every chart of the chart's workbench, as the menu's All switch. |
blank | Optional[bool] | optional | |
name | Optional[str] | optional | The template's name; absent with blank, which takes every study off. |
Returns
Dict[str, Any] — the tool’s answer as a dict of plain values.
What it answers
Answers the chart and those lines.
Example
client.template.apply(chart)delete#
Delete a template · tool template_delete
Deletes a saved template, as its row's x and the confirmation do — only with confirm; without it the answer names what would be deleted. Answers the templates.
Declaration
client.template
def delete(self, name: str, *, confirm: Optional[bool] = None) -> Dict[str, Any]Parameters
| Name | Type | What it is | |
|---|---|---|---|
name | str | required | |
confirm | Optional[bool] | optional | Without it nothing is deleted and the answer says what would be. |
Returns
Dict[str, Any] — the tool’s answer as a dict of plain values.
What it answers
Answers the templates.
Example
client.template.delete("…")rename#
Rename a template · tool template_rename
Renames a saved template, as its gear's Rename does. Answers the templates.
Declaration
client.template
def rename(self, name: str, to: str) -> Dict[str, Any]Parameters
| Name | Type | What it is | |
|---|---|---|---|
name | str | required | |
to | str | required |
Returns
Dict[str, Any] — the tool’s answer as a dict of plain values.
What it answers
Answers the templates.
Example
client.template.rename("…", "…")save#
Save a template · tool template_save
Saves a chart's studies — and its type and look with with_type — as a named template, as the templates menu's Save does; a name taken or unusable is refused in its words. Answers the templates.
Declaration
client.template
def save(self, chart: str, name: str, *, with_type: Optional[bool] = None) -> Dict[str, Any]Parameters
| Name | Type | What it is | |
|---|---|---|---|
chart | str | required | The chart whose studies (and, with with_type, type and look) become the template. |
name | str | required | |
with_type | Optional[bool] | optional | The chart's type and look saved with its studies. |
Returns
Dict[str, Any] — the tool’s answer as a dict of plain values.
What it answers
Answers the templates.
Example
client.template.save(chart, "…")set_default#
Set an interval's default template · tool template_set_default
Makes a template the one a new chart of an interval opens with, or takes the default off an interval or off every interval a template is the default of, as the template gear's choices do. Answers the templates.
Declaration
client.template
def set_default(self, *, clear_all: Optional[bool] = None, interval: Optional[str] = None, name: Optional[str] = None) -> Dict[str, Any]Parameters
| Name | Type | What it is | |
|---|---|---|---|
clear_all | Optional[bool] | optional | Every interval this template is the default of loses it. |
interval | Optional[str] | optional | The interval it opens with, as the menu writes it (M1, H4, D1); absent with clear_all. |
name | Optional[str] | optional | The template, or absent to make the interval open with none. |
Returns
Dict[str, Any] — the tool’s answer as a dict of plain values.
What it answers
Answers the templates.
Example
client.template.set_default()