Swing Trading Safely with Super Trend Signal v1

4 2846 Views 15 Comments 100 Tipped Credits 3 years ago
  • Hey!

    Pleasure to present to you the first version of my palindromic script I called: Swing Trading Safely with Super Trend Signal (STSwSTS)

    This script is a simple improvement of the MassEve script by our King pshai and is quite relevant in this bull market.
    Thanks mate, you’re the best 🙂

    It uses the required command:
    CC_SuperTrendExt

    The script uses two supertrends, one closer to the price (the TP ST) and one further (the main ST).

    The script enters a long if both ST are below the price and when the price dips a bit on LTF.
    Then it takes a safety TP once the price pumped a bit.
    The long is kept until the TP ST flips, at which point the script takes some profit.
    When the main ST flips bearish it exits the long.
    A SL is included when a candle closes below some price defined relatve to the entry though it may not be useful on HTF because of the ST flip safety.

    This script is mainly designed for HTF, though it may work on LTF for some pairs.

    Many parameters to adjust to your needs!
    You may experience some issues in Equity mode. The maximum nb of contracts which can be longed is not accurate in HBS, you may divide your equities by 4 in order to make it work fine.

    Let me know if you run into some issues!

    v2, v3 and v4 are planned and I may publish them in due time.
    Short version for bear market is straightforward, spot version also, I may publish them later.

    Safe trading!

    ~deemzie

    • This topic was modified 3 years, 1 month ago by deemzie.
    • This topic was modified 3 years, 1 month ago by deemzie.
    • This topic was modified 3 years, 1 month ago by deemzie.
    • This topic was modified 3 years, 1 month ago by deemzie.
    • This topic was modified 3 years, 1 month ago by deemzie.
    HaasScript Code
    Sign in or Register to download for free
    • #2078
      Up
      1
      Down
      ::

      Hmm I am getting this warning in the log

      WARNING: IsOrderFilled(): orderId can not be empty

      And it looks like it cant close its position, so did I make a mistake or is there something else I missed?
      I am running it in equity mode (5%), would that be the problem?

      • This reply was modified 3 years, 1 month ago by Patjekadetje.
    • #2084
      deemzie
      Basic
      Up
      1
      Down
      ::

      Fixed. Try the new script, it should work properly now.

    • #2085
      Up
      0
      Down
      ::

      thanks, nice work. Will set up tests and give feedback when I have some interesting data

    • #2087
      IQGobal
      Basic
      Up
      0
      Down
      ::

      I am interested in the spot version of this script. Could you possibly publish that?

    • #2090
      deemzie
      Basic
      Up
      0
      Down
      ::

      Yes! The spot version is planned… I am a bit busy rn, I will publish it by this weekend

    • #2091
      Up
      0
      Down
      ::

      Nice script and amazing backtesting performance on the BTC / USDT pair in futures trading … 1,123.97% … in 4 Weeks … !!! Will give it a try the next two weeks! Thanks for sharing!

    • #2092
      Up
      0
      Down
      ::

      With which settings and which pairs do you have good success with your bot?

    • #2095
      deemzie
      Basic
      Up
      0
      Down
      ::

      I updated the script, there was an issue with the stop loss and the take profits. Make sure you have the new one or the bot may take a short after exiting the long…

      This bots works well with essentially any pair that displays regular patterns of the type: pump -> dump -> fairly flat accumulation -> pump…
      It catches the pump and exits when it starts to dump to enter again lower.
      Works great on like BTC, DOT, BNB, THETA…
      It may work less on like RUNE, SUSHI or SNX which have more volatile PA, thought some settings may be found to work ok.

      Update 1h – Prices 4h is the most reliable setting imo. It may work with 1h prices but you may want to set the ATH Length to 3 and 4.
      It depends on the pair but you may want to set an entry trailling to like 4-5% for volatile pairs, while 1% may be good for BTC or idk
      For alts, a sec TP may be set to as much as 6-10% because of increased volatility, while you may want it lower for majors 4-5%
      Safety TP also depends on volatility, 40-50% may be used for alts and maybe 20-30% for less volatile pairs. This needs to be adjusted depending on the nb of bots you run at the same time on your account. Idem for partial TP, 10-20% is fine in general.

      Feel free to do some BT and share your results and the settings you chose. I have few time do try it myself rn as I am working on v2 and other stuff…

    • #2100
      deemzie
      Basic
      Up
      0
      Down
      ::

      Script updated to allow for a Fixed Stop Loss.

    • #2122
      Bozza
      Basic
      Up
      0
      Down
      ::

      Just been doing backtesting and it doesn’t look like there is liquidation detection built-in? is that correct?

    • #2645
      kr3nk1
      Basic
      Up
      0
      Down
      ::

      Hello I´m new here but the script give this error:

      4. 04 Nov 2021 20:06:34 ERROR: Unknown references: CC_SuperTrendExt3. 04 Nov 2021 20:06:34 ERROR: Unknown references: CC_SuperTrendExt2. 04 Nov 2021 20:06:34 This script is compatible with margin and leverage trading.1. 04 Nov 2021 20:06:34 Doing compile test..

      I found the solutions, you must create a command script for SuperTrend Extended but save as CC_SuperTrendExt otherwise the principal scrip won´t find the command

      • This reply was modified 2 years, 5 months ago by kr3nk1.
    • #3165
      Katerin
      Basic
      Up
      0
      Down
      ::

      Here is my errors:/ what am i doing wrong? Any idea?
      Using the updated version of script and try to save it with both “CC_SuperTrendExt” and “SuperTrendExt” names as command script
      455. 19 Jul 2022 12:19:00 ERROR: OptimizedForInterval(): Execution error occurred.
      454. 19 Jul 2022 12:19:00 ERROR: Index out of range exception.
      453. 19 Jul 2022 12:19:00 ERROR: Plot(): Attempting to call with ‘null’ value for value.
      452. 19 Jul 2022 12:19:00 ERROR: CC_SuperTrendExt(): Invalid input count of 5 (requires 6 inputs).
      451. 19 Jul 2022 12:19:00 ERROR: CC_SuperTrendExt(): Invalid input count of 5 (requires 6 inputs)

      Solved. Thank you @Tilanthi (Discord) for your guide
      Depending on which version of SuperTrendExt you are using, try adding the ClosePrices() into the supertrend call in your main script as the third callable parameter, which gives you the six inputs that it is looking for – so for example
      local c = ClosePrices(tf_price)
      local st = CC_SuperTrendExt(h, l, c, st_src, st_atr_len, st_atr_mul)
      and hopefully it should work for you – it did when I just tried it !

      • This reply was modified 1 year, 9 months ago by Katerin. Reason: Solved
      • #3547
        iddqd
        Basic
        Up
        0
        Down
        ::

        Hi

        Share please Swing Trading Safely with Super Trend Signal v1 exmaple where I need to put it ?

        Becase I have the same error

    • #3171
      Up
      0
      Down
      ::

      Great trading bot scrpt!

      100 HaasScript Credits
    • #3607
      Up
      0
      Down
      ::

      I fixed this error – ERROR: CC_SuperTrendExt(): Invalid input count of 5 (requires 6 inputs).

      But now I’m experiencing another error:

      ERROR: Unknown references:
      ERROR: – st_tp

      • This reply was modified 3 months, 3 weeks ago by GoldenKing412.
Login or Register to Comment

Unlock your crypto trading potential

Create a free account and enjoy everything we have to offer.

Join for Free