title
Orders and Leverage - Algorithmic Trading with Python and Quantopian p. 2
description
In this tutorial, we're going to be covering how to actually place an order for stock (buy/sell/short) on Quantopian.
https://pythonprogramming.net
https://twitter.com/sentdex
https://www.facebook.com/pythonprogramming.net/
https://plus.google.com/+sentdex
detail
{'title': 'Orders and Leverage - Algorithmic Trading with Python and Quantopian p. 2', 'heatmap': [{'end': 341.893, 'start': 320.263, 'weight': 0.942}], 'summary': 'Covers executing trades with python for finance, using sma 20 and sma 50, different order methods, shorting apple stock with a target percent of 100% and -100% to highlight shorting risks. it also discusses an algorithmic trading backtesting strategy with transactions worth millions, emphasizing the importance of tracking leverage, and the risks associated with over-leveraging, with a case study showing an instance of reaching 50x leverage. additionally, it explores algorithm performance, market-beating results, specific transactions, and discusses the issues with leveraging in stock trading, emphasizing the importance of transaction control to avoid serious problems.', 'chapters': [{'end': 294.284, 'segs': [{'end': 73.669, 'src': 'embed', 'start': 17.495, 'weight': 0, 'content': [{'end': 28.076, 'text': "So the way that we're going to do that is basically we're just going to ask if SMA 20 is above the SMA 50 we want to place an order.", 'start': 17.495, 'duration': 10.581}, {'end': 37.414, 'text': "Now if you don't know how to place orders You can go down to the API docs, price, control F, order.", 'start': 29.037, 'duration': 8.377}, {'end': 39.836, 'text': 'Here we go, ordering, boom.', 'start': 37.975, 'duration': 1.861}, {'end': 41.797, 'text': "So you've got your options here.", 'start': 40.496, 'duration': 1.301}, {'end': 46.82, 'text': 'These are like types of orders that you can make, market, limit, stop, stop limit.', 'start': 43.018, 'duration': 3.802}, {'end': 49.341, 'text': "You'll see what I'm talking about there momentarily.", 'start': 46.86, 'duration': 2.481}, {'end': 54.504, 'text': 'Looking for the list of the actual orders though.', 'start': 50.782, 'duration': 3.722}, {'end': 59.259, 'text': 'I know which one I want.', 'start': 57.998, 'duration': 1.261}, {'end': 62.581, 'text': "Let's try order.", 'start': 59.319, 'duration': 3.262}, {'end': 67.125, 'text': 'One of them is order target percent or target.', 'start': 62.742, 'duration': 4.383}, {'end': 68.886, 'text': 'Here we go.', 'start': 68.486, 'duration': 0.4}, {'end': 69.827, 'text': 'Order methods.', 'start': 69.126, 'duration': 0.701}, {'end': 73.669, 'text': 'Cool So here you can see a bunch of the different order methods.', 'start': 70.447, 'duration': 3.222}], 'summary': 'Placing orders based on sma 20 above sma 50; various order types available.', 'duration': 56.174, 'max_score': 17.495, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H5LLJDJ3jTI/pics/H5LLJDJ3jTI17495.jpg'}, {'end': 229.553, 'src': 'embed', 'start': 203.277, 'weight': 2, 'content': [{'end': 215.525, 'text': "Now what we're going to say is if SMA 50 is above SMA 20, we want to do the exact same thing, only we actually want to short Apple.", 'start': 203.277, 'duration': 12.248}, {'end': 220.468, 'text': 'So if we want to just make sure we sold all of our shares, we would say the order target percent is zero.', 'start': 215.545, 'duration': 4.923}, {'end': 223.79, 'text': 'We want to make sure we have 0% of our portfolio in Apple.', 'start': 220.588, 'duration': 3.202}, {'end': 227.792, 'text': 'But actually what we want to do in this case is negative 1.0.', 'start': 224.13, 'duration': 3.662}, {'end': 229.553, 'text': 'We want to short Apple.', 'start': 227.792, 'duration': 1.761}], 'summary': 'If sma 50 is above sma 20, short apple and ensure 0% portfolio in apple by selling or shorting.', 'duration': 26.276, 'max_score': 203.277, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H5LLJDJ3jTI/pics/H5LLJDJ3jTI203277.jpg'}, {'end': 294.284, 'src': 'embed', 'start': 269.545, 'weight': 4, 'content': [{'end': 275.43, 'text': 'The danger of shorting is, there is infinite downside to only a finite upside.', 'start': 269.545, 'duration': 5.885}, {'end': 279.113, 'text': 'so at $1,000, your upside per share is about.', 'start': 275.43, 'duration': 3.683}, {'end': 286.718, 'text': 'you can make $1,000 per share, shorting a share, but your downside is infinite because the share price can go up infinitely.', 'start': 279.113, 'duration': 7.605}, {'end': 288.92, 'text': 'and the inverse of that, of course, is investing.', 'start': 286.718, 'duration': 2.202}, {'end': 292.222, 'text': 'your upside is infinite, your downside is finite.', 'start': 288.92, 'duration': 3.302}, {'end': 294.284, 'text': 'so shorting is just inherently dangerous.', 'start': 292.222, 'duration': 2.062}], 'summary': 'Shorting carries infinite downside and finite upside, making it inherently dangerous.', 'duration': 24.739, 'max_score': 269.545, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H5LLJDJ3jTI/pics/H5LLJDJ3jTI269545.jpg'}], 'start': 1.872, 'title': 'Executing trades with python for finance', 'summary': 'Discusses using python to execute trades based on sma 20 and sma 50, including different order methods, and shorting apple stock with a target percent of 100% and shorting with a target percent of -100%, highlighting the risks of shorting.', 'chapters': [{'end': 294.284, 'start': 1.872, 'title': 'Python for finance - part 14: executing trades', 'summary': 'Discusses using python to execute trades based on sma 20 and sma 50, including different order methods, and shorting apple stock with a target percent of 100% and shorting with a target percent of -100%, highlighting the risks of shorting.', 'duration': 292.412, 'highlights': ['Using Python to execute trades based on SMA 20 and SMA 50 The chapter covers the implementation of Python code to execute trades based on the condition of SMA 20 being above SMA 50, indicating a potential buy signal.', 'Different order methods The tutorial introduces various order methods including market, limit, stop, stop limit, order value, order percent, and order target percent, providing options for different trading strategies and portfolio balancing.', 'Shorting Apple stock with a target percent of 100% The chapter explains the process of shorting Apple stock with a target percent of 100%, indicating the intention to allocate 100% of the portfolio to short Apple stock, enabling users to rebalance their portfolio or take a bearish position on Apple stock.', 'Shorting with a target percent of -100% The transcript elaborates on shorting Apple stock with a target percent of -100%, signifying the intent to short sell all shares of Apple stock, highlighting the concept of taking a bearish position on a stock by borrowing and selling shares in anticipation of a price decline.', 'Risks of shorting The chapter emphasizes the potentially infinite downside and finite upside of shorting, cautioning about the inherent risks associated with shorting a stock as it can lead to substantial losses.']}], 'duration': 292.412, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H5LLJDJ3jTI/pics/H5LLJDJ3jTI1872.jpg', 'highlights': ['Different order methods The tutorial introduces various order methods including market, limit, stop, stop limit, order value, order percent, and order target percent, providing options for different trading strategies and portfolio balancing.', 'Using Python to execute trades based on SMA 20 and SMA 50 The chapter covers the implementation of Python code to execute trades based on the condition of SMA 20 being above SMA 50, indicating a potential buy signal.', 'Shorting with a target percent of -100% The transcript elaborates on shorting Apple stock with a target percent of -100%, signifying the intent to short sell all shares of Apple stock, highlighting the concept of taking a bearish position on a stock by borrowing and selling shares in anticipation of a price decline.', 'Shorting Apple stock with a target percent of 100% The chapter explains the process of shorting Apple stock with a target percent of 100%, indicating the intention to allocate 100% of the portfolio to short Apple stock, enabling users to rebalance their portfolio or take a bearish position on Apple stock.', 'Risks of shorting The chapter emphasizes the potentially infinite downside and finite upside of shorting, cautioning about the inherent risks associated with shorting a stock as it can lead to substantial losses.']}, {'end': 749.245, 'segs': [{'end': 364.168, 'src': 'heatmap', 'start': 320.263, 'weight': 0, 'content': [{'end': 321.724, 'text': 'I wish there was a quicker way to do this.', 'start': 320.263, 'duration': 1.461}, {'end': 324.025, 'text': "I'm an elite clicker, by the way.", 'start': 322.544, 'duration': 1.481}, {'end': 327.186, 'text': "Someone's going to be like, holy..", 'start': 324.285, 'duration': 2.901}, {'end': 330.588, 'text': 'Okay Oh, I thought I misclicked, and then it was going to not do it.', 'start': 327.186, 'duration': 3.402}, {'end': 333.889, 'text': "Anyway, we'll click run full backtest.", 'start': 330.668, 'duration': 3.221}, {'end': 337.271, 'text': "Okay, so then once this starts up, we'll start seeing some results.", 'start': 334.249, 'duration': 3.022}, {'end': 339.092, 'text': "If it goes too slow, I'll pause and wait.", 'start': 337.331, 'duration': 1.761}, {'end': 341.893, 'text': 'But basically, everyone is going to have to sit through this.', 'start': 339.152, 'duration': 2.741}, {'end': 346.295, 'text': "But I'm expecting to immediately see something that will..", 'start': 343.273, 'duration': 3.022}, {'end': 348.356, 'text': 'Like, for example, here, we immediately..', 'start': 346.295, 'duration': 2.061}, {'end': 354.363, 'text': 'bought 1.3 million and sold 0.3 million.', 'start': 349.281, 'duration': 5.082}, {'end': 356.624, 'text': "so that's already kind of suspect.", 'start': 354.363, 'duration': 2.261}, {'end': 357.965, 'text': "but we'll continue trading.", 'start': 356.624, 'duration': 1.341}, {'end': 359.986, 'text': "no problem, no problem, because we're doing good.", 'start': 357.965, 'duration': 2.021}, {'end': 364.168, 'text': "so there's no reason to kind of question what's going on, as long as we're making money, is it?", 'start': 359.986, 'duration': 4.182}], 'summary': 'Elite clicker run backtest, bought 1.3m, sold 0.3m, expecting immediate results.', 'duration': 43.905, 'max_score': 320.263, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H5LLJDJ3jTI/pics/H5LLJDJ3jTI320263.jpg'}, {'end': 415.841, 'src': 'embed', 'start': 383.267, 'weight': 1, 'content': [{'end': 386.908, 'text': 'Okay, so finally what I was waiting for happened.', 'start': 383.267, 'duration': 3.641}, {'end': 393.491, 'text': "And basically you can see here that suddenly we're making transactions like 74 million.", 'start': 387.628, 'duration': 5.863}, {'end': 394.771, 'text': 'This is a huge one, 213 million and so on.', 'start': 393.531, 'duration': 1.24}, {'end': 396.152, 'text': 'And obviously in our..', 'start': 395.472, 'duration': 0.68}, {'end': 404.756, 'text': 'or return is just absolutely BS.', 'start': 401.674, 'duration': 3.082}, {'end': 408.317, 'text': "So we're gonna cancel this and talk about leverage,", 'start': 405.216, 'duration': 3.101}, {'end': 415.841, 'text': "because something's happening and basically leverage is just something you're gonna always wanna track for reasons like this.", 'start': 408.317, 'duration': 7.524}], 'summary': 'Transactions reached 74 million and 213 million, prompting cancellation and focus on leverage tracking.', 'duration': 32.574, 'max_score': 383.267, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H5LLJDJ3jTI/pics/H5LLJDJ3jTI383267.jpg'}, {'end': 552.241, 'src': 'embed', 'start': 525.045, 'weight': 2, 'content': [{'end': 532.27, 'text': 'Okay, but now we are tracking this custom data and we can see that at some point we went up to about 50x leverage.', 'start': 525.045, 'duration': 7.225}, {'end': 537.053, 'text': "So basically that means like we're investing with 50 times more than we actually own.", 'start': 532.81, 'duration': 4.243}, {'end': 540.195, 'text': "No one's going to give you that kind of leverage.", 'start': 537.933, 'duration': 2.262}, {'end': 542.356, 'text': "So you just can't, you can't do that.", 'start': 540.235, 'duration': 2.121}, {'end': 544.617, 'text': 'Now we settled down a little bit here, actually.', 'start': 542.596, 'duration': 2.021}, {'end': 547.459, 'text': "But anyways, yeah, you just can't do that.", 'start': 545.678, 'duration': 1.781}, {'end': 552.241, 'text': 'So okay, so our leverage is crazy and now you know always.', 'start': 547.939, 'duration': 4.302}], 'summary': 'Data shows peak 50x leverage, settled at lower level. caution against high leverage.', 'duration': 27.196, 'max_score': 525.045, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H5LLJDJ3jTI/pics/H5LLJDJ3jTI525045.jpg'}, {'end': 642.65, 'src': 'embed', 'start': 599.676, 'weight': 3, 'content': [{'end': 608.783, 'text': "But if it doesn't occur within a minute, guess what happens? If SMA 20 is greater than 50, it executes the exact same order again.", 'start': 599.676, 'duration': 9.107}, {'end': 612.386, 'text': 'And then you start getting into some trouble.', 'start': 609.804, 'duration': 2.582}, {'end': 614.007, 'text': 'And then it just starts amplifying.', 'start': 612.847, 'duration': 1.16}, {'end': 619.572, 'text': "So at some point, basically, we start shorting more Apple than we've got, and we start buying way more Apple than we've got.", 'start': 614.067, 'duration': 5.505}, {'end': 621.794, 'text': "We're, in theory, just borrowing money to do it.", 'start': 619.652, 'duration': 2.142}, {'end': 624.896, 'text': 'So instead, what we need to do is put a quick check into here.', 'start': 622.314, 'duration': 2.582}, {'end': 628.499, 'text': "And the check that we're going to make is we're going to check our open orders first.", 'start': 625.357, 'duration': 3.142}, {'end': 630.621, 'text': "So we're going to say open underscore orders.", 'start': 628.559, 'duration': 2.062}, {'end': 634.384, 'text': "And that's going to be equal to get underscore open orders.", 'start': 631.341, 'duration': 3.043}, {'end': 637.166, 'text': "And that's just all of our orders.", 'start': 635.845, 'duration': 1.321}, {'end': 640.308, 'text': 'And again, just some magic here is happening.', 'start': 637.586, 'duration': 2.722}, {'end': 642.65, 'text': 'We never had to import get open orders.', 'start': 640.368, 'duration': 2.282}], 'summary': 'Algorithmic trading strategy needs a check for open orders to avoid amplifying trades.', 'duration': 42.974, 'max_score': 599.676, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H5LLJDJ3jTI/pics/H5LLJDJ3jTI599676.jpg'}], 'start': 294.284, 'title': 'Algorithmic trading backtesting strategy and tracking leverage', 'summary': 'Discusses an algorithmic trading backtesting strategy involving transactions worth millions, with specific purchase and subsequent transaction amounts, leading to an unsatisfactory return, prompting a discussion on leverage. it also covers the importance of tracking leverage in trading algorithms, emphasizing the risk of over-leveraging and the need to manage open orders to prevent over-trading, with a case study showing an instance of reaching 50x leverage.', 'chapters': [{'end': 408.317, 'start': 294.284, 'title': 'Algorithmic trading backtesting strategy', 'summary': 'Discusses an algorithmic trading backtesting strategy for making transactions worth millions, with an initial purchase of 1.3 million and subsequent transactions of 74 million and 213 million, yielding an unsatisfactory return, prompting a discussion on leverage.', 'duration': 114.033, 'highlights': ['Making transactions worth millions The trading strategy involves making significant transactions, such as purchasing 1.3 million and subsequently 74 million and 213 million.', "Unsatisfactory return on transactions The transactions yield an unsatisfactory return, as described as 'just absolutely BS', prompting a discussion on leverage.", 'Discussion on leverage The chapter concludes with a discussion on leveraging, indicating a need to address the unsatisfactory returns from the transactions.']}, {'end': 749.245, 'start': 408.317, 'title': 'Tracking leverage and managing orders', 'summary': 'Discusses the importance of tracking leverage in trading algorithms, highlighting the risk of over-leveraging and the need to manage open orders to prevent over-trading, with a case study showing an instance of reaching 50x leverage.', 'duration': 340.928, 'highlights': ['The importance of tracking leverage in trading algorithms is emphasized, with a case study showing an instance of reaching 50x leverage, highlighting the risk of over-leveraging. (Relevance: 5)', 'The need to manage open orders to prevent over-trading is discussed, with an explanation of the risk of multiple orders trying to buy/sell the same stock, leading to over-investing. (Relevance: 4)', 'The potential consequences of not managing open orders are outlined, including the scenario where the algorithm keeps executing the same order if not filled within a minute, leading to over-trading and amplifying the leverage. (Relevance: 3)', 'The process of recording leverage and its frequency is explained, with a mention of being able to record up to five daily metrics, and the recommendation to not record every minute unless necessary. (Relevance: 2)', "The method of recording leverage in the algorithm is demonstrated, showing the use of the 'record' function to plot leverage and track its values. (Relevance: 1)"]}], 'duration': 454.961, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H5LLJDJ3jTI/pics/H5LLJDJ3jTI294284.jpg', 'highlights': ['Transactions worth millions: Purchasing 1.3M, 74M, and 213M.', 'Unsatisfactory return prompts leverage discussion.', 'Importance of tracking leverage emphasized with 50x case study.', 'Managing open orders to prevent over-trading discussed.', 'Consequences of not managing open orders outlined.']}, {'end': 970.192, 'segs': [{'end': 793.753, 'src': 'embed', 'start': 749.245, 'weight': 0, 'content': [{'end': 758.21, 'text': "there tab this over great and now let's run this and and see if we're doing any any better.", 'start': 749.245, 'duration': 8.965}, {'end': 761.652, 'text': "so i'll keep the same, the same thing.", 'start': 758.21, 'duration': 3.442}, {'end': 768.716, 'text': "so i'll run this back test and again i'll just pause while this is going and then i'll unpause when we see whether we're,", 'start': 761.652, 'duration': 7.064}, {'end': 773.428, 'text': "we're winning or we're not All right and we are back.", 'start': 768.716, 'duration': 4.712}, {'end': 775.909, 'text': 'We are actually currently beating the market.', 'start': 774.289, 'duration': 1.62}, {'end': 777.789, 'text': "There's been plenty of times where we're not beating the market.", 'start': 775.929, 'duration': 1.86}, {'end': 786.031, 'text': "But coming back down here and looking again at our transactions, first of all, that's an interesting transaction.", 'start': 779.09, 'duration': 6.941}, {'end': 788.892, 'text': "I'm not even going to question that transaction right at the moment.", 'start': 786.691, 'duration': 2.201}, {'end': 793.753, 'text': 'But for the most part, we can see that serious transactions, like this was probably a buy and sell transaction.', 'start': 788.952, 'duration': 4.801}], 'summary': "After running the back test, we are currently beating the market, but there have been times when we haven't. overall, serious transactions are visible, indicating progress in trading strategy.", 'duration': 44.508, 'max_score': 749.245, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H5LLJDJ3jTI/pics/H5LLJDJ3jTI749245.jpg'}, {'end': 880.051, 'src': 'embed', 'start': 832.939, 'weight': 2, 'content': [{'end': 841.003, 'text': 'at some points below, but at the point of the crossover, as price is going up and down and kind of changing before it really solidifies, um,', 'start': 832.939, 'duration': 8.064}, {'end': 844.405, 'text': 'it might actually change like 10 times.', 'start': 841.003, 'duration': 3.402}, {'end': 849.388, 'text': "so again, um, oops, let's see, here we go.", 'start': 844.405, 'duration': 4.983}, {'end': 854.19, 'text': 'um, in this case we probably, just, you know, bought a million, sold a million, bought a million, sold a million.', 'start': 849.388, 'duration': 4.802}, {'end': 856.272, 'text': 'we just kind of kept doing that.', 'start': 854.19, 'duration': 2.082}, {'end': 858.193, 'text': "um, the other thing that's happening.", 'start': 856.272, 'duration': 1.921}, {'end': 859.973, 'text': "Why? that's a problem.", 'start': 859.113, 'duration': 0.86}, {'end': 862.335, 'text': 'first of all, just the back and forth, buy and sell and buy and sell.', 'start': 859.973, 'duration': 2.362}, {'end': 865.876, 'text': "That's not good because you'd be racking up trade fees like crazy.", 'start': 863.255, 'duration': 2.621}, {'end': 867.197, 'text': 'Right now, I forget.', 'start': 866.236, 'duration': 0.961}, {'end': 869.578, 'text': 'I think there is a default commission.', 'start': 867.217, 'duration': 2.361}, {'end': 877.29, 'text': "I think it's .001, but I'm not positive, percent, or rather .1%.", 'start': 869.818, 'duration': 7.472}, {'end': 880.051, 'text': "Anyway, I'm not positive that it's actually built in initially.", 'start': 877.29, 'duration': 2.761}], 'summary': 'During the crossover, the price changed around 10 times, resulting in frequent buy and sell actions leading to high trade fees.', 'duration': 47.112, 'max_score': 832.939, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H5LLJDJ3jTI/pics/H5LLJDJ3jTI832939.jpg'}, {'end': 958.378, 'src': 'embed', 'start': 913.433, 'weight': 4, 'content': [{'end': 918.438, 'text': "but also what's happening is basically consider like a situation if you're shorting a million shares of Apple,", 'start': 913.433, 'duration': 5.005}, {'end': 925.467, 'text': 'You have to buy a million back to equal zero and then you buy another million to be like long, 100% apples.', 'start': 918.818, 'duration': 6.649}, {'end': 928.872, 'text': "So that's why you're seeing a lot of these two million ticks.", 'start': 925.507, 'duration': 3.365}, {'end': 935.121, 'text': 'But anyway, the six million is a great example though of a serious problem that we still have.', 'start': 929.072, 'duration': 6.049}, {'end': 937.402, 'text': 'But we have leverage under control.', 'start': 935.621, 'duration': 1.781}, {'end': 939.684, 'text': "So that's it for this video.", 'start': 937.883, 'duration': 1.801}, {'end': 943.787, 'text': 'In the next video, we are going to talk about how to control this transactions problem.', 'start': 939.764, 'duration': 4.023}, {'end': 952.053, 'text': "And then from there, we'll kind of talk a little bit more about, even from that point, why research is going to be more important.", 'start': 945.228, 'duration': 6.825}, {'end': 958.378, 'text': 'So if you have questions, again, up to this point, if anything appears black box to you, it probably is.', 'start': 952.494, 'duration': 5.884}], 'summary': 'Short selling a million shares of apple results in buying back a million and then buying another million to be 100% long on apple. the video discusses the challenge of a six million leverage problem and the need to control transactions.', 'duration': 44.945, 'max_score': 913.433, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H5LLJDJ3jTI/pics/H5LLJDJ3jTI913433.jpg'}], 'start': 749.245, 'title': 'Algorithm and leverage performance', 'summary': 'Explores algorithm performance, noting market-beating results and specific transactions, and discusses the issues with leveraging in stock trading, emphasizing the importance of transaction control to avoid serious problems.', 'chapters': [{'end': 793.753, 'start': 749.245, 'title': 'Algorithm performance analysis', 'summary': 'Explores the performance of an algorithm, noting it is currently beating the market after facing instances where it did not, and examining specific transactions for further insights.', 'duration': 44.508, 'highlights': ['The algorithm is currently beating the market, indicating successful performance.', 'The speaker acknowledges previous instances where the algorithm did not beat the market, highlighting the fluctuating nature of its performance.', 'The speaker reflects on specific transactions, noting one as particularly interesting and likely a buy and sell transaction.']}, {'end': 970.192, 'start': 794.591, 'title': 'Leverage control in stock trading', 'summary': 'Discusses the issues with frequent trading resulting in high trade fees and the occurrences of two million ticks due to leveraging, while emphasizing the importance of controlling transactions to avoid serious problems.', 'duration': 175.601, 'highlights': ['The chapter discusses the issues with frequent trading resulting in high trade fees Frequent buy and sell actions result in racking up trade fees, which could be as high as .1% commission.', 'Occurrences of two million ticks due to leveraging The two million ticks occur due to the need to buy and sell shares to control leverage, as explained with the example of shorting and buying shares of Apple.', 'Emphasizing the importance of controlling transactions to avoid serious problems Controlling transactions is crucial to avoid serious problems, as exemplified by the mention of the six million tick as a serious problem that needs to be addressed.']}], 'duration': 220.947, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H5LLJDJ3jTI/pics/H5LLJDJ3jTI749245.jpg', 'highlights': ['The algorithm is currently beating the market, indicating successful performance.', 'The speaker reflects on specific transactions, noting one as particularly interesting and likely a buy and sell transaction.', 'The speaker acknowledges previous instances where the algorithm did not beat the market, highlighting the fluctuating nature of its performance.', 'The chapter discusses the issues with frequent trading resulting in high trade fees.', 'Emphasizing the importance of controlling transactions to avoid serious problems.', 'Occurrences of two million ticks due to leveraging.', 'The two million ticks occur due to the need to buy and sell shares to control leverage, as explained with the example of shorting and buying shares of Apple.']}], 'highlights': ['Different order methods The tutorial introduces various order methods including market, limit, stop, stop limit, order value, order percent, and order target percent, providing options for different trading strategies and portfolio balancing.', 'Using Python to execute trades based on SMA 20 and SMA 50 The chapter covers the implementation of Python code to execute trades based on the condition of SMA 20 being above SMA 50, indicating a potential buy signal.', 'Shorting with a target percent of -100% The transcript elaborates on shorting Apple stock with a target percent of -100%, signifying the intent to short sell all shares of Apple stock, highlighting the concept of taking a bearish position on a stock by borrowing and selling shares in anticipation of a price decline.', 'Shorting Apple stock with a target percent of 100% The chapter explains the process of shorting Apple stock with a target percent of 100%, indicating the intention to allocate 100% of the portfolio to short Apple stock, enabling users to rebalance their portfolio or take a bearish position on Apple stock.', 'Risks of shorting The chapter emphasizes the potentially infinite downside and finite upside of shorting, cautioning about the inherent risks associated with shorting a stock as it can lead to substantial losses.', 'Transactions worth millions: Purchasing 1.3M, 74M, and 213M.', 'Unsatisfactory return prompts leverage discussion.', 'Importance of tracking leverage emphasized with 50x case study.', 'Managing open orders to prevent over-trading discussed.', 'Consequences of not managing open orders outlined.', 'The algorithm is currently beating the market, indicating successful performance.', 'The speaker reflects on specific transactions, noting one as particularly interesting and likely a buy and sell transaction.', 'The speaker acknowledges previous instances where the algorithm did not beat the market, highlighting the fluctuating nature of its performance.', 'The chapter discusses the issues with frequent trading resulting in high trade fees.', 'Emphasizing the importance of controlling transactions to avoid serious problems.', 'Occurrences of two million ticks due to leveraging.', 'The two million ticks occur due to the need to buy and sell shares to control leverage, as explained with the example of shorting and buying shares of Apple.']}