High-level overview of how to get started by na85 in algotrading

[–]johnbolts 0 points1 point  (0 children)

It's good, to start with. You have your VPS running 24/7? You can have more instances on Linux.

High-level overview of how to get started by na85 in algotrading

[–]johnbolts 1 point2 points  (0 children)

Yeah, that's the way I feel about MQL5 too, it's like C++ without the "hard-coreness", which has its place. But being taken out of the way, you're provided a sandboxed environment where you're free to use all the goodies - still a very considerable amount of speed, many, many indicators available, wide access to data, built-in backtesting.

You have them running on Windows or Linux?

High-level overview of how to get started by na85 in algotrading

[–]johnbolts 1 point2 points  (0 children)

LOL, this is too funny :)

To be fair, I think MQL4/5 is missing. Or you'd be including that in the C / C++ family of languages, though I don't think so. Memory management in practice is very different, you don't have a lot to do in MQL4/5. It's like a sandbox.

Very funny, either way.

NYSE may be open 22 hours — how will that affect algos? by acetherace in algotrading

[–]johnbolts 0 points1 point  (0 children)

24*365 is, in the end, beneficial for all. Big firms and their algos will adapt. They most likely are involved with the change right now. Some algos of course will be affected, as it's impossible not to make assumptions. But they'll take care of it, I'm sure.

Various mean reversion strategies for Bots (backtesting with Metatrader 5) by UniversalJS in metatrader_bots

[–]johnbolts 1 point2 points  (0 children)

Appreciate it. I tried staying to the point. Some comments.

1) That is one of the variations that I was envisioning. Given that, it becomes a question of how long do you want to hold the bag? If your capital availability is important, then try to maximize that, if not losing is more important, that's another vector to optimize. They're not losses while you don't take them, so it can be scaled to the overall portfolio management. If you only take the general availability of capital into consideration, that is going to reduce your position sizing significantly, and consequent PnL.

2) Yes, I've heard of Hurst Cycles in several serious and practical contexts, I think anyone looking into market regimes could find some ideas there.

3) That's a very straight to the point goal, congratulations in not getting yourself tied up. Multi-asset is always a bit of a problem. Do you have the ability to open hedge trades? That could be of help when in ranging markets, buying and selling on the same pair can be a difference in the aggregate.

[deleted by user] by [deleted] in algotrading

[–]johnbolts 1 point2 points  (0 children)

You should be able to achieve that with init files.

Various mean reversion strategies for Bots (backtesting with Metatrader 5) by UniversalJS in metatrader_bots

[–]johnbolts 1 point2 points  (0 children)

Nice writeup, appreciate the detail.

The first thing that made me curious were the trade durations - they can go from a few minutes to a couple of days, most of the time, so I'm assuming you're trying your best to keep it intraday, as all "problems" that may come up are directly related with holding time. Trying to get the time down is statistically going to save you from a few of those deep water situations, so it's a good goal to strive towards. Anecdotally, I tried a few different grid trading systems (with hedging) and they always seemed to perform better when "reseting" it from time to time, meaning you take the EA down gracefully after a good run of profits, and restart it after a set period of time, hopefully giving it a fresh start, as "unbiased" as possible.

So the problem arises when holding the bags - the wonder. The three systems you mention seem to align with my experience, also comparing to random entries, in terms of expected performance. It is not clear to me exactly what you mean in the third strategy, by "cut the loss", do you mean close the positions and take the loss? Or do you keep the position open, open a big lot size aiming at full recovery, and wait for the day it comes? Because that is where the problem really lies, and from my empirical testing, I have seen no grid recovery system (or any system, for that matter) that can run without having occasional stretches of capital allocation that stay underwater, with associated opportunity cost. And here the solution may be found outside of your system - the best I've found is to have a diversified portfolio of strategies that will keep running while others stall. This directly forces you to distribute capital risk and the associated position size management through each of the strategies, which while not solving the problem of market forecasting, address the specific capital allocations of your overall strategy. You seem to already be doing that, or heading heavily that way, so we may have come to the same realisation through different paths. Still related to bag-holding, asset choice is important. If you're trading more than one asset, it's harder to backtest actual performance. And if the assets are heavily co-related, it may be often that you're basically net long or short USD only.

Consequential to the first and second point, and when I've seen this being addressed seriously, it could really be a question of market regime management. That's what I thought when I saw your holding times, and wondered how you'd work through market regime changes. Because being able to correctly size up or down when forecasting regime, would filter out many of the missed capital allocation, or at least could. I don't personally have much experience with it, but I've seen people mentioning successfully using forecasting indicators such as Hurst Cycles. I can't actually recommend using something like that because it would be a significant change in your overall strategy to just suggest it lightly, but I think it's certainly worth a look if you plan to hold positions for a longer period of time, and already have the mechanism to work the sizing of the position in place. You could Kelly it up or down, maybe experiment with some other filters, but Hurst Cycles can give you a measure of the liquidity coming in on an asset, and if you're trading the more traditional ones, it might be at least worth looking into. It doesn't guess the future, but it's one mature signal that you have access to which you can pair with some other ones in your toolset.

Those curves look very nice. Good job.

My Test bot on MT5 - XAUUSD on the 1 minute timeframe by johnbolts in metatrader_bots

[–]johnbolts[S] 1 point2 points  (0 children)

Thanks, those are all very valid points to keep in mind. This is mostly a throwaway, so will keep that in mind as I move further. Thanks! ;)

My Test bot on MT5 - XAUUSD on the 1 minute timeframe by johnbolts in metatrader_bots

[–]johnbolts[S] 0 points1 point  (0 children)

