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

timer support and IB



  • @backtrader Somehow I get timer notification before the time arrived(marked bold), what issue can be?
    you can see difference with (when parameter, and data timestamp).

       def __init__(self):
            print("Init ")
            self.add_timer(when=datetime.time(16,30), #bt.timer.SESSION_END,
                offset=datetime.timedelta(minutes=10),
                repeat=datetime.timedelta(),
                weekdays=[]) # , tzdata=self.dnames['MKTD'])   #tz.timezone('America/New_York')
    
    
        def notify_timer(self, timer, when, *args, **kwargs):
            print('strategy notify_timer with tid {}, when {} cheat {} feed stamp {}'.
                  format(timer.p.tid, when, timer.p.cheat,self.data.datetime.datetime(-1)))
    
    

    strategy notify_timer with tid 0, when 2019-04-30 16:40:00 cheat False feed stamp 2019-04-29 15:00:00
    NEXT
    strategy notify_timer with tid 0, when 2019-05-01 16:40:00 cheat False feed stamp 2019-04-30 15:00:00
    NEXT
    ***** DATA NOTIF: MKTD LIVE
    ***** DATA NOTIF: BONDLONGD LIVE
    ***** DATA NOTIF: GOLDLONGD LIVE


  • administrators

    Timezone, timeframe and printing the date from the previous day.



  • @backtrader, have a couple of questions:
    how to make algo skeleton, that can trade, not on a day close, but on ticker price at a specific time like 15:30?
    To make resampling with 30min, and wait for a specific time to validate and execute?
    How I can get a historical daily price this specific time 15:30 (for example for 200 days)?

    thank you in advance.


Log in to reply
 

});