[pshaiBot] Gandalf The White

stable
By pshai in Trading Bots Published December 2019 👁 1,829 views 💬 4 comments

Description

"YOU SHALL NOT PASS!" Using this bot, you can make sure the price doesn't go lower than the set price... It simply wont let them pass!!
HaasScript
minPrice = Input('Minimum price', 6500)
asks = GetOrderbookAsk()
​
​
function getAmount()
    if asks[1][1] >= minPrice then return 0 end
​
    local i, p, amt = 1, 0, 0
    while p < minPrice do
        p = asks[i][1]
        amt = amt + asks[i][2]
​
        i = i + 1
        if i > #asks then break end
    end
​
    return amt
end
​
local oid = Load('oid', '')
local amt = getAmount()
​
if oid == '' then
    if amt > 0 then
        oid = PlaceBuyOrder(0, amt, {type=MarketOrderType})
    end
else
    if IsOrderOpen(oid) then
        CancelOrder(oid)
    else
        oid = ''
    end
end
​
Save('oid', oid)

4 Comments

Sign in to leave a comment.

P
ProfGhibli over 6 years ago

Not clear what exactly this bot is doing? Could you expand a bit please? Is it designed to place limit buy orders so that low liquidity coins don't fall below a price level?

P
pshai over 6 years ago

It will keep buying (with market orders) as long as price falls below a certain level. The top ask is the price that is used to detect this and all ask orders are bought if they are below the set limit.

S
Stephan over 6 years ago

This is a market semi-manipulation bot. You can give this bot a price and each time the price goes below the given price then this bot will be buying in coins. It buys as many coins as it needed to reach the given minimum price again.

So, if you introduce a new coin and you want to ensure it has a specific minimum price then this is the bot to use for it.

K
Kobalt over 6 years ago

Gandalf, detection / tracker..mmm that would be fun...