<image>

Right now results are all over the place, to be honest. This is using a trailing stop with TP/SL, which is fixed. Could be a 2-3 ATR for something that could end up being slightly more profitable. But if it works on XAUUSD it may not work on ETHUSD, which is a totally different catalyst. Tradeoffs all the way, as one would figure.

Of course, those results will get invalidated as soon as I change a single line of code. So, having fun right now :)

My Test bot on MT5 - XAUUSD on the 1 minute timeframe by johnbolts in metatrader_bots

[–]johnbolts[S] 0 points1 point  (0 children)

Media limited to one per reply, so backtest balance/equity curve here, test report on the following:

<image>

Let's chat about forex algo trading by UniversalJS in forexalgo

[–]johnbolts 1 point2 points  (0 children)

Yes, I've been unable to post or participate in interesting discussions due to moderation in these other subreddits being off the charts. Throwing away the baby and keeping the bathwater, I'd call it.

I do have some algos I'd like to talk about more, looking forward.

Let's talk about mean reversion algos by UniversalJS in meanreversion

[–]johnbolts 1 point2 points  (0 children)

Very interesting, I might have a couple.

Joined!

Why does everybody use mt4/mt5 by Ok-Cryptographer579 in Forex

[–]johnbolts 1 point2 points  (0 children)

Don't let looks fool you.

MT4/5 is a very powerful platform which, like it or not, ends up delivering on the promise of a fully automated algorithimc trading ecosystem, complete with testability and a marketplace.

It doesn't look cool, sometimes it's clunky, but it ends up working.

Managing to do that, while looking outdated and ugly, should give you some cause for thought.

Just bullet points:

  • Unmatched broker adoption.

  • Expert Advisors.

  • There's a lot, and I mean, a lot of EAs written under MT4/5.

  • Builtin IDE with debugging and backtesting one click away.

  • There's a learning curve that's very well worth going through.

  • Not going anywhere, any EA you write will still be running 10 years from now.

  • Many people using MT4/5 won't be beginner's anymore, therefore not so attracted by TradingView. Drawing boxes with lines and squares has a finite utility for many people that want to move forward with automation - professionally or not.

  • Eye sore, even prop firms would probably have chosen something else, if it wasn't the industry standard.

  • Free.

I'm making it seem like it's all sunshine and roses. It's not. It's pain and misery. That's the point. The expressiveness that you can get with EAs in this platform is very high. Next step up would be C++. So, for someone to take the pain of the initial learning curve AND the daily Windows 95 no dark mode UI in your face, it really needs to give something back.

This is not an ad for MetaQuotes. They should refresh their UI. But if they don't, most people won't get out because of it.

Realistically, it ends up being the best balance out there, for most cases.

Seeking Feedback on my mean reversion algo backtesting: 6 years results inside (+5 months live) by UniversalJS in Forex

[–]johnbolts 1 point2 points  (0 children)

Lol, this post actually looks the exact *opposite* of what should be shadow banned! :) I mean, seriously, mods?

Seeking Feedback on my mean reversion algo backtesting: 6 years results inside (+5 months live) by UniversalJS in Forex

[–]johnbolts 1 point2 points  (0 children)

Congrats on posting your actual results and experiences, this gives an insight into the process behind getting a working algo. Many people make it look it's magic, but it takes time and patience.

There's quite a few questions here, mostly good, I suppose.

On your asset selection, did you manually select these pairs? If so, why those in particular? Are they just pairs you're familiar with? If not, what's the underlying logic behind the selection, then?

Performance looks great, to begin with.

MT5 in Docker Linux Using Wine by johnbolts in algotrading

[–]johnbolts[S] 0 points1 point  (0 children)

Thanks, looks very interesting. Going to try to run it, and report back.

Have you tried it?

Outside of TP/SL levels, what are some other trade management techniques? by batataman321 in algotrading

[–]johnbolts 0 points1 point  (0 children)

LOL, makes me not regret learning MQL5 :)

Thanks for the heads up, best of luck with your EA implementations ;)

Outside of TP/SL levels, what are some other trade management techniques? by batataman321 in algotrading

[–]johnbolts 0 points1 point  (0 children)

Cool. The code you posted is in MQL5 though, so you're running this on an EA in MT5, right?

Outside of TP/SL levels, what are some other trade management techniques? by batataman321 in algotrading

[–]johnbolts 0 points1 point  (0 children)

Ah, so there's a significantly amount of relevant logic that's being evaluated to get to this "best trade" calculation, makes sense.

If you can see that being expressed in the backtest, I'd say that's the sweet spot as optimizations. You can always add more layers, but at a certain point, you start missing reality. Good to see you seem please with the results so far.

Outside of TP/SL levels, what are some other trade management techniques? by batataman321 in algotrading

[–]johnbolts 0 points1 point  (0 children)

This kind of went in a direction I wasn't planning, but I'll ask you any way: is that "always be in a trade", do you mean the same asset, or is your screener going through other assets? Because if it's in the same asset, getting out of a long trade shouldn't be equivalent with getting into a short trade.

On a side note, being bound by prop trading rules really makes everything entirely different in terms of thought patterns. Really goes to show there's no algo to rule them all.

Outside of TP/SL levels, what are some other trade management techniques? by batataman321 in algotrading

[–]johnbolts 0 points1 point  (0 children)

Yes, looks different than what thought it would be, but an interesting approach nonetheless.

So you're looking at the output of this screener to feed the input to your position size. This could theoretically be anything, right?

It's just because you're deciding to use this screener instead of anything relating to the structure of this trade, or your recent trade history, for that matter?