For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

Resampling from my own data feed - strange behavior



  • Basically: When strategy next() is called, it is receiving a bar from both the original datafeed, and the resampled datafeed in a single pass. Is that expected? Can I assume all the lines are correct for each data feed?

    In other words:
    '''
    if len( self.datas[0] ) > self.lendata0:
    self.lendata0 += 1
    if len( self.datas[1] ) > self.lendata1:
    self.lendata1 += 1
    '''

    Both 'if' tests are successful in a single call to next(). If the second test is changed to 'elif' my code never processes datas1 bars.



  • @leecallen said in Resampling from my own data feed - strange behavior:

    When strategy next() is called, it is receiving a bar from both the original datafeed, and the resampled datafeed in a single pass

    Strategy's next method is called when at least one datafeed produces a new bar. Inside the next method, the strategy has access to all datafeeds - both the one that produces a new bar as well as the one that doesn't. So both datafeeds are 'correct' in this regard.



  • Great, thank you for clearing that up for me.


Log in to reply
 

});