Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

    Need Help on Simple Limit Order Code

    General Code/Help
    1
    1
    61
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      Cyrix last edited by

      Hi, I am new to Backtrader and I can't figure out how to write a simple strategy:

      I am using Yahoo's daily data.

      If today's Open is lower than previous day's Close, then place a limit buy order at 80% of today's Open price.
      If the order is executed (i.e the limit price is higher than the Low price the the day), then sell the stock at Close.

      Can any one show me how to write the code?
      Thanks.

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post
      Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors