finalni instant indikatory + save do arch
This commit is contained in:
@ -1,19 +1,32 @@
|
||||
|
||||
|
||||
import v2realbot.controller.services as cs
|
||||
|
||||
from v2realbot.common.model import RunDay, StrategyInstance, Runner, RunRequest, RunArchive, RunArchiveView, RunArchiveDetail, RunArchiveChange, Bar, TradeEvent, TestList, Intervals, ConfigItem, InstantIndicator
|
||||
#[stratvars.indicators.vwma]
|
||||
runner_id = "b44d6d8f-b44d-45b1-ad7a-7ee8b0facead"
|
||||
runner_id = "1ac42f29-b902-44df-9bd6-e2a430989705"
|
||||
toml = """
|
||||
type = "custom"
|
||||
subtype = "vwma"
|
||||
on_confirmed_only = true
|
||||
cp.source = "vwap"
|
||||
cp.ref_source = "volume"
|
||||
cp.lookback = 50
|
||||
#[stratvars.indicators.cross]
|
||||
type = 'custom'
|
||||
subtype = 'conditional'
|
||||
on_confirmed_only = true
|
||||
[cp.conditions.crossdown]
|
||||
vwap.change_val_if_crossed_down = 'emaSlow'
|
||||
true_val = -1
|
||||
[cp.conditions.crossup]
|
||||
vwap.change_val_if_crossed_up = 'emaSlow'
|
||||
true_val = 1
|
||||
"""
|
||||
|
||||
res, vals = cs.preview_indicator_byTOML(id=runner_id, toml=toml)
|
||||
toml = """
|
||||
#[stratvars.indicators.rsi14]
|
||||
type = 'RSI'
|
||||
source = 'vwap'
|
||||
length = 14
|
||||
on_confirmed_only = true
|
||||
"""
|
||||
indicator = InstantIndicator(name="rsi14alt", toml=toml)
|
||||
|
||||
res, vals = cs.preview_indicator_byTOML(id=runner_id, indicator=indicator)
|
||||
|
||||
print(res)
|
||||
print(vals)
|
||||
|
||||
Reference in New Issue
Block a user