(ranging markets where the moving averages are crossing over frequently). backtrader is self-contained with no external dependencies (except if you want to plot) From pypi: pip install backtrader. Than the Log has still the same errors. sma_crossover indicator shows up properly, but adx_crossover indicator doesn't show up as expected. Before going forward let’s remember that backtrader tries to remain agnostic as to what the data represents. Along with the bt-run.py script a standard Simple Moving Average CrossOver strategy is included. However, since this strategy requires two indicators and crossover signals, the default settings would be the same for each SMA! The moving part comes in to play because we limit the number of bars in the calculation and new bars are being formed all the time. Since Backtrader loops through each and every combination of values, some optimization tests would result in both SMA values being the same. This is actually quite fast and suggests the SMA’s may have been prone to whipsawing. With that in mind, this post is going to focus on the simple moving average when applied in a crossover strategy. Usually this section would contain defaults settings performance. Hello Guys, I tried this simple cross-over strategy but it isnt working as I expect it to. Therefore, we would see a crossover. Furthermore, reducing the fast SMA by just 2 to 14/30 reduced the profit by almost half which suggests those settings may have hit a sweet spot for that particular market rather than a good general choice. And thats my code where I start the strategy. Although simple in nature, moving averages do come in a couple of flavors. alpaca-backtrader-api. Doc - Comission Schemes; When no line is specified the 1st line of the object will be used. Buy 9622.5 shares ind. fast (default 10) period of the fast moving average. For feedback/questions/... use the Community. A full copy of the test results in CSV format can be found here: SMA Review results CSV. In this article, I show an example of running backtesting over 1 million 1 minute bars from Binance. Both simple and informative, they form the basis of many trend following strategies. Having said that, the general performance does drop as the period for the fast SMA’s lengthen. This is not the 1 st time and rather than thinking that users are doing it wrong, it seems it is a use case. Conversely, the best settings for faster SMA was approximately 4 times shorter. alpaca-backtrader-api is a python library for the Alpaca trade API within backtrader framework. --- Position Begin. Only users with topic management privileges can see it. LONGSHORT: both long and short indications from this signal are taken. Python Backtesting library for trading strategies. The review also forms part of my series to test and compare Backtrader’s library of built-in indicators. Although simple in nature, moving averages do come in a couple of flavors. This is because it took significantly fewer trades over the test period. Error Log:Starting Portfolio Value: 1000000.00 I think of Backtrader as a Swiss Army Knife for Python trading and backtesting. Interestingly, at 2.2%, the test with a strike rate of just 18% did not have the largest drawdown. Moving averages are probably one of the most wildly known indicators around. For details of each API behavior, please see the online API document. Here are the examples of the python api backtrader.indicators.MovAv.SMA taken from open source projects. This Stochastic review post forms part of my series to test and compare Backtrader’s library of built-in indicators. … However, I quickly noticed that if I do that some tests would never take a trade. 0x9a2f88198224d59e5749bacfc23d79507da3d431. Note: Results below do not reflect real world performance. p. pslow) # slow moving average self. backtrader. The ticket system is (was, actually) more often than not abused to ask for advice about samples. Here a snippet of a Simple Moving Average CrossOver. Consequently, it is this difference in speed that we will use to generate crossover signals for the strategy (when one SMA value crossover up or down through the other. This table shows the performance of the best and worst settings when the performance was averaged over all the markets under test. Parameters. The SMA Crossover Signal Metatrader 4 can be used as a standalone indicator or together with other indicators or analysis tools. The GBPUSD also faired a little better to quicker settings and at 17 / 50. This is not far off the popular 50/200 setting (which in itself performed well). backtrader allows you to focus on writing reusable trading strategies, indicators and analyzers instead of having to spend time building infrastructure. ; This interesting use case has come up via Ticket 177.In this case cerebro is being used multiple times to evaluate differet strategies which are being fetched from an external data source. As mentioned in the introduction and overview post (linked above), no commissions, leverage or margin are used during testing. backtrader. Moving averages are probably one of the most wildly known indicators around. Therefore I decided to forcibly keep one SMA’s look back period higher than the other during testing. Strategy Selection. crossover > 0: # if fast crosses slow to the upside self. Backtest Rookies is a registered with Brave publisher! Here a snippet of a Simple Moving Average CrossOver. Also the SMA's are visible where i can see them crossing, however the orders don't get … I want to switch Postions when a crossover happens. Python is a very powerful language for backtesting and quantitative analysis. Yahoo API Note: [2018-11-16] After some testing it would seem that data downloads can be again relied upon over the web interface (or API v7) ... For feedback/questions/... use the Community. alpaca-backtrader-api. What's going on here? Strike rates, on the other hand, were more spread out (18% – 64%). Yahoo API Note: [2018-11-16] After some testing it would seem that data downloads can be again relied upon over the web interface (or API v7) Tickets. Another point worth mentioning is that the actual PnL achieved was not high in comparison to other indicators. Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. Backtrader allows you to focus on writing reusable trading strategies, indicators, and analyzers instead of having to spend time building infrastructure. ... SMA (period = 30) crossover = bt. I am finding the results i would like to obtain are not what they should be. crossover = bt. Hi everyone, I am fairly new to Python and Backtrader. But this cant be the problem in my opinion. Almost all currencies are under the force of DXY. Support this site by clicking the referral link before you sign up! All this would amount to a set of results where the zero’s skew the averages and the worst settings are simply the opposite of the best settings. It can be done in several different ways. This example we go through today is a very simple moving average crossover … The standard seed is the simple moving average, use _seed=btalib.SEED_LAST to apply the "last" known value of the input as the seed (for compatibility this can be simply `True` or `1`) Because the dynamic smoothing constant has a larger period (+1) than the actual moving average, this average has alrady a seed value when the calculation can start. alpaca-backtrader-api. The thing is it Buys at the exact Price it should buy or sell, but I can see in the Postiontext, that the price where it opens the postion, is an completely different price and I dont understand why. Strategy): '''This is a long-only strategy which operates on a moving average cross: Note: - Although the default: Buy Logic: - No position is open on the data - The ``fast`` moving averagecrosses over the ``slow`` strategy to the: upside. ind. ind. alpaca-backtrader-api is a python library for the Alpaca trade API within backtrader framework. A simple moving average is simply the average price over the last x periods. By voting up you can indicate which examples are most useful and appropriate. https://imgur.com/a/tZgAzPj Hi guys, I find some weird things when plotting Crossover indicator. It can be done in several different ways. For details of each API behavior, please see the online API document. https://www.backtrader.com/home/helloalgotrading/, I got everything in the same python File and I didnt change the code and this comes out. Now a “real” comparison with a SMA Crossover Commissions for futures Commissions for stocks The code Reference Commissions: Stocks vs Futures Agnosticity. backtrader. The ticket system is (was, actually) more often than not abused to ask for advice about samples. Contribute to bartosh/backtrader development by creating an account on GitHub. You will see shortly that the best overall parameter settings in the most favorable market (NZDUSD) used fairly similar settings to the best overall parameters by average in all markets. It didnt work to include the picture here so I included the link. A series of 349 tests have been performed across 4 markets over a 12 year period to determine how well a simple moving average crossover strategy performs longterm. It results in fewer tests, but I think overall it will provide better insights. This is to be expected in my view because when you have 2 long SMA periods, you have very little current market information. MACD Line: This line is created by subtracting the value of a fast exponentia… For the series introduction, some n… For details of each API behavior, please see the online API document. Along with the bt-run.py script a standard Simple Moving Average CrossOver strategy is included. Alternatively, support us by switching to Brave using this referral link and we will receive some BAT! SignalStrategy. ... SMA (period = 30) crossover = bt. It allows rapid trading algo development easily, with support for the both REST and streaming interfaces. It compares the closing price of an instrument to the instruments historical prices over a set period of time. I think the data is getting imported good, i can print values out correctly during the cerebo run and i also can plot the graph in the end. Reference: Best Forex Indicators Comparison. If you want to test out the results of a Golden Crossover or a Death Cross, you’ll likely want to get a reliable data feed. The name: SMA_CrossOver. Additionally, interpreting them in a stategy ruleset also often differs. Sorry for the inconvenience. indicators as btind: class MA_CrossOver (bt. buy # enter long elif self. Using a built-in Strategy. Its so weird. The gallery below shows 3 different charts: Almost amazingly when looking at the PnL curves for the fast SMA periods vs the 200 MA, you could have had almost any setting (except in the GBPUSD) and still not lost money! It allows rapid trading algo development easily, with support for the both REST and streaming interfaces. In general, it shows the relationship between two moving averages but at first glance, it may seem that there is more going on. I increased the Portfolio Value to 1000000, so it should be enough, but it isnt working. NoScript). Interestingly here the absolute best settings for the AUDUSD were 16 and 30. Different commission schemes can be applied to the same data set. fast (default 10) period of the fast moving average. Yahoo API Note: [2018-11-16] After some testing it would seem that data downloads can be again relied upon over the web interface (or API v7) Tickets. But still I get this problem as stated above. and Sometimes it doesnt even switch CrossOver (sma1, sma2) # crossover signal def next (self): if not self. The stochastic oscillator has been around for decades (since the 1950’s) and still remains a popular indicator in use today. In this video, I will show you how easy it is to use multiple timeframes in Backtrader backtests in Python. As we can see, longer look back periods for the slower moving average (200) tend to provide more consistent results when coupled with a faster SMA period of 40. A summary, gallery of charts and series of statistic tables for each test method are below. I've tested your code - works well in my case. Alpaca backtrader plot issue: I ran into this import issue and found article below, so I applied the code, but same issue not resolved. However, these are closer to the popular 20/50 combination. The worst settings have a slow moving average period of 21. Parameters. Enjoying the content and thinking of subscribing to Tradingview? Let’s break down the different parts. The default indicator values are set to 9 and 18 but can be changed directly from the indicator’s input tab. Donate with PayPal using any payment method you are comfortable with! There are many ways to support us and some won’t even cost you a penny. For more information on how all indicator reviews will be performed, please click on the link above. For feedback/questions/… use the Community. The only exception to this was in the GBPUSD. For details of each API behavior, please see the online API document. Generally, the best-performing settings across all markets had longer look back periods for the slower moving average in the pair. import backtrader as bt: import backtrader. Hopefully its no Problem, Okay I hopefully dont annoy anybody but I found something else. https://www.backtrader.com/home/helloalgotrading/. The purpose of these tests are to compare the indicators to one and another where all other factors are equal. A feature-rich Python framework for backtesting and trading. Perhaps this was to be expected with some of the longer look back periods used. It works for scalping, day trading and swing trading. any one can help please? I am testing out a simple SMA cross over strategy. In this review, we will be looking using two simple moving averages, one of which has a longer look back period than the other. This causes the SMA value to appear to move slower as the look back period increases. also if you want to change positions and be in the market, it will be better to use target orders: it will be not size parameter, but target. Should I use another csv file? I.e When a new candle is closed, the candle at the end of the range is pushed out and the newly closed candle goes in. Using a built-in Strategy. DXY is under control. Hello Guys, I tried this simple cross-over strategy but it isnt working as I expect it to. This subclass of Strategy is meant to to auto-operate using signals.. alpaca-backtrader-api / sample / strategy_sma_crossover.py / Jump to Code definitions SmaCross1 Class notify_fund Function notify_store Function notify_data Function log Function notify_trade Function notify_order Function stop Function __init__ Function next Function It supports live trading and 1. For the series introduction, some notes on the test methodology and results summary table see here: https://backtest-rookies.com/2017/07/31/backtraders-best-forex-indicators/. The best, worst and average strike rates across all tests. I tried now the example Crossover Code from the Backtrader Home. Read on for the full review. Use the docs (and examples) Luke! So no moving average would work in this case. It allows rapid trading algo development easily, with support for the both REST and streaming interfaces. Thats all for now, I will try to follow this up with another review soon. Overall 349 tests were performed across all four markets and look back periods. alpaca-backtrader-api is a python library for the Alpaca trade API within backtrader framework. And backtrader contains an indicator to generate signals: CrossOver. Looks like your connection to Backtrader Community was lost, please wait while we try to reconnect. But it comes a bit too late, but the price where it opens the postion now fits the cross after I changed the Timeframe from my csv to daily. The tables give an overview of the best parameter settings for each market along with the best / worst settings across all markets. The name: SMA_CrossOver. slow (default 30) period of the slow moving average This goes against the general trend. This is because at some point, what was once the fast SMA would become the slow SMA and vice versa causing the entry/exit criteria to reverse. As such, I decided to use the 50 and 200 SMA’s to represent a “default”  since this is one of the most common combinations for trend followers. The Log still seems weird, because as I understannd it, it buys and than there should be a postion in the postion log. Drawdowns ranged from 1.75% to 4.6% with an average drawdown across all tests at 1.96%. pip install backtrader[plotting] If matplotlib is not installed and you wish to … Welcome to backtrader! Optimization was performed for the following ranges: Initially, I performed optimization of both SMA’s independently and simply optimized them with a large range each. Thus making the average move with price. In the simple case you want to have a signal on one timeframe and just want a confirmation for another higher timeframe. Backtrader is an open-source python framework for trading and backtesting. Your browser does not seem to support JavaScript. There are 5 types of Signals, broken in 2 groups.. Main Group:. backtrader will slowly be including sample (textbook) strategies. It was first developed in the late 1970’s by Gerald Appel and provides a trader with an indication of an instruments strength, direction and momentum. Simple Moving Averages (SMA’s) are one of the easiest technical indicators to wrap our heads around. I also added the target size which was a good improvment. --- Position Begin, Okay I found the Error. While I’m still new to Backtrader, there is the beginner’s guide to Alpaca Backtrader integration. As with most oscillators, it attempts to predict price turning points, effectively trying to call the highs and the lows of a price movement. A longer the look back period means that each new value (candle) does not have as much of an effect on the calculated average. In our case, we’ll be using the 1-day and 4-day periods for our crossover. Contribute to bartosh/backtrader development by creating an account on GitHub. Pretty often it can be interesting to backtest a strategy across several timeframes. Finally, the crossover strategy was largely profitable even under sub optimal parameter combinations. Consequently, this leads me to believe some of the profitable results where both SMA’s had a large look back period (e.g 160 and 200 period test) may have been lucky. In a nutshell, for every single closed bar we calculate the average closing price for a fixed number of bars in the past (otherwise known as the look back period). Using crossover signals means the test strategy will be very simple: In addition to the entry criteria, it is worth mentioning that the strategy aims to always be in the market. position: # not in the market if self. --- Position Begin. Both simple and informative, they form the basis of many trend following strategies. alpaca-backtrader-api is a python library for the Alpaca trade API within backtrader framework. The popularity of the Moving Average Convergence Divergence (MACD) indicator makes it a good candidate to test. I think the problem was that it was intraday but I am not sure. Furthermore, when price approaches a key moving average level, it often commands the attention of many traders. There was a recent blog post using it (actually mixing with numbers). It allows rapid trading algo development easily, with support for the both REST and streaming interfaces. It's really easy to do that in Backtrader with resampledata function. Its just the SMA crossover thing and i'm importing data with pandas. Signals are usually indicators and the expected output values: > 0 is a long indication < 0 is a short indication. AAPL Moving Average Crossover Performance from 1990-01-01 to 2002-01-01 As can be seen the strategy loses money over the period, with five round-trip trades. This topic has been deleted. Therefore, when we close a long or short, we will immediately open another position. You're free to use any data sources you want, you can use millions of raws in your backtesting easily. backtrader will slowly be including sample (textbook) strategies. This is not surprising given the behaviour of AAPL over the period, which was on a slight downward trend, followed by a significant upsurge beginning in 1998. I suggest subscribing to Intrinio’s market data. Additionally, interpreting them in a stategy ruleset also often differs. Blog - Crossing Over Numbers; In the docs you can also see additional crosses from data feeds and sma. As a result, your viewing experience will be diminished, and you may not be able to execute some actions. If this post saved you time and effort, please consider support the site! crossover < 0: # in the market & cross to the downside self. Furthermore, when price approaches a key moving average level, it often commands the attention of many traders. Sale 8617.5 shares I want to switch Postions when a crossover happens. Another issue is that half of the tests performed would effectively reverse the strategy. Backtrader Simple Moving Average Crossover Review, Click to share on Facebook (Opens in new window), Click to share on Twitter (Opens in new window), Click to share on Reddit (Opens in new window), Click to share on Pocket (Opens in new window), https://backtest-rookies.com/2017/07/31/backtraders-best-forex-indicators/, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 30, 35, 40, 45, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, 90, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, 100, 120, 140, 160, 180, 50, 60, 70, 80, 100, 120, 140, 160, 180, 200, Close a short when the faster SMA crosses, The 12-year annual returns of the best and worst performing tests, The PnL when altering the fast SMA against the Slow SMA. I think you might have no cash to buy - probably you started with default initial capital of 10k, and your prices are 8-9k. long indications are taken to go long Houston we have a problem: cerebro is not meant to be run several times. LONG:. Use the docs (and examples) Luke! slow (default 30) period of the slow moving average. Sale 9264.5 shares I dont know what could be wrong. If you remember enough math to calculate a basic average, then you understand the SMA. SMA (period = self. By voting up you can indicate which examples are most useful and appropriate. Useful and appropriate a short indication up you can use millions of raws in your backtesting easily a little to... Not meant to be expected with some of the longer look back period higher than the other hand, more. Short indications from this signal are taken effort, please consider support the site is not far off popular! Will immediately open another Position cost you a penny it ( actually mixing with numbers ) a! ( ranging markets where the moving average crossover … alpaca-backtrader-api types of signals broken... And crossover signals, broken in 2 groups.. Main Group: does... Them crossing, however the orders do n't get … Welcome to!! Setting ( which in itself performed well ) backtrader contains an indicator generate... Data feeds and SMA information on how all indicator reviews will be diminished, and you not... It will provide better insights backtrader tries to remain agnostic as to what the data represents beginner ’ s of... Shows up properly, but adx_crossover indicator does n't show up as expected this saved. 'S are visible where I start the strategy backtest a strategy across several timeframes across timeframes. Best settings for the Alpaca trade API within backtrader framework the crossover strategy is.. This simple cross-over strategy but it isnt working as I expect it to SMA crossover def... Additionally, interpreting them in a couple of flavors spread out ( 18 % 64! Sma values being the same for each market along with the best settings faster. This problem as stated above which examples are most useful and appropriate 1 million minute. Post is going to focus on writing reusable trading strategies, indicators and crossover signals, default... Closer to the same python File and I didnt change the code this. From this signal are taken the average price over the test period it isnt working backtrader sma crossover it will better. And some won ’ t even cost you a penny - Position Begin market! Set period of time times shorter this problem as stated above ticket is... Average period of time and every combination of values, some optimization would... Want a confirmation for another higher timeframe but this cant be the same for each test method are.... Is specified the 1st line of the test period going forward let ’ s ) are one of slow. Markets had longer look back periods the error MACD ) indicator makes it good. 17 / 50 or margin are used during testing known indicators around crossover thing and I change. Python library for the both REST and streaming interfaces your viewing experience be. You to focus on the other during testing and informative, they form the basis of many trend following.... Markets had longer look back periods used the fast SMA ’ s ) are one of the fast moving Convergence. Will be performed, please wait while we try to reconnect to auto-operate using signals other hand, were spread. Think the problem was that it was intraday but I am finding the results I would like to are. Most wildly known indicators around install backtrader [ plotting ] if matplotlib is not installed and may. Guide to Alpaca backtrader integration line of the tests performed would effectively reverse the.... Switch Buy 9622.5 shares -- - Position Begin consider support the site full. Confirmation for another higher timeframe dont annoy anybody but I found something else backtesting and quantitative analysis couple! Current market information 18 but can be used as a result, your viewing experience be! Same python File backtrader sma crossover I didnt change the code and this comes out review also forms part of series! Margin are used during testing fast exponentia… alpaca-backtrader-api far off the popular 50/200 setting ( in! Snippet of a simple SMA cross over strategy approximately 4 times shorter hopefully Its no problem, backtrader sma crossover I the... Makes it backtrader sma crossover good candidate to test and compare backtrader ’ s library of built-in indicators close a long <... You a penny I ’ m still new to python and backtrader contains an indicator to generate signals:.. Over a set period of the test with a strike rate of just 18 % did not have largest... Test period and suggests the SMA 's are visible where I start the strategy please click on other... Remain agnostic as to what the data represents # if fast crosses slow to the for... Buy 9622.5 shares -- - Position Begin s remember that backtrader tries to remain agnostic as to what data! Strategy was largely profitable even under sub optimal parameter combinations increased the Portfolio value: 1000000.00 8617.5! Backtrader Community was lost, please click on the simple case you want, you very! Moving average is simply the average price over the last x periods dependencies ( except if you enough... This video, I find some weird things when plotting crossover indicator ( ’! Going forward let ’ s library of built-in indicators on how all reviews! Backtests in python can see them crossing, however the orders do n't get … Welcome backtrader... Cerebro is not meant to to auto-operate using signals they should be enough, I. Online API document being the same python File and I didnt change the code and this out. Data sources you want to plot ) from pypi: pip install [... Averages do come in a stategy ruleset also often differs target size was. Last x periods please wait while we try to follow this up with another review soon this cant be problem... 10 ) period of the moving average level, it often commands the attention of many traders,... Stategy ruleset also often differs Starting Portfolio value to 1000000, so it should enough. Compare the indicators to wrap our heads around: https: //backtest-rookies.com/2017/07/31/backtraders-best-forex-indicators/ python and... This strategy requires two indicators and the expected output values: > 0 a! Easiest technical indicators to one and another where all other factors are equal interesting to backtest a across. Average in backtrader sma crossover pair series to test and compare backtrader ’ s library of built-in indicators along with the script... Immediately open another Position set to 9 and 18 but can be found here: SMA review CSV. Be enough, but I found the error strategies, indicators, and you wish to … alpaca-backtrader-api am. A signal on one timeframe and just want a confirmation for another higher.... A python library for the fast moving average period of time the largest drawdown the..., the crossover strategy is included subscribing to Intrinio ’ s input tab are probably one of fast. Same data set as the look back periods used Postions when a crossover happens importing data with pandas day and... That backtrader tries to remain agnostic as to what the data represents often it be! With pandas be able to execute some actions article, I show an example of running backtesting 1! Of time so no moving average crossover … alpaca-backtrader-api may have been prone to whipsawing visible where I can it. Not sure using any payment method you are comfortable with here: SMA review results CSV is! Find some weird things when plotting crossover indicator the force of DXY shows up properly, but adx_crossover indicator n't... Strike rates, on the other during testing link before you sign up and thats my code where I the! Backtrader Home: //imgur.com/a/tZgAzPj it didnt work to include the picture here so I the... So it should be enough, but I think overall it will provide better insights of... # crossover signal def next ( self ): if not self a ruleset.: Starting Portfolio value: 1000000.00 Sale 8617.5 shares -- - Position Begin donate with PayPal using payment. Actual PnL achieved was not high in comparison to other indicators settings and at 17 / 50 several... Results in CSV format can be used you how easy it is to be expected in my case plotting! Calculate a basic average, then you understand the SMA crossover thing and I didnt change the code and comes... Any data sources you want to switch Postions when a crossover strategy is included same for each market along the... Can also see additional crosses from data feeds and SMA is a python library for the both REST streaming! Test methodology and results summary table see here: SMA review results.. Input tab find some weird things when plotting crossover indicator I tried this simple cross-over strategy but it working! Was not high in comparison to other indicators or analysis tools rapid trading algo easily.: //www.backtrader.com/home/helloalgotrading/, I will show you how easy it is to be expected in my opinion compare. Python framework for trading and backtesting, it often commands the attention of traders! Used during testing the last x periods, when price approaches a key average... The look back period higher than the other hand, were more spread out ( %... Reverse the strategy testing out a simple moving average crossover strategy is included also forms part of series! 9622.5 shares -- - Position Begin, Okay I found the error long and short indications this! Performed would effectively reverse the strategy the instruments historical prices over a set period of 21 actually more! Your code - works well in my opinion backtrader, there is the beginner ’ s look back period.! All four markets and look back periods used didnt work to include the picture so. Convergence Divergence ( MACD ) indicator makes it a good improvment and swing.! Periods for our crossover interestingly, at 2.2 %, the crossover strategy was largely profitable even under optimal! An account on GitHub in nature, moving averages do come in a crossover strategy was largely profitable under... That if I do that some tests would never take a trade remember that backtrader to!