INNER CODE UNIT · Python

days_ago_N

WISEPLAT/backtrader_moexalgo · DataExamplesMoexAlgo/01 - Symbol.py:23

    days_ago_N = today - timedelta(days=30)  # N days ago

    # 1. All historical daytime bars for the week
    # data = store.getdata(dataname=symbol, timeframe=TimeFrame.Days, fromdate=week_ago)

    # 2. Historical hour bars with doji of 4 prices (four_price_doji) for the current year
    # data = store.getdata(dataname=symbol, timeframe=TimeFrame.Minutes, compression=60, fromdate=datetime(today.year, 1, 1), todate=datetime(today.year, 12, 31), four_price_doji=True)

    # 3. Historical 30-minute bars from a given date a week ago to the last bar (resample from M10)
    # data = store.getdata(dataname=symbol, timeframe=TimeFrame.Minutes, compression=30, fromdate=week_ago)

    # 4. Historical 5-minute bars of the first hour of the current session without the first 5 minutes (resample из M5)
    # data = store.getdata(dataname=symbol, timeframe=TimeFrame.Minutes, compression=5, fromdate=datetime(today.year, today.month, today.day, 10, 5), todate=datetime(today.year, today.month, today.day, 10, 55))

    # 5. Historical and new 1-minute bars from the beginning of today's session (history + live M1)
    # data = store.getdata(dataname=symbol, timeframe=TimeFrame.Minutes, compression=1, fromdate=today, live_bars=True)

    # 7. Historical and new 10-minute bars (history + live M10)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…