Building a Strategy - Theory Discussion

Welcome to this discussion thread. Feel free to ask questions or discuss things related to this section.

Hi Filip, do you advise the backtest on the same asset in other periode or on a complete other asset ? Kr. Roland

Same asset is recommended

Hi Filip, I may be wrong and it is not really important but to model your simple Bart Simpson strategy you should go short when close-open>100 and volume>1000.
In the step3 video you said you buy at market if these conditions are met.

1 Like

Hi all, Hi Filip, I have some trouble to grasp how a stop loss works when shorting something. I can understand that for example if I short bitcoin and it suddenly moons that I would be wiped out. Going short means, that I borrow and sell something that I do not own. In case of shorting BTC I have to borrow BTC from someone else, sell them and return on a later point in time.
Lets assume I borrow a bitcoin at 3000$ and I open a short position with a stop loss at 3300$. But magically bitcoin soared to 4500$ rapidly (for example due to halving or other good news) and remains there for too long.
I have to purchase the BTC back to the person I borrowed it from, at market price now, no matter if I placed the stop loss, right? So how can a stop loss work in a short position, if I do not hold any instrument anymore? The stop loss does not magically return the BTC to me at the stop loss level.

Hi Mad, excellent question. Let me see if I can clarify it. You are completely correct when you describe the shorting of bitcoin. But stop losses works in both long and short positions.

In your scenario where bitcoin would soar to 4500, your stop loss would trigger at 3300 since it passed that level. But if there is no sell order at that level, matching your buy order. You stop loss order will buy at the best possible price to get your out of your position (market order). So if the price soars to 4500 without any sell orders in between 3000 and 4500, then yes, you would get out at 4500.

But the exactly the same would happen in a long scenario. You can just flip the script. You go long at 4500, have your stop loss at 4200. Then the price suddenly drop to 3000 and there are no buy orders in between to match your sell order. Then you would have to sell your bitcoin and close your position at 3000, the best possible rate where there are orders that matches yours.

1 Like

Hi Filip! So…how do we properly test our strategies on crypto assets when BitCoin began at the bottom of 2009? There isn’t any real data as to how it performs in a real global bear market. Could we train on stock data to get a full economic cycle then back-test vs. crypto data?

1 Like

Filip! Question on position size. Sure, limit your risk to 1% of your portfolio. But on the bottom end shouldn’t you size positions so that your reward/risk ratio remains above 2 after taking spread and transaction fees, and possibly taxes into both sides? There is a minimum size below which all your reward is eaten by frictional costs.

Also: from manual trading position size is a matter of how many open positions you’re willing to manage at once. I’ve been told no more than 3 starting out, and ten was the old limit for pros.

1 Like

Good question. I wouldn’t want to use for example stock market data and backtest a bitcoin trading algo. It wouldn’t make sense to me, because those markets are completely different. They don’t share much in common.

As another example, I’ve never seen people develop an algo for EUR/USD and backtests it on EUR/GBP.

But, your question is still a very valid one. Because the bitcoin data set is very limited, so this is a unique situation. I would however, still only use the bitcoin data and do the best I can. Maybe eliminate the very early data and only use the last 3-4 years. That’s not a lot of data, but it’s the best we can get unfortunately.

That would be my view of it.

On your second question regarding position size.
I agree, never take trades with less than 2 in reward/risk. I wouldn’t take taxes into that calculation though, but I guess that depends on where you live and your tax policy. If you pay taxes on every gain for example, then you need to calculate with it. If you pay taxes on your yearly returns, I wouldn’t. No advice, ask your tax professional :wink:

1 position can be hard enough in the beginning imo. But this is of course different if we are talking algos.

3 Likes

Hi Filip! Thank you for the good and detailed explanation. Man, what would be a good period of time for back testing the strategy? Cryptocurrency doesn’t have that long of a history. How can it be accurate? Thank you

1 Like

It’s hard to say. First of all it depends on your time frame. Are you using daily or 1-minute time frame.

Usually you would say the more data the better. But I think some would argue that crypto markets have changed quite a lot since 2011 and that by including that old data you would be misled.

It’s also a good idea to test over different market cycles. If I were in your shoes, I would probably make sure I try my algorithm over the previous bull run and the previous/current bear market. But depends on your algo and time frame. If you only get 2-3 trades during that time it will obviously be very hard to get any knowledge out of that.

I hope that helped you a little bit :slight_smile:

1 Like

I am understanding up to this point and looking to learn these strategies because it is informative and exciting to me.Can you also do this on a small scale if you don’t have a big sum of money?