Posts

Showing posts with the label T-SQL scripts
Image
A Multi-Decade Framework for Comparing Ticker Prices from Two Spreadsheet Data Providers This post presents a framework for collecting daily historical ticker prices from two spreadsheet-based data providers over multiple decades for six tickers.  The providers are the GOOGLEFINANCE function in Google Sheets and the STOCKHISTORY function in Microsoft Excel.  Subsequent posts will track and analyze price trends for the six tickers as well as illustrate how to use multi-decade historical prices for evaluating a collection of buy/sell models, such as the Proper Order and Gain Lock-In (POGL) model for programmatically specifying trade entry and exit dates for tickers. See two appendixes to this post for titles and links to prior posts covering both data providers and the POGL model. Tickers and Spreadsheet Expressions Tracked in This Post The following table includes tickers with matching security names whose historical prices are downloaded in this post.  All the trading ins...
Image
An Initial Evaluation of Buy on Proper Order and Sell on Dynamic Stop Loss Orders A well-constructed buy-sell strategy can help you buy securities when their prices are highly likely to continue rising until they don’t rise any more.  Self-directed security traders sometimes call this a “buy high, sell higher” strategy.  One way of implementing this kind of strategy is to buy a security when its price is rising, and sell the security through a sell order that protects accumulated returns from an imminent reversal or price gradually drifting lower from its entry for a position.  Another critical feature of the strategy is that sell order prices can be dynamic and rise in response to gains in the underlying security’s price. There are many ways to implement this kind of strategy.  This post implements the buy high element of the strategy based on the relationships between close prices and two or more exponential moving averages (EMAs) with different period lengths....