Backtrader: Multiple Data Feeds & Indicators - Backtest ...

Algorithmic Trading

A place for redditors to discuss quantitative trading, statistical methods, econometrics, programming, implementation, automated strategies, and bounce ideas off each other for constructive criticism. Feel free to submit papers/links of things you find interesting.
[link]

I've reproduced 130+ research papers about "predicting the stock market", coded them from scratch and recorded the results. Here's what I've learnt.

ok, so firstly,
all of the papers I found through Google search and Google scholar. Google scholar doesn't actually have every research paper so you need to use both together to find them all. They were all found by using phrases like "predict stock market" or "predict forex" or "predict bitcoin" and terms related to those.

Next,
I only tested papers written in the past 8 years or so, I think anything older is just going to be heavily Alpha-mined so we can probably just ignore those ones altogether.

Then,
Anything where it's slightly ambiguous with methodology, I tried every possible permutation to try and capture what the authors may have meant. For example, one paper adds engineered features to the price then says "then we ran the data through our model" - it's not clear if it means the original data or the engineered data, so I tried both ways. This happens more than you'd think!

THEN,
Anything that didn't work, I tried my own ideas with the data they were using or substituted one of their models with others that I knew of.

Now before we go any further, I should caveat that I was a profitable trader at multiple Tier-1 US banks so I can say with confidence that I made a decent attempt of building whatever the author was trying to get at.

Oh, and one more thing. All of this work took about 7 months in total.

Right, let's jump in.

So with the papers, I found as many as I could, then I read through them and put them in categories and then tested each category at a time because a lot of papers were kinda saying the same things.
Here are the categories:
Results:
Literally every single paper was either p-hacked, overfit, or a subsample of favourable data was selected (I guess ultimately they're all the same thing but still) OR a few may have had a smidge of Alpha but as soon as you add transaction costs it all disappears.
Every author that's been publicly challenged about the results of their paper says it's stopped working due to "Alpha decay" because they made their methodology public. The easiest way to test whether it was truly Alpha decay or just overfitting by the authors is just to reproduce the paper then go further back in time instead of further forwards. For the papers that I could reproduce, all of them failed regardless of whether you go back or forwards. :)

Now, results from the two most popular categories were:

