Algo trading

Discuss all your quant trading ideas here

Suppose I have a market maker bot that:
- Places a trailing buy limit order 0.5% below the price
- Waits till it's hit then places a short trailing limit order 0.5% above the price (twice the original amount so it reverses the trade)
- Then does the same back and forth for, say, 5 hours and closes the position.
Ignoring commissions, what do you the PnL will be:
- For a boomer coin like LTC - with a $100 order size
- For a boomer coin like LTC - with a $10000 order size
- For a shitcoin like PEPE - with a $100 order size
- For a shitcoin like PEPE - with a $10000 order size
I'm going to run this experiment. Theoretically all of them should make money from the spread, but I have a feeling both are going to lose money but the bigger order size is going to lose more money proportionally because the algorithms will detect its logic and manipulate the price so it loses money.

Or maybe the $100 one makes money

So I think the method of nudging the price around DOES work in some tokens.
I'm not gonna do this experiment yet as the other idea seems more interesting.
There's also this youtube.com/watch?v=-jF9gW2r_bk

Now I have to figure out how to automate it. It also need to take into account the liquidity in the order book. If the liquidity is good and the price is good then market dump it. Otherwise sell using small limit orders except when the price is very good then it's ok to use larger limit orders because we don't care if we make the price dump too much.

nudrge.png - 2096x832, 227.75K

The only problem is if a whale comes around and decides to begin driving the price it the opposite direction of our position, then the best thing to do might be to just market sell the whole thing.

Loses the position at profit. I'll sleep for a few hours and keep testing the strategy.
But it looks like I might be able to get $100 a day from it and then maybe once I have more money graduate to a higher liquidity token. Although I don't know if it'll work the same in other tokens.

Do any of you trade commodities? I'm having trouble finding historical prices.

I'm finding that market orders are a better way to nudge the market especially when they go in accord to bitcoin's movements.
And a series of small spread out limit orders are a better way of getting in and out of a position stealthily.

I think the first kind of automation I need is a tool that sends a limit order every n seconds and trails it automatically.

Ok so it seems a basic tenet I held true about the market isn't so true after all.
When you move the price using market orders, the liquidity on the way up is always supposed to be more than on the way down and vice versa, so if you just move the price yourself you're supposed to end up at a loss. But this doesn't seem to actually be true.
No wonder market manipulation is so common.
Now I'm inclined to think that predicting the price is a fools errand. The best way to make money is probably to move the market yourself.
Also now I'm not so sure what's more likely to move the market more, sending orders slowly or one big order. Maybe sending orders slowly in a predictable fashion moves the market more because people are more likely to front run you. But that's up to a point because at some point they're going to anticipate a reversal and "try to catch the falling knife".

I think the best strat might be to just slowly buy following the price using limit orders in a very subtle way and dump it all at once.

DCA in.

Ignoring commissions

Commissions are 90% the reason most algo trading doesn't work.
You definitelly should NOT ignore commissions.

This sounds like a grid trading strat, which means it is all fine and dandy while it is trading inside a channel but when it breaks out and if you have enough inventory you are fucked.

But I would like to see the results of those market manipulation methods

Do any of you trade commodities? I'm having trouble finding historical prices.

Exactly why I hate them.

Rule 1 will be that it should be dynamic. No MA's. No hindsight indicators.

We could use correlations on Momentum + Volume + Orderbook + VWAP + Open Interest + Bollinger Bands perhaps?
- We would use VWAP on Open Interest spikes to estimate avg positioning of participants, as they are likely to defend this
- We would watch bollinger bands for compression on price & project on future trajectory
- We would watch orderbook for liquidity + it's correlation with momentum for big absorbtion (data which would be valued based on volume [boulding a 'true momentum index' (?)])
- We would watch sell/buy volume for imbalances that may be addressed later (on a small timeframe)

Maybe you could mix TPOs + Volume Profiles + Weekly/Monthly market open into this? Idk what timeframe would be just right for TPO though. You'd be pretty much automating an somewhat trading process. You miss out on some while doing that manually.

I've been trading this all day.
binance.com/en/futures/DODOXUSDT
I reached the conclusion that I don't have quite enough money to manipulate it, there are people trading it with a bigger wallet. BUT I reverse engineered the method they use. They trade it back and forth seeking liquidations or stops. When a liquidation happens, you see a big volume spike and a wick on the candle, and then there is a reversal. Going counter trend there is a high probability trade.
In the spike I accidentally triggered there I didn't manage to profit because I thought I could keep pushing the price up and then get out higher but I didn't have enough money.

The earlier trades there aren't showing I think I reached the limit that it's able to show lol.

You don't have to estimate, Binance gives you the ratio of long and short accounts.

Hold 60/40 QQQ/SGOV as a baseline. Scrape Anon Babblestocks and Anon Babbleinvesting and feed it into a sentiment classification model. Liquidate the SGOV and buy QQQ when reddit sentiment is on doomsday level (happens a couple times a year and always marks a bottom). Repeat with new capital.

I wish Binance had an easy way to hide limit orders. I think there's a way but it's a pain in the ass.

I mean you could just not place them until the price is far away i guess or maybe make some kind of faux iceberg

GAAAAAAAAAAAD DAAAAAAMN I WANNA RUN MY FUCKING TONGUE ALONG THAT TUMMY
GAAAAAAAAAAAAD DAAAAMN!

Use stop market orders.

Built for big black cock

i meant positioning price wise

Yeah I meant for when going to sleep
Yeah that's what I meant but to minimize price impact I gotta do a lot of small ones
Also not stop market, stop limit orders

Ah
What do you mean by defend, average up or down?
One thing is anyone who enters will probably want to exit in a few hours, leading to mean reversion in the price.

Just write a python script to do that, binance has a nice api. If you dk how ask gpt and test it on small quantities or send it here and I will proof read it for you. Just dont leak your api keys.

ok i got a jupyter environment set up with all the kraken historical data and Im backtesting simple MA crossovers. gonna start testing other strategies like portfolios and shit but this is fun. man AI makes it fucking FAST to prototype shit, I remember this would have taken my procrastinating ass months to put together in 2016 but this got cracked out in a couple days once I had some decent data to work with.

next stop: the moon

yoooo.png - 1289x1188, 287.4K

Careful with backtesting as you can overfit models or introduce lookahead biases

Try to create a model on past n-1 years but then as a final proof test it on nth year. This should go without saying but you can't include nth year data while optimizing a model. Also even with those steps there might be lookahead biases for example kraken might have delisted some instruments and removed them from the dataset. Maybe your algo would have bought them and lost money but you cant test it, and by using data that does not have them you implicitly assume that those kind of cases don't happen

Yeah nah I've written multiple API scripts and bots before it's just at that point I was in bed from my phone considering what was the best option. In the end I ended up setting an alarm and market selling in the middle of the night.
I suppose I could've used a stop order but when I woke up I checked the depth of the order book before selling.

i just buy breakouts out of consolidation lol
my brain is too small for algo trading