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/

    Stuck on a simple issue...

    General Code/Help
    1
    1
    29
    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.
    • Dallascat
      Dallascat last edited by

      I have been racking my brain (still a somewhat newbie to BT) on how to setup this simple strategy:

      You have two sma's (or any indicator really) and you LONG when both are rising (together), you EXIT LONG when either/or are falling. Reverse for SHORT. You SHORT when both are falling (together) and you EXIT SHORT when either/or are rising.

      So you have 3 possible positions: LONG, SHORT OR OUT. I can code a LONG only with an EXIT(OUT) fine, but I cannot figure out how to combine the LONG and SHORT together. I have looked at bt.SIGNAL_LONGSHORT signals, other peoples code and I just can't figure it out. Thanks for any help!!

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post
      Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
      $(document).ready(function () { app.coldLoad(); }); }