The most frustrating paper:
I have true hate for the authors of this paper: "A deep learning framework for financial time series using stacked autoencoders and long-short term memory". Probably the most complex AND vague in terms of methodology and after weeks trying to reproduce their results (and failing) I figured out that they were leaking future data into their training set (this also happens more than you'd think).

The two positive take-aways that I did find from all of this research are:
  1. Almost every instrument is mean-reverting on short timelines and trending on longer timelines. This has held true across most of the data that I tested. Putting this information into a strategy would be rather easy and straightforward (although you have no guarantee that it'll continue to work in future).
  2. When we were in the depths of the great recession, almost every signal was bearish (seeking alpha contributors, news, google trends). If this holds in the next recession, just using this data alone would give you a strategy that vastly outperforms the index across long time periods.
Hopefully if anyone is getting into this space this will save you an absolute tonne of time and effort.
So in conclusion, if you're building trading strategies. Simple is good :)

Also one other thing I'd like to add, even the Godfather of value investing, the late Benjamin Graham (Warren Buffet's mentor) used to test his strategies (even though he'd be trading manually) so literally every investor needs to backtest regardless of if you're day-trading or long-term investing or building trading algorithms.
submitted by chiefkul to StockMarket [link] [comments]

What data to use for backtesting a Forex algo?

Hi,
I am developing a Forex algo and have done so with 1-minute candle data. For simplicity sake I take the average (mid-price) of the bid/ask-close, bid/ask-low and bid/ask-high and feed these into the algo. This means that the algo buys and sells using the bid/ask-close average.
Now, I know this ignores the "cost" of the spread and since it is a HF algo this cost becomes very significant. However, I recently found out about ECN brokerages that say they offer 0-0.1pips of spread and only take a commission.
My question thus is, what kind of data should I use for backtesting my algo. The candle data I use now has an average spread of 1.4 pips (between bid-close and ask-close).
Should I find data quoting a lower spread? Or are these lower spreads not realistic?
In addition to the question above... Is using the bid-close and ask-close of 1-minute candle date reasonable to use as a price at which the algo can buy and sell or is this not realistic in a live environment.
Thank you so much
submitted by marnixhoh to algotrading [link] [comments]

I've reproduced 130+ research papers about "predicting bitcoin", coded them from scratch and recorded the results. Here's what I've learnt.

ok, so firstly,
all of the papers I found through Google search and Google scholar. Google scholar doesn't actually have every research paper so you need to use both together to find them all. They were all found by using phrases like "predict bitcoin" or "predict stock market" or "predict forex" and terms related to those.

Next,
I only tested papers written in the past 8 years or so, I think anything older is just going to be heavily Alpha-mined so we can probably just ignore those ones altogether.

Then,
Anything where it's slightly ambiguous with methodology, I tried every possible permutation to try and capture what the authors may have meant. For example, one paper adds engineered features to the price then says "then we ran the data through our model" - it's not clear if it means the original data or the engineered data, so I tried both ways. This happens more than you'd think!

THEN,
Anything that didn't work, I tried my own ideas with the data they were using or substituted one of their models with others that I knew of.

Now before we go any further, I should caveat that I was a profitable trader at multiple Tier-1 US banks so I can say with confidence that I made a decent attempt of building whatever the author was trying to get at.

Oh, and one more thing. All of this work took about 7 months in total.

Right, let's jump in.

So with the papers, I found as many as I could, then I read through them and put them in categories and then tested each category at a time because a lot of papers were kinda saying the same things.

Here are the categories:

Results:
Literally every single paper was either p-hacked, overfit, or a subsample of favourable data was selected (I guess ultimately they're all the same thing but still) OR a few may have had a smidge of Alpha but as soon as you add transaction costs it all disappears.

Every author that's been publicly challenged about the results of their paper says it's stopped working due to "Alpha decay" because they made their methodology public. The easiest way to test whether it was truly Alpha decay or just overfitting by the authors is just to reproduce the paper then go further back in time instead of further forwards. For the papers that I could reproduce, all of them failed regardless of whether you go back or forwards. :)

Now, results from the two most popular categories were:

The most frustrating paper:
I have true hate for the authors of this paper: "A deep learning framework for financial time series using stacked autoencoders and long-short term memory". Probably the most complex AND vague in terms of methodology and after weeks trying to reproduce their results (and failing) I figured out that they were leaking future data into their training set (this also happens more than you'd think).

The two positive take-aways that I did find from all of this research are:
  1. Almost every instrument is mean-reverting on short timelines and trending on longer timelines. This has held true across most of the data that I tested. Putting this information into a strategy would be rather easy and straightforward (although you have no guarantee that it'll continue to work in future).
  2. When we were in the depths of the great recession, almost every signal was bearish (seeking alpha contributors, news, google trends). If this holds in the next recession, just using this data alone would give you a strategy that vastly outperforms the index across long time periods.

Hopefully if anyone is getting into this space this will save you an absolute tonne of time and effort.

So in conclusion, if you're building trading strategies, simple is good :)

Also one other thing I'd like to add, even the Godfather of value investing, the late Benjamin Graham (Warren Buffet's mentor) used to test his strategies (even though he'd be trading manually) so literally every investor needs to backtest regardless of if you're day-trading or long-term investing or building trading algorithms.


EDIT: in case anyone wants to read more from me I occasionally write on medium (even though I'm not a good writer)
submitted by chiefkul to CryptoCurrency [link] [comments]

How To Choose An Automated Trading Platform?

How To Choose An Automated Trading Platform?
When going for an automated trading platform it is very important to look for some important features before you decide on the automated trading platform you want to trade on. Different automated trading platforms offer different services which have their own pros and cons and might suit certain strategies and better than the others.
We have discussed important features that you should consider while choosing an algorithmic trading platform.

Select The Right Automated Trading Platform


https://preview.redd.it/gbx58zrdabu41.png?width=900&format=png&auto=webp&s=5ee3a23bc4f55a88437a8002fedfdf73390ece9b

Backtesting

A backtest is a historical simulation of an algorithmic trading strategy to see how it would’ve performed on the data in the past. Backtest results usually show the strategy’s performance in terms of profits and losses and some popular performance statistics like Sharpe Ratio or Information ratio which help to quantify the strategy’s return on risk. Hence a good backtesting software can be a great plus for an automated trading platform. Backtests can be divided into two categories ‘Research Backtesters’ and ‘Event-Driven Backtesting’.

Programming Languages

Choice of programming language is very important while deciding which platform to use for automating your trading strategy. Different languages have different pros and cons. Most commonly used programming languages used for algorithmic trading are C++, C#, Java, R, Python, and MATLAB. You can refer to one of our recent posts on top backtesting platforms where we’ve discussed popular programming languages.

Data

Different automated trading platforms provide access to/support trading/backtesting of certain securities only; some provide specific access to data feeds like Bloomberg and Thomson/Reuters. For instance, there are platforms dedicated to Forex trading or Equities trading only that too in specific markets. You need to make sure what the automated trading platform offers and then decide based on your needs. The frequency of data that you would need should also be taken into account. Some strategies would require daily EOD data while some other strategies might require intraday trading data.

Web-Based Platform

Some automated trading platforms also provide the web-based platform for online trading and backtesting which makes it easy and convenient to access your trading platform anywhere. The web-based platform may have less number of features compared to the desktop trading platform.

https://preview.redd.it/bwmmw9efabu41.png?width=900&format=png&auto=webp&s=c16e4008e52cf4cdd175241e8698b1fca09b43f4

Complexity

Different automated stock trading platforms vary in ease of use. Some platforms may require actual programming expertise while others may not. Most platforms provide a demo version which can help you decide what fits your comfort level. The complexity of platforms can be different for different assets traded, and one should check the different tools & features available to analyze the specific asset class.

Number of Strategies Allowed

Sometimes there might be restrictions on the number of long or short strategies loaded on a particular account and you might need extra accounts for more strategies. You should also check if you have enough memory on your computer for multiple accounts if required as it can be memory intensive. Some platforms also offer their own trading strategies as add-ons which can be subscribed by paying a periodic or one-time fee.

Commissions/Costs

Trading commissions can impact your profits to a great extent. Carefully choose the plan which suits your trading requirements. Also, check if there are initial and/or monthly fees and what is offered against it to make sure you are only paying for services which you actually want.

Technical Support & Customer Service

Automated Trading platforms are expected to have an extremely high “up-time” and rarely go out of service. Before choosing the platform you should check the history of outages and if there have been any other issues in the past, how soon were those resolved, and how knowledgeable and helpful was the support team.
submitted by FmzQuant to CryptoCurrencyTrading [link] [comments]

leftover 401k -> algo. trading account

This sub seems pretty dead (any particular reason?), but here goes a shout into the abyss:
I'm looking for a algorithmic trading account/platform (like interactive brokers or thinkorswim... even just an API would be fine) that can operate as what could be best characterized as a self-directed IRA.
While the 401k remnants I will be transferring doesn't have enough money to meet the "pattern day trader" criteria (which I assume is sort of the minimum barrier for anyone considering algorithmic trading), I can easily bump the account up over the next couple of weeks/months while I back test some of my ideas with whatever paper account is offered.
So, does anyone have any suggestions?
submitted by IRA_vs_401k to algorithmictrading [link] [comments]

Some basic algo trading questions on platform and data sources

Hi algoTrading,
I'm new to algorithmic trading, and was hoping to get some advice on how to get set up. My questions fall into two categories, first, what platforms do you guys use for backtesting, and second, where do you get your data from.
First, to clarify what I mean by 'platform'. I am looking for a mechanism which will enable me to (relatively) easily go from idea to backtest. For instance, in quantopian, you can write a strategy, and backtest it. The backtest will generate relevant metrics, and you do not have to worry about the code linking the strategy to the data. Additionally, if the platform allowed for more robust testing, like walk forward testing, and monte carlo analysis, that would be ideal.
I have seen two websites in particular, which seem to be popular. Quantconnect, and Quantopian. Now, I have looked into both of these, and I am not sure they are what I am after. First, I am a little skeptical of putting out algo's which I have poured my time hard work into, on sites which execute the code remotely. Second, I am more interested in derivatives trading than stock trading. If I were to use an online platform, I would prefer one which included data on Options/Futures/Forex. Additionally, while the language isn't a huge deal, I have experience in Java, and am learning Python for data Science applications. If there were a platform which let me use Python or Java, that would be ideal.
Second is the data source. This is a little redundant for online platforms, like quantopian, which are already integrated with the data. However, I have also been looking at Amibroker, which is executed locally on your computer, and does not come bundled with data. I have seen that you can get some data from IB, thinking about switching over to them, just for their data feeds. But really, the data I am interested in would be 1) EOD options data. 2) intra day futures/forex data. 3) intraday stocks/indexes/ETF data.
I am willing to pay for tools/data if necessary, but would prefer to keep costs as minimal as possible, as I am a losing trader with a day job.
Thanks in advance!
submitted by IAmBoredAsHell to algotrading [link] [comments]

) (Buy) Forex Tester 3 - Professional Backtesting Software! (Does It Work)

)@ (Purchase) Forex Tester 3 - Professional Backtesting Software! (Buyer Review)

