When using CCXT as data feeds, how to let CCXT to fetch_ohlcv for different contract_type, for example, 'next_week', 'quarter'? Thanks.
data_ticks = bt.feeds.CCXT(
@blonc said in Strategy Selection Pattern:
The concept I am trying to achieve is to have many strategies all being monitored by a master strategy. This way, the master strategy could be using a markov chain to monitor returns to turn on and off individual strategies based on the total returns of all strategies. It seems the best path is to , correct me if wrong, put the strategies logic into indicators and bring them into one master strategy.
@backtrader said in Strategy Selection Pattern:
Sub-strategies is not a pattern which does exist in backtrader. Using Indicator instances could do the trick.
Was also thinking about utilizing the concept of having a "master" strategy turning on and off "micro strategies", so I'm glad I found this post :)
I can think of a lot of use cases for using a master strategy that based on a wide overview of a market/s can control what micro strategies are suited to be used.
the idea of using indicators as sub-strategies seem brilliant (haven't tested it yet).
but from my understanding strategies can be better analyzed and give valuable insights. I hope we can wider the discussion just to explore more solutions (as @backtrader mentioned nested strategies are not supported)
one idea I have that I don't think break backtrader structure is:
declaring a 'master' that run first and based on whatever user logic it creates a 'signal dictionary' that is then passed to all other micro strategies. allowing them to decide if to run or not in next().
this way all strategies are kept in the same level of operation (not nested)
@hlad said in How to code a trading system that works with Backtrader?:
Does backtrader create separate objects for each symbol
Each data feed is an object. The question is probably meant to ask something entirely different.
@mothee said in Why the datetime is set to the end of day for minute period bars in the csv data feed?:
it need set 'timeframe = bt.TimeFrame.Minutes' explicitly.
If you don't tell the platform what your data feed is, it cannot know it.
@algoguy235 said in Detect new resampled price:
I wasn't able to get len() as a line object in the init function
len is a builtin and cannot be overridden. Given it is only meant to check a single value (because it increase monotonically) it seems pointless to have a replacement function for it to deliver a lines object.
The logic cannot be elsewhere but next, because it is what will be called on a regular basis.
The difference between creating and operating with indicators is explained here: Docs - Platform Concepts - Stage 1 and Stage 2
You may also look at the lifecycle of the Strategy: Docs - Strategy
@peterzcc said in Any updated guide on custom live data and live trading?:
Is there any updated guide on that, thanks!
Updated with regards to?
There is no specific guide that I know of. Things you may have a look at:
Community - Store Development
Community - IG Store Development
Community - How to create live data feed?
Docs - Binary Datafeed Development
As for the broker, have a look at the sources.