[HaasOnline] Order Bot

2 1624 Views 5 Comments 2 years ago
HTS CLOUDBETA
  • The classic Order Bot recreated in HaasScript!

    I tried my best to keep the code simple, yet professional.
    The bot settings only contain an InputTable where you can build your orders. Unfortunately, due to limiting factors in HaasScript, orders cannot be reset. In other words, the bots orders are one-time triggers.

    Input table order parameters:
    Order directions:
    For spot markets,
    a buy order is set with a Direction value of +
    a sell order is set with a Direction value of –
    For leverage markets,
    go long order is set with a Direction value of L+ and exit long with L-
    go short order is set with a Direction value of S+ and exit short with S-

    Trade amount is set in BASE value, which means, that if you are
    trading BTC/USDT, the amount is then set as BTC.

    Trigger Types:
    < means “Lower Than” trigger price
    > means “Higher Than” trigger price

    Stop-Loss example (see default settings):
    – “buy” order is set to trigger at price 62000.
    – “sl” order is set to trigger when price “Less Than” 61800,
    but is allowed to be monitored only After “buy” order
    and Before “sell” order. “sl” is also set to be a market order.
    – “sell” order is set to trigger at price 63000, but only After “buy”
    order has completed.

    All parameters with * are optional. Leave them empty when not used.

    • This topic was modified 2 years, 5 months ago by pshai.
    • This topic was modified 1 year, 4 months ago by pshai. Reason: fixed a bug that occurred on first update cycle
    • This topic was modified 1 year, 4 months ago by pshai. Reason: fixed bot not able to trade leverage hedge
    • This topic was modified 1 year, 4 months ago by pshai. Reason: speed improvements
    HaasScript Code
    Sign in or Register to download for free
    • #2710
      Kobalt
      Basic
      Up
      0
      Down
      ::

      NICE
      kudos, kudus and more kudos to you just doing the impossible aka magic: bringing Order Bot to the cloud
      AWESOME you kinda rock [if not killing it]]

      • This reply was modified 2 years, 4 months ago by Kobalt.
      • #2716
        pshai
        Admin
        Up
        0
        Down
        ::

        Thanks man! I really kinda appreciate it.

      • #2764
        Kobalt
        Basic
        Up
        0
        Down
        ::

        XD

    • #3059
      Up
      0
      Down
      ::

      Thanks, this is very useful!
      I just registered yesterday – is it possible to put the ‘order ID’ of a previous order into the ‘After*’ Box? So that the orders are put on in sequence as with the original Order Bot?
      (sorry not much of a coder)

      • #3220
        pshai
        Admin
        Up
        0
        Down
        ::

        Yes it is! You can create a chain of orders using the After boxes. The order that has an ID set in the After box will only be executed when ever the previous one has filled.

Login or Register to Comment

Unlock your crypto trading potential

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

Join for Free