Click Here To Get More Info About Forex Tester 3 - Professional Backtesting Software!

FAPTURBO...3...Latest...Real...Money...Forex...Trading...Robot...... How...to...improve...your...trading...psychology...without...meditation,...hypnosis,...or...mumbo...jumbo...that..."gurus"...tell...you.
FAPTURBO...2...First...Real...Money...Forex...Trading...Robot...... AMP...Futures...Trading...SuperCenter!...Cheap...Commissions...&...Excellent...Customer...Service!...Huge...Platform...Selection......Over...60+...Trading...Platforms...&...3...Data...Feeds!
Trading...Psychology:...6...Practical...Tips...to...Master...Your...Mind...... Use...Forex...Tester...Software...to...reap...the...benefits...of...the...in-depth...Forex...market...analysis.
Trading...Platform...Selector...-...AMP...Futures Use...Forex...Tester...Software...to...reap...the...benefits...of...the...in-depth...Forex...market...analysis.
Collection...FOREX...Trading...Strategies,...Software,...Strategy...... Use...Forex...Tester...Software...to...reap...the...benefits...of...the...in-depth...Forex...market...analysis.
Trading...Psychology:...6...Practical...Tips...to...Master...Your...Mind...... Nothing...to...setup...or...configure!...FapTurbo...3...Comes...fully...Pre-installed...on...your...MyFxChoice...and...Tallinex...MT4!...Plug...&...play...solution.

Click Here To Get More Info About Forex Tester 3 - Professional Backtesting Software!

(( (Download) Forex Tester 3 - Professional Backtesting Software! (Cheap)
submitted by kindbroker777la to pwmood72 [link] [comments]

Best/Cheapest source of live ECN market data feed (FIX API)

Hey guys. Awesome sub you got here. I'm a software engineer and I'm interested in learning more about the forex markets. Before I put any real money down, I want to analyze the data and come up with some hypotheses and backtest them.
I'm looking for a live data feed of prices, volume, market depth, etc that I can use for the analysis.
Do you guys know of a cheap/free source of such data? It needs to be ECN data or as close as possible. And historical data would be nice but not necessary, I'm looking more for a live feed.
I've look at various ECN brokers but they only offer their FIX API to institutional investors with hundreds of millions of USD in trades per month.
The cheapest I've seen is Interactive Brokers, but their minimum account balance is USD10k.
Please let me know if you know of other brokers or have any other ideas about attaining this kind of data.
Thanks
submitted by drkenta to Forex [link] [comments]

How Should I Model a Spread for Commissions in Simulations?

I'm still doing a lot of backtesting of some software I have been writing to try to trade forex. I got to the point where I realized that I don't understand commissions with forex brokerages. I'm kind of hoping I'm being unnecessarily cruel with myself in the commissions I'm charging to myself.
I have some EURUSD data I downloaded off of dukascopy that I've been using in the simulations. I saw on Oanda their average spread for EURUSD these days is 1.2 pips. It can go down to 0.8 and it sometimes spikes above that. So what I have been doing in the simulation is using the next bar's closing price, plus 0.00012 for my long entrance price. For exiting a position, I use the next bar's closing price, minus 0.00012. I was looking at that and was wondering if I'm actually using a spread of 2.4. Am I being too hard on myself?
I assume that brokerages that charge a spread don't really change anything based on amount of margin used, because it's reflected in the price used in the transactions. Is that true?
I also wondered if brokerages that charge a spread just bake it into the prices in their data feed.
I've seen a lot of advice to just open an account and start trying it out there. I'd like to forward test, but I really don't want to go through all the motions if I've proven my strategy is already too risky for my tastes without all that.
submitted by rockobonaparte to Forex [link] [comments]

Backtesting Forex Strategies in TradingView Part 3: Data ...

However, if there is third party data that you would like to use, then you can upload that into Forex Tester to. It really is the best solution. TradingView gives you instant access to data from multiple Forex brokers, which is awesome. But you cannot upload your own data, so that's why it's at number 2. Usability for Manual Backtesting. Forex ... Tenfore Forex Data feed question (login for full post details) #1 ... Read choosing the right platform for trading and backtesting. 17 thanks (login for full post details) #3 sam028 . Site Moderator . Posts: 3,638 since Jun 2009. Thanks: 3,763 given, 4,444 received I assume yes, for example it should be EURUSD.UBSW for UBS: Success requires no deodorant! (Sun Tzu) (login for full post details ... These files are well suited for backtesting trading strategies under MetaTrader 4 and MetaTrader 5 platform. Please, select: M1 (1 Minute Bar) Data. Generic ASCII. For generic use, this format allows importing M1 (1 Minute Bar) Data into any 3rd application. Please, select: M1 (1 Minute Bar) Data Tick Data. Microsoft Excel. For this file format we'll have M1 (1 Minute Bar) Data only. These ... As such, this is the first post to focus on backtesting with multiple data feeds. If you want to be able to change the number of data feeds without changing the code, dynamically swap out indicators that produce buy/sell signals or assign the same indicator to multiple feeds, this post is for you. Background The Backtrader blog has a good tutorial that shows you the basics of how to work with ... Data Feeds MultiCharts Charting Software I'm a bit surprised that many of these data providers only have intra-day data going back a few months. My instinct is that for purposes of backtesting, more historical data is better. I'd prefer to develop a strategy and backtest it against different periods of time to make sure that it holds together in different market conditions -- and make sure ... ★ Backtesting for Cryptocurrency, Forex & Stocks USA & Globally: Cons No Real-time News Backtest Only Single Instruments Not Entire Markets : There is no doubt about it; I love TradingView and use it every single day. I post charts, ideas, and analysis regularly and chat with other traders. Follow me on TradingView. The entire community on TradingView is focused on trading and investing, and ... more precise backtesting results: it is extremely important for trading strategies that depend even on small price fluctuations; daily updates: you can even backtest the yesterday’s data; 5-digits historical data ; On top of all these benefits, our VIP data package provides you with the tick-by-tick data with floating spread. By purchasing this package, you receive the most detailed price ... The reliability of the price data is critical to realistic backtesting. Forex Tester comes with free basic forex data provided by Forexite. It includes 16 years of forex data for 7 majors, 9 crosses, and 2 metals, down to 1-minute bars. For higher time frames (daily and above), this basic forex data package is sufficient. However, if you need greater granularity in data, you will need to ... Often people ask me where they can find historical data of stock prices, commodities, interest-rates, bonds, fx rates ... . In previous posts, we already looked at live data feeds for Matlab, and Excel. Then, we looked at how to load historical data. Now, we want to focus on where to get the data itself.… Increase your chances to find Forex data feed of the good quality. Here’s the brutal truth: It is hard to find relevant Forex data feed on Internet. You can spend days browsing, but still you do not get any guarantees you receive anything of the decent quality. Good news! We have done the entire dirty job for you: collected all the data, checked the quality and prepared everything neatly ...

[index] [10995] [25425] [23821] [12251] [8052] [28828] [5045] [16335] [22262] [6038]

Backtesting Forex Strategies in TradingView Part 3: Data ...

=====(backtesting)===== Backtesting Forex Strategies in TradingView Part 3: Data Results #backtesting a trading strategy python #backtesting indicators #back... =====(backtesting a trading strategy)===== Backtesting Forex Strategies in TradingView Part 3: Data Results #backtesting options strategies #backtesting ninj... =====(backtesting tradingview)===== Backtesting Forex Strategies in TradingView Part 3: Data Results #backtesting on mt4 #backtesting indicators #backtesting... Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube. Learn the fastest way to start backtesting with Forex Tester 4. Try the free Forex Tester 4 demo here: https://tradr.cc/fxt In this video, I'll show you how ... =====(backtesting stocks)===== Backtesting Forex Strategies in TradingView Part 3: Data Results #backtesting software #backtesting a trading strategy #backte... =====(backtesting software)===== Backtesting Forex Strategies in TradingView Part 3: Data Results #backtesting on mt4 #backtesting forex Full Playlist: PLntK...

http://binary-optiontrade.hookupmanf.cf