├── .gitignore ├── FGMR ├── strategy-report.png ├── spx-strategy-and-study.pdn ├── spx-strategy-and-study.png ├── edit-studies-and-strategies-dialog.png ├── FGMR_Strat.txt ├── FGMR.txt ├── FGMR.md └── FGMR-StrategyReports-SPX.csv ├── FGMR_ADVANCED ├── FGMR_ADVANCED.png ├── FGMR_ADVANCED.md ├── FGMR_ADVANCED_Strategy.txt └── FGMR_ADVANCED_Study.txt ├── SIERRA_CHART ├── kg_NewStudyTemplate.png ├── SIERRA_CHART.md └── kg_NewStudyTemplate.cpp ├── SOX_FGMR ├── sox-strategy-with-Floating-PL.png ├── SOX_FGMR.md └── SOX_FGMR_Strat.txt ├── PowerShell ├── PowerShell.md └── Get-StrategyReportCsvStatistics.ps1 ├── LICENSE ├── .vscode └── launch.json ├── VIX_FGMR ├── VIX_FGMR.md └── VIX_FGMR.txt └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | **/*.xlsx -------------------------------------------------------------------------------- /FGMR/strategy-report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/korygill/technical-analysis/HEAD/FGMR/strategy-report.png -------------------------------------------------------------------------------- /FGMR/spx-strategy-and-study.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/korygill/technical-analysis/HEAD/FGMR/spx-strategy-and-study.pdn -------------------------------------------------------------------------------- /FGMR/spx-strategy-and-study.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/korygill/technical-analysis/HEAD/FGMR/spx-strategy-and-study.png -------------------------------------------------------------------------------- /FGMR_ADVANCED/FGMR_ADVANCED.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/korygill/technical-analysis/HEAD/FGMR_ADVANCED/FGMR_ADVANCED.png -------------------------------------------------------------------------------- /SIERRA_CHART/kg_NewStudyTemplate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/korygill/technical-analysis/HEAD/SIERRA_CHART/kg_NewStudyTemplate.png -------------------------------------------------------------------------------- /SOX_FGMR/sox-strategy-with-Floating-PL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/korygill/technical-analysis/HEAD/SOX_FGMR/sox-strategy-with-Floating-PL.png -------------------------------------------------------------------------------- /FGMR/edit-studies-and-strategies-dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/korygill/technical-analysis/HEAD/FGMR/edit-studies-and-strategies-dialog.png -------------------------------------------------------------------------------- /PowerShell/PowerShell.md: -------------------------------------------------------------------------------- 1 | # PowerShell Scripts 2 | 3 | ## Output statistics from a thinkorswim strategy file exported as csv. 4 | 5 | [Get-StrategyReportCsvStatistics.ps1](Get-StrategyReportCsvStatistics.ps1) 6 | 7 | -------------------------------------------------------------------------------- /SIERRA_CHART/SIERRA_CHART.md: -------------------------------------------------------------------------------- 1 | # Sierra Chart strategies and studies # 2 | 3 | ## New Study Template ## 4 | 5 | The *New Study Template* in [kg_NewStudyTemplate.cpp](/SIERRA_CHART/kg_NewStudyTemplate.cpp) is a great starting point for any new Sierra Chart study and has some useful helper functions to allow some easy control over your study like Expiration Date, Authorization to specific users, and Authorization to specific users if your study is distributed via the Sierra Chart website Studies Account Control Panel. 6 | 7 | The study shows an Exponential Moving Average and makes use of bar coloring if average is over/under price. 8 | 9 | ![kg_NewStudyTemplate](kg_NewStudyTemplate.png "kg_NewStudyTemplate") 10 | 11 | ## YouTube video where I walk through the code. ## 12 | 13 | https://youtu.be/enUPbJpHtvU 14 | 15 | 16 | --- 17 | back to [README.md](/README.md) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Kory Gill 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "PowerShell", 9 | "request": "launch", 10 | "name": "PowerShell Launch Current File", 11 | "script": "${file}", 12 | "args": [], 13 | "cwd": "${file}" 14 | }, 15 | { 16 | "type": "PowerShell", 17 | "request": "launch", 18 | "name": "PowerShell Launch Current File in Temporary Console", 19 | "script": "${file}", 20 | "args": [], 21 | "cwd": "${file}", 22 | "createTemporaryIntegratedConsole": true 23 | }, 24 | { 25 | "type": "PowerShell", 26 | "request": "launch", 27 | "name": "PowerShell Launch Current File w/Args Prompt", 28 | "script": "${file}", 29 | "args": [ 30 | "${command:SpecifyScriptArgs}" 31 | ], 32 | "cwd": "${file}" 33 | }, 34 | { 35 | "type": "PowerShell", 36 | "request": "attach", 37 | "name": "PowerShell Attach to Host Process", 38 | "processId": "${command:PickPSHostProcess}", 39 | "runspaceId": 1 40 | }, 41 | { 42 | "type": "PowerShell", 43 | "request": "launch", 44 | "name": "PowerShell Interactive Session", 45 | "cwd": "" 46 | } 47 | ] 48 | } -------------------------------------------------------------------------------- /SOX_FGMR/SOX_FGMR.md: -------------------------------------------------------------------------------- 1 | # $SOX Fear & Greed Mean Reversion Strategy (SOX_FGMR) # 2 | 3 | This is a long-only strategy based on the work of [@kerberos007](https://twitter.com/kerberos007). If you look at his feed, you will see lots of work regarding this strategy using Bollinger Bands, Percent B (%B), and some initial parameters that give good back testing results. 4 | 5 | As with any strategy, you should understand it, tweak it to your own risk profile, and extend it to incorporate other indicators and strategies. 6 | 7 | Alternatively, just buy or sell the glitch! 8 | 9 | ## A picture is worth a thousand words, FGMR on SOX/SOXX ## 10 | 11 | ![sox-strategy-with-Floating-PL](sox-strategy-with-Floating-PL.png "sox-strategy-with-Floating-PL") 12 | 13 | ## Strategy and Study Development ## 14 | 15 | This strategy is for the SOX (or SOXX). 16 | 17 | In the last 8 years, it has had 22 winners, 3 losers. Average trade was about 40 days. You can trade this with SOXX ETF, 3x ETF SOXL, options, or try to cherry-pick your own Semiconductor company. 18 | 19 | The thinkscript code for the strategy is below. They are saved as txt files so they can be opened easily. You will need to create a new study or strategy in thinkorswim and copy/paste them in. 20 | 21 | [SOX_FGMR_Strat](/SOX_FGMR/SOX_FGMR_Strat.txt) 22 | 23 | ## post script ## 24 | 25 | These studies may or may not work on other symbols. With modifications to the parameters, maybe they work better for Gold than the Euro. Welcome to technical analysis and your journey down the rabbit hole. 26 | 27 | ## feedback welcome ## 28 | 29 | Have a suggestion? Found an issue? Reach out to me on twitter, my DM is open to all. If you are a github user, file an issue or make a suggested change and PR to this repo. 30 | 31 | 32 | --- 33 | back to [README.md](/README.md) -------------------------------------------------------------------------------- /VIX_FGMR/VIX_FGMR.md: -------------------------------------------------------------------------------- 1 | # $VIX Fear & Greed Mean Reversion Strategy (VIX_FGMR) # 2 | 3 | This is a long/short strategy based on the work of [@kerberos007](https://twitter.com/kerberos007). If you look at his feed, you will see lots of work regarding this strategy using Bollinger Bands, Percent B (%B), and some initial parameters that give good back testing results. 4 | 5 | As with any strategy, you should understand it, tweak it to your own risk profile, and extend it to incorporate other indicators and strategies. 6 | 7 | Alternatively, just buy or sell the glitch! 8 | 9 | ## Strategy and Study Development ## 10 | 11 | This strategy/study is for the VIX. 12 | 13 | A *strategy* for this study is still under development... This study can be used independently, or you can find this study in use on the [FGMR](/FGMR/FGMR.md) page. See that page for a lot of info on how to configure studies in thinkorswim. 14 | 15 | [VIX_FGMR](/VIX_FGMR/VIX_FGMR.txt) 16 | 17 | Per the aformentioned work from [@kerberos007](https://twitter.com/kerberos007) 18 | 19 | Calls 20 | go long VIX calls when %B(20,1.5) crosses > 0 21 | cover VIX calls when %B(20,1.5) crosses > 100 22 | 23 | Puts 24 | go long VIX puts when %B(20,1.2) crosses < 100 25 | cover VIX puts when %B(20,2) crosses < 0 26 | 27 | A *Study* will fire many times more than its corresponding *Strategy*. This is also good for developing a new strategy, so you can eyeball when various conditions happen and you get your aha moment. 28 | 29 | ## post script ## 30 | 31 | These studies may or may not work on other symbols. With modifications to the parameters, maybe they work better for Gold than the Euro. Welcome to technical analysis and your journey down the rabbit hole. 32 | 33 | ## feedback welcome ## 34 | 35 | Have a suggestion? Found an issue? Reach out to me on twitter, my DM is open to all. If you are a github user, file an issue or make a suggested change and PR to this repo. 36 | 37 | 38 | --- 39 | back to [README.md](/README.md) -------------------------------------------------------------------------------- /FGMR_ADVANCED/FGMR_ADVANCED.md: -------------------------------------------------------------------------------- 1 | # Fear & Greed Mean Reversion Advanced Strategy (FGMR_ADVANCED) # 2 | 3 | FGMR Advananced is an refactored, updated and combined strategy and study that lets you input settings to tune FGMR for a given symbol. You can use FGMR Advanced to replace the original SPX/VIX/SOX studies below. See the other pages here for how the strategy works. 4 | 5 | Attribution: This is a long/short strategy based on the work of [@kerberos007](https://twitter.com/kerberos007). If you look at his feed, you will see lots of work regarding this strategy using Bollinger Bands, Percent B (%B), and some initial parameters that give good back testing results. 6 | 7 | As with any strategy, you should understand it, tweak it to your own risk profile, and extend it to incorporate other indicators and strategies. 8 | 9 | Alternatively, just buy or sell the glitch! 10 | 11 | ## A picture is worth a thousand words, FGMR on SPX/VIX/SOX ## 12 | 13 | ![FGMR_ADVANCED](FGMR_ADVANCED.png "FGMR_ADVANCED") 14 | 15 | You can load this Flexible Grid into your TOS by using Setup | Open Shared Item and pasting in this link: http://tos.mx/fkoZb7i 16 | 17 | ## CODE ## 18 | 19 | [FGMR_ADVANCED_Strategy](/FGMR_ADVANCED/FGMR_ADVANCED_Strategy.txt) 20 | 21 | [FGMR_ADVANCED_Study](/FGMR_ADVANCED/FGMR_ADVANCED_Study.txt) 22 | 23 | I name my studies with my initials to make them easy to find. The arrow shows you where the find the "Global strategy settings...". Using a default trade size of 50 in your "Global strategy settings..." will make the strategy correspond to the dollar value of 1 ES contract. 24 | 25 | ## post script ## 26 | 27 | These studies may or may not work on other symbols. With modifications to the parameters, maybe they work better for Gold than the Euro. Welcome to technical analysis and your journey down the rabbit hole. 28 | 29 | ## feedback welcome ## 30 | 31 | Have a suggestion? Found an issue? Reach out to me on twitter, my DM is open to all. If you are a github user, file an issue or make a suggested change and PR to this repo. 32 | 33 | 34 | --- 35 | back to [README.md](/README.md) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # technical-analysis 2 | Repository for technical analysis scripts, code, algorithms related to stocks, futures, options, and more. Follow me here and on twitter [@korygill.](https://twitter.com/korygill) 3 | 4 | Bookmark this page. It contains links to all other content, which may be reorganized at anytime. 5 | 6 | # Sierra Chart strategies and studies # 7 | 8 | [SIERRA_CHART](/SIERRA_CHART/SIERRA_CHART.md) 9 | 10 | # thinkorswim / thinkscript strategies and studies # 11 | 12 | ## Fear & Greed Mean Reversion Advanced Strategy (FGMR_ADVANCED) ## 13 | 14 | [FGMR_ADVANCED](/FGMR_ADVANCED/FGMR_ADVANCED.md) 15 | 16 | FGMR Advanced is an refactored, updated and combined strategy and study that lets you input settings to tune FGMR for a given symbol. You can use FGMR Advanced to replace the original SPX/VIX/SOX studies below. See the other pages here for how the strategy works. 17 | 18 | Attribution: This is a long/short strategy based on the work of [@kerberos007](https://twitter.com/kerberos007). If you look at his feed, you will see lots of work regarding this strategy using Bollinger Bands, Percent B (%B), and some initial parameters that give good back testing results. 19 | 20 | ## $SPX Fear & Greed Mean Reversion Strategy (FGMR) ## 21 | 22 | [FGMR](/FGMR/FGMR.md) 23 | 24 | This is a long/short strategy based on the work of [@kerberos007](https://twitter.com/kerberos007). If you look at his feed, you will see lots of work regarding this strategy using Bollinger Bands, Percent B (%B), and some initial parameters that give good back testing results. 25 | 26 | ## $VIX Fear & Greed Mean Reversion Strategy (VIX_FGMR) ## 27 | 28 | [VIX_FGMR](/VIX_FGMR/VIX_FGMR.md) 29 | 30 | This is a long/short strategy based on the work of [@kerberos007](https://twitter.com/kerberos007). If you look at his feed, you will see lots of work regarding this strategy using Bollinger Bands, Percent B (%B), and some initial parameters that give good back testing results. 31 | 32 | ## $SOX Fear & Greed Mean Reversion Strategy (SOX_FGMR) ## 33 | 34 | [SOX_FGMR](/SOX_FGMR/SOX_FGMR.md) 35 | 36 | This is a long-only strategy based on the work of [@kerberos007](https://twitter.com/kerberos007). If you look at his feed, you will see lots of work regarding this strategy using Bollinger Bands, Percent B (%B), and some initial parameters that give good back testing results. 37 | 38 | # PowerShell Scripts 39 | 40 | [PowerShell Scripts](/PowerShell/PowerShell.md) 41 | -------------------------------------------------------------------------------- /FGMR/FGMR_Strat.txt: -------------------------------------------------------------------------------- 1 | # 2 | # $SPX Fear & Greed Mean Reversion Strategy (FGMR_Strat) 3 | # 4 | # This script adapted from posts from @kerberos007 5 | # https://twitter.com/kerberos007 6 | # 7 | # Want the latest version of this script? 8 | # https://github.com/korygill/technical-analysis 9 | # 10 | # Use on thinkorswim and thinkscript 11 | # author @korygill 12 | # 13 | 14 | script GetBollingerBandPercent 15 | { 16 | input price = close; 17 | input upper = 2; 18 | input lower = -2; 19 | input averageType = AverageType.SIMPLE; 20 | input displace = 0; 21 | input length = 20; 22 | 23 | def upperBand = BollingerBands(price, displace, length, lower, upper, averageType).UpperBand; 24 | def lowerBand = BollingerBands(price, displace, length, lower, upper, averageType).LowerBand; 25 | 26 | plot BBPercent = (price - lowerBand) / (upperBand - lowerBand) * 100; 27 | } 28 | 29 | input averageType = AverageType.SIMPLE; 30 | input price = close; 31 | input displace = 0; 32 | input length = 20; 33 | input StdDev_DnBuy = -2.0; 34 | input StdDev_UpBuy = 2.0; 35 | input StdDev_DnSell = -1.0; 36 | input StdDev_UpSell = 1.0; 37 | input LongShortBoth = {Long, Short, default Both}; 38 | 39 | def PercentBBuy = GetBollingerBandPercent(price, StdDev_UpBuy, StdDev_DnBuy); 40 | 41 | def PercentBSell = GetBollingerBandPercent(price, StdDev_UpSell, StdDev_DnSell); 42 | 43 | def ZeroLine = 0; 44 | def HalfLine = 50; 45 | def UnitLine = 100; 46 | 47 | def lsb; 48 | switch (LongShortBoth) 49 | { 50 | case Long: lsb = 0; 51 | case Short: lsb = 1; 52 | default: lsb = 2; 53 | } 54 | 55 | # LONG 56 | AddOrder(OrderType.BUY_TO_OPEN, 57 | Crosses(PercentBBuy, ZeroLine, CrossingDirection.ABOVE) and lsb != 1, 58 | tickColor = COLOR.WHITE, arrowColor = COLOR.GREEN 59 | ); 60 | 61 | AddOrder(OrderType.SELL_TO_CLOSE, 62 | Crosses(PercentBSell, UnitLine, CrossingDirection.ABOVE) and lsb != 1, 63 | tickColor = COLOR.WHITE, arrowColor = COLOR.RED 64 | ); 65 | 66 | # SHORT 67 | AddOrder(OrderType.SELL_TO_OPEN, 68 | Crosses(PercentBBuy, UnitLine, CrossingDirection.BELOW) and lsb != 0, 69 | tickColor = COLOR.WHITE, arrowColor = COLOR.YELLOW 70 | ); 71 | 72 | AddOrder(OrderType.BUY_TO_CLOSE, 73 | Crosses(PercentBSell, ZeroLine, CrossingDirection.BELOW) and lsb != 0, 74 | tickColor = COLOR.WHITE, arrowColor = COLOR.MAGENTA 75 | ); 76 | 77 | AddLabel(yes, "Go Long", COLOR.GREEN); 78 | AddLabel(yes, "Cover Long", COLOR.RED); 79 | AddLabel(yes, "Go Short", COLOR.YELLOW); 80 | AddLabel(yes, "Cover Short", COLOR.MAGENTA); 81 | -------------------------------------------------------------------------------- /SOX_FGMR/SOX_FGMR_Strat.txt: -------------------------------------------------------------------------------- 1 | # 2 | # $SOX Fear & Greed Mean Reversion Study (SOX_FGMR) 3 | # 4 | # This script adapted from posts from @kerberos007 5 | # https://twitter.com/kerberos007 6 | # 7 | # Want the latest version of this script? 8 | # https://github.com/korygill/technical-analysis 9 | # 10 | # Use on thinkorswim and thinkscript 11 | # author @korygill 12 | # 13 | 14 | script GetBollingerBandPercent 15 | { 16 | input price = close; 17 | input upper = 2; 18 | input lower = 2; 19 | input averageType = AverageType.SIMPLE; 20 | input displace = 0; 21 | input length = 20; 22 | 23 | def upperBand = BollingerBands(price, displace, length, lower, upper, averageType).UpperBand; 24 | def lowerBand = BollingerBands(price, displace, length, lower, upper, averageType).LowerBand; 25 | 26 | plot BBPercent = (price - lowerBand) / (upperBand - lowerBand) * 100; 27 | } 28 | 29 | input StdDev_DnBuy = -2.5; 30 | input StdDev_UpBuy = 2.5; 31 | input StdDev_DnSell = -1; 32 | input StdDev_UpSell = 1; 33 | input BuyCross = 5; 34 | input SellCross = 95; 35 | input LongShortBoth = {Long, Short, default Both}; 36 | input length = 20; 37 | def price = close; 38 | def averageType = AverageType.SIMPLE; 39 | def displace = 0; 40 | 41 | def PercentBBuy = GetBollingerBandPercent(price, StdDev_UpBuy, StdDev_DnBuy, length = length); 42 | 43 | def PercentBSell = GetBollingerBandPercent(price, StdDev_UpSell, StdDev_DnSell, length = length); 44 | 45 | def ZeroLine = 0; 46 | def HalfLine = 50; 47 | def UnitLine = 100; 48 | 49 | def lsb; 50 | switch (LongShortBoth) 51 | { 52 | case Long: 53 | lsb = 0; 54 | case Short: 55 | lsb = 1; 56 | default: 57 | lsb = 2; 58 | } 59 | 60 | # LONG 61 | AddOrder(OrderType.BUY_TO_OPEN, Crosses(PercentBBuy, BuyCross, CrossingDirection.ABOVE) and lsb != 1, tickcolor = Color.WHITE, arrowcolor = Color.GREEN, name = "XOS"); 62 | 63 | AddOrder(OrderType.SELL_TO_CLOSE, Crosses(PercentBSell, SellCross, CrossingDirection.ABOVE) and lsb != 1, tickcolor = Color.WHITE, arrowcolor = Color.RED, name = "XOS"); 64 | 65 | # SHORT 66 | AddOrder(OrderType.SELL_TO_OPEN, Crosses(PercentBBuy, UnitLine, CrossingDirection.BELOW) and lsb != 0, tickcolor = Color.WHITE, arrowcolor = Color.YELLOW, name = "XOS"); 67 | 68 | AddOrder(OrderType.BUY_TO_CLOSE, Crosses(PercentBSell, ZeroLine, CrossingDirection.BELOW) and lsb != 0, tickcolor = Color.WHITE, arrowcolor = Color.MAGENTA, name = "XOS"); 69 | 70 | AddLabel(yes, "[SOX:FGMR](1d)", Color.GRAY); 71 | AddLabel(yes, "Go Long", Color.GREEN); 72 | AddLabel(yes, "Cover Long", Color.RED); 73 | AddLabel(yes, "Go Short", Color.YELLOW); 74 | AddLabel(yes, "Cover Short", Color.MAGENTA); -------------------------------------------------------------------------------- /VIX_FGMR/VIX_FGMR.txt: -------------------------------------------------------------------------------- 1 | # 2 | # $VIX Fear & Greed Mean Reversion Study (VIX_FGMR) 3 | # 4 | # This script adapted from posts from @kerberos007 5 | # https://twitter.com/kerberos007 6 | # 7 | # Want the latest version of this script? 8 | # https://github.com/korygill/technical-analysis 9 | # 10 | # Use on thinkorswim and thinkscript 11 | # author @korygill 12 | # 13 | 14 | script GetBollingerBandPercent 15 | { 16 | input price = close; 17 | input upper = 2; 18 | input lower = -2; 19 | input averageType = AverageType.SIMPLE; 20 | input displace = 0; 21 | input length = 20; 22 | 23 | def upperBand = BollingerBands(price, displace, length, lower, upper, averageType).UpperBand; 24 | def lowerBand = BollingerBands(price, displace, length, lower, upper, averageType).LowerBand; 25 | 26 | plot BBPercent = (price - lowerBand) / (upperBand - lowerBand) * 100; 27 | } 28 | 29 | declare lower; 30 | 31 | input sym = "VIX"; 32 | def price = close(sym); 33 | input averageType = AverageType.SIMPLE; 34 | input displace = 0; 35 | input length = 20; 36 | input signalType = {default CALL, PUT}; 37 | 38 | plot PB20 = GetBollingerBandPercent(price, 2.0, -2.0); 39 | plot PB15 = GetBollingerBandPercent(price, 1.5, -1.5); 40 | plot PB12 = GetBollingerBandPercent(price, 1.2, -1.2); 41 | plot PB10 = GetBollingerBandPercent(price, 1.0, -1.0); 42 | #plot symPlot = price; 43 | 44 | plot ZeroLine = 0; 45 | plot HalfLine = 50; 46 | plot UnitLine = 100; 47 | ZeroLine.SetDefaultColor(Color.GREEN); 48 | HalfLine.SetDefaultColor(GetColor(8)); 49 | UnitLine.SetDefaultColor(Color.RED); 50 | 51 | def callput; 52 | switch (signalType) 53 | { 54 | case CALL: 55 | callput = 1; 56 | default: 57 | callput = 0; 58 | } 59 | 60 | # ----------------- 61 | AddVerticalLine( 62 | Crosses(PB20, ZeroLine, CrossingDirection.BELOW) and callput == 0, 63 | "--- (OS - Cover Puts) ---", Color.MAGENTA, curve.SHORT_DASH 64 | ); 65 | 66 | AddVerticalLine( 67 | Crosses(PB12, UnitLine, CrossingDirection.BELOW) and callput == 0, 68 | "--- (OB - Buy Puts) ---", Color.YELLOW, curve.SHORT_DASH 69 | ); 70 | 71 | # ----------------- 72 | AddVerticalLine( 73 | Crosses(PB15, ZeroLine, CrossingDirection.ABOVE) and callput == 1, 74 | "+++ OS - Buy Calls +++", Color.GREEN, curve.SHORT_DASH 75 | ); 76 | 77 | AddVerticalLine( 78 | Crosses(PB15, UnitLine, CrossingDirection.ABOVE) and callput == 1, 79 | "+++ OB - Cover Calls +++", Color.RED, curve.SHORT_DASH 80 | ); 81 | 82 | AddLabel(yes, sym, COLOR.CYAN); 83 | AddLabel(yes, signalType, COLOR.YELLOW); 84 | PB20.SetdefaultColor(GetColor(0)); 85 | PB15.SetdefaultColor(GetColor(1)); 86 | PB12.SetdefaultColor(GetColor(2)); 87 | PB10.SetdefaultColor(GetColor(3)); 88 | AddLabel(yes, "%BB20: "+PB20, GetColor(0)); 89 | AddLabel(yes, "%BB15: "+PB15, GetColor(1)); 90 | AddLabel(yes, "%BB12: "+PB12, GetColor(2)); 91 | AddLabel(yes, "%BB10: "+PB10, GetColor(3)); 92 | -------------------------------------------------------------------------------- /FGMR/FGMR.txt: -------------------------------------------------------------------------------- 1 | # 2 | # $SPX Fear & Greed Mean Reversion Study (FGMR) 3 | # 4 | # This script adapted from posts from @kerberos007 5 | # https://twitter.com/kerberos007 6 | # 7 | # Want the latest version of this script? 8 | # https://github.com/korygill/technical-analysis 9 | # 10 | # Use on thinkorswim and thinkscript 11 | # author @korygill 12 | # 13 | 14 | script GetBollingerBandPercent 15 | { 16 | input price = close; 17 | input upper = 2; 18 | input lower = -2; 19 | input averageType = AverageType.SIMPLE; 20 | input displace = 0; 21 | input length = 20; 22 | 23 | def upperBand = BollingerBands(price, displace, length, lower, upper, averageType).UpperBand; 24 | def lowerBand = BollingerBands(price, displace, length, lower, upper, averageType).LowerBand; 25 | 26 | plot BBPercent = (price - lowerBand) / (upperBand - lowerBand) * 100; 27 | } 28 | 29 | declare lower; 30 | 31 | input averageType = AverageType.Simple; 32 | input price = close; 33 | input displace = 0; 34 | input length = 20; 35 | input StdDev_DnBuy = -2.0; 36 | input StdDev_UpBuy = 2.0; 37 | input StdDev_DnSell = -1.0; 38 | input StdDev_UpSell = 1.0; 39 | 40 | plot PercentBBuy = GetBollingerBandPercent(price, StdDev_UpBuy, StdDev_DnBuy); 41 | plot PercentBSell = GetBollingerBandPercent(price, StdDev_UpSell, StdDev_DnSell); 42 | 43 | plot ZeroLine = 0; 44 | plot HalfLine = 50; 45 | plot UnitLine = 100; 46 | 47 | def vixPrice = close("VIX"); 48 | def vixPercentBBuy = GetBollingerBandPercent(vixPrice, StdDev_UpBuy, StdDev_DnBuy); 49 | def vixPercentBSell = GetBollingerBandPercent(vixPrice, StdDev_UpSell, StdDev_DnSell); 50 | 51 | 52 | 53 | def opacity = 25; 54 | def linewidth = 1; 55 | 56 | PercentBBuy.SetDefaultColor(Color.GREEN);#(GetColor(3)); 57 | PercentBBuy.AssignValueColor(CreateColor( 58 | 0, 59 | 255, #255-Max(0,Min(100-opacity,PercentBBuy))*2.55, 60 | 0)); 61 | PercentBBuy.SetPaintingStrategy(PaintingStrategy.LINE); 62 | PercentBBuy.SetLineWeight(linewidth); 63 | 64 | PercentBSell.SetDefaultColor(Color.RED);#(GetColor(7)); 65 | PercentBSell.AssignValueColor(CreateColor( 66 | 255, #Max(opacity,Min(100,PercentBSell))*2.55, 67 | 0, 68 | 0)); 69 | PercentBSell.SetPaintingStrategy(PaintingStrategy.LINE); 70 | PercentBSell.SetLineWeight(linewidth); 71 | 72 | ZeroLine.SetDefaultColor(Color.GREEN); 73 | HalfLine.SetDefaultColor(GetColor(8)); 74 | UnitLine.SetDefaultColor(Color.RED); 75 | 76 | # LONG 77 | AddVerticalLine( 78 | Crosses(PercentBBuy, ZeroLine, CrossingDirection.ABOVE), 79 | "+++ Go Long +++", Color.GREEN, curve.SHORT_DASH 80 | ); 81 | 82 | AddVerticalLine( 83 | Crosses(PercentBSell, UnitLine, CrossingDirection.ABOVE), 84 | "+++ Cover Long +++", Color.RED, curve.SHORT_DASH 85 | ); 86 | 87 | # SHORT 88 | AddVerticalLine( 89 | Crosses(PercentBBuy, UnitLine, CrossingDirection.BELOW), 90 | "--- (Go Short) ---", Color.YELLOW, curve.SHORT_DASH 91 | ); 92 | 93 | AddVerticalLine( 94 | Crosses(PercentBSell, ZeroLine, CrossingDirection.BELOW), 95 | "--- (Cover Short) ---", Color.MAGENTA, curve.SHORT_DASH 96 | ); 97 | 98 | 99 | #AddVerticalLine( 100 | # GetDayofWeek(GetYYYYMMDD()) == 5, 101 | # "Friday", Color.LIGHT_GRAY, curve.MEDIUM_DASH 102 | #); 103 | 104 | AddLabel(yes, GetSymbol(), COLOR.CYAN); 105 | AddLabel(yes, "Long=Green cross > 0, Cover=Red cross > 100", COLOR.GREEN); 106 | AddLabel(yes, "Short=Red cross < 100, Cover=Green cross < 0", COLOR.RED); 107 | -------------------------------------------------------------------------------- /FGMR_ADVANCED/FGMR_ADVANCED_Strategy.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Fear & Greed Mean Reversion Strategy (FGMR_ADVANCED_Strategy) 3 | # 4 | # This script adapted from posts from @kerberos007 5 | # https://twitter.com/kerberos007 6 | # 7 | # Want the latest version of this script? 8 | # https://github.com/korygill/technical-analysis 9 | # 10 | # Use on thinkorswim and thinkscript 11 | # author @korygill 12 | # 13 | 14 | script GetBollingerBandPercent 15 | { 16 | input price = close; 17 | input upper = 2; 18 | input lower = 2; 19 | input averageType = AverageType.SIMPLE; 20 | input displace = 0; 21 | input length = 20; 22 | 23 | def upperBand = BollingerBands(price, displace, length, lower, upper, averageType).UpperBand; 24 | def lowerBand = BollingerBands(price, displace, length, lower, upper, averageType).LowerBand; 25 | 26 | plot BBPercent = (price - lowerBand) / (upperBand - lowerBand) * 100; 27 | } 28 | 29 | def price = close; 30 | input averageType = AverageType.SIMPLE; 31 | input displace = 0; 32 | input length = 20; 33 | input signalType = {default BOTH, LONG, SHORT}; 34 | input BO = {PB25, default PB20, PB15, PB12, PB10}; 35 | input SC = {PB25, default PB20, PB15, PB12, PB10}; 36 | input SO = {PB25, default PB20, PB15, PB12, PB10}; 37 | input BC = {PB25, default PB20, PB15, PB12, PB10}; 38 | input BaseLine = 0; 39 | input HalfLine = 50; 40 | input UnitLine = 100; 41 | 42 | def PB25 = GetBollingerBandPercent(price, 2.5, -2.5); 43 | def PB20 = GetBollingerBandPercent(price, 2.0, -2.0); 44 | def PB15 = GetBollingerBandPercent(price, 1.5, -1.5); 45 | def PB12 = GetBollingerBandPercent(price, 1.2, -1.2); 46 | def PB10 = GetBollingerBandPercent(price, 1.0, -1.0); 47 | 48 | def tradeSize = 1; 49 | 50 | def BO_PB = if BO == BO.PB10 then PB10 51 | else if BO == BO.PB12 then PB12 52 | else if BO == BO.PB15 then PB15 53 | else if BO == BO.PB25 then PB25 54 | else PB20; 55 | def SC_PB = if SC == SC.PB10 then PB10 56 | else if SC == SC.PB12 then PB12 57 | else if SC == SC.PB15 then PB15 58 | else if SC == SC.PB25 then PB25 59 | else PB20; 60 | def SO_PB = if SO == SO.PB10 then PB10 61 | else if SO == SO.PB12 then PB12 62 | else if SO == SO.PB15 then PB15 63 | else if SO == SO.PB25 then PB25 64 | else PB20; 65 | def BC_PB = if BC == BC.PB10 then PB10 66 | else if BC == BC.PB12 then PB12 67 | else if BC == BC.PB15 then PB15 68 | else if BC == BC.PB25 then PB25 69 | else PB20; 70 | 71 | # LONG ----------------- 72 | AddOrder(OrderType.BUY_TO_OPEN, 73 | Crosses(BO_PB, BaseLine, CrossingDirection.ABOVE) and signalType != signalType.SHORT, 74 | tradeSize = tradeSize, 75 | tickcolor = Color.WHITE, arrowcolor = Color.GREEN, name = "FGMR" 76 | ); 77 | 78 | AddOrder(OrderType.SELL_TO_CLOSE, 79 | Crosses(SC_PB, UnitLine, CrossingDirection.ABOVE) and signalType != signalType.SHORT, 80 | tradeSize = tradeSize, 81 | tickcolor = Color.WHITE, arrowcolor = Color.RED, name = "FGMR" 82 | ); 83 | 84 | # SHORT ----------------- 85 | AddOrder(OrderType.SELL_TO_OPEN, 86 | Crosses(SO_PB, UnitLine, CrossingDirection.BELOW) and signalType != signalType.LONG, 87 | tradeSize = tradeSize, 88 | tickcolor = Color.WHITE, arrowcolor = Color.YELLOW, name = "FGMR" 89 | ); 90 | 91 | AddOrder(OrderType.BUY_TO_CLOSE, 92 | Crosses(BC_PB, BaseLine, CrossingDirection.BELOW) and signalType != signalType.LONG, 93 | tradeSize = tradeSize, 94 | tickcolor = Color.WHITE, arrowcolor = Color.MAGENTA, name = "FGMR" 95 | ); 96 | 97 | AddLabel(yes, "[FGMR_Advanced]", Color.GRAY); 98 | 99 | AddLabel(yes, GetSymbol(), COLOR.CYAN); 100 | AddLabel(yes, "Long="+BO+" cross > "+BaseLine+", Cover="+SC+" cross > "+UnitLine, COLOR.GREEN); 101 | AddLabel(yes, "Short="+SO+" cross < "+UnitLine+", Cover="+BC+" cross < "+BaseLine, COLOR.RED); 102 | AddLabel(yes, "Go Long", Color.GREEN); 103 | AddLabel(yes, "Cover Long", Color.RED); 104 | AddLabel(yes, "Go Short", Color.YELLOW); 105 | AddLabel(yes, "Cover Short", Color.MAGENTA); 106 | -------------------------------------------------------------------------------- /FGMR/FGMR.md: -------------------------------------------------------------------------------- 1 | # $SPX Fear & Greed Mean Reversion Strategy (FGMR) # 2 | 3 | This is a long/short strategy based on the work of [@kerberos007](https://twitter.com/kerberos007). If you look at his feed, you will see lots of work regarding this strategy using Bollinger Bands, Percent B (%B), and some initial parameters that give good back testing results. 4 | 5 | As with any strategy, you should understand it, tweak it to your own risk profile, and extend it to incorporate other indicators and strategies. 6 | 7 | Alternatively, just buy or sell the glitch! 8 | 9 | ## A picture is worth a thousand words, FGMR on SPX ## 10 | 11 | ![spx-strategy-and-study](spx-strategy-and-study.png "spx-strategy-and-study") 12 | 13 | ### Legend ### 14 | 15 | 1 SPX 1D chart with FGMR Strategy 16 | 2 FGMR Study 17 | 3 VIX_FGMR Study for Calls 18 | 4 VIX_FGMR Study for Puts 19 | 5 Floating P&L for the strategy 20 | 21 | Green, go long, buy calls 22 | Red, cover long, cover calls 23 | Yellow, go short, buy puts 24 | Magenta, cover short, cover calls 25 | 26 | 27 | What is the #2 study doing? Per the aformentioned work from [@kerberos007](https://twitter.com/kerberos007) 28 | 29 | go long when %B(20,1) crosses > 0 30 | cover long when %B(20,2) crosses > 100 31 | go short when %B(20,2) crosses < 100 32 | cover short when %B(20,1) crosses < 0 33 | 34 | A *Study* will fire many times more than its corresponding *Strategy*. This is also good for developing a new strategy, so you can eyeball when various conditions happen and you get your aha moment. 35 | 36 | The #1 strategy is the strategy version of the #2 study. 37 | 38 | The #3 and #4 studies are a variant of the %B indicators used in FGMR. These are not incorporated into the strategy (at least yet). You can use the VIX_FGMR Study for trading the VIX. Check out [VIX_FGMR](/VIX_FGMR/VIX_FGMR.md) for details. 39 | 40 | When #3 shows VIX %B overbought and SPX %B is oversold, there's a good chance for bottom in the SPX. 41 | 42 | Similarly, when #4 shows VIX %B oversold and SPX %B is overbought, there's a good chance for top in the SPX. 43 | 44 | ## Strategy and Study Development ## 45 | 46 | The thinkscript code for the strategies and studies are below. They are saved as txt files so they can be opened easily. You will need to create a new study or strategy in thinkorswim and copy/paste them in. 47 | 48 | [FGMR_Strat](/FGMR/FGMR_Strat.txt) 49 | 50 | [FGMR](/FGMR/FGMR.txt) 51 | 52 | [VIX_FGMR](/VIX_FGMR/VIX_FGMR.txt) 53 | 54 | 55 | From the Studies menu on your chart, choose "Edit studies..." and get the following dialog. Configure as shown, and you should have a screen that matches the screen at the top of this page. 56 | 57 | ![edit-studies-and-strategies-dialog](edit-studies-and-strategies-dialog.png "edit-studies-and-strategies-dialog") 58 | 59 | I name my studies with my initials to make them easy to find. The arrow shows you where the find the "Global strategy settings...". Using a default trade size of 50 in your "Global strategy settings..." will make the strategy correspond to the dollar value of 1 ES contract. 60 | 61 | ## Results: Show Report ## 62 | 63 | I loaded a 10 year, 1 day chart of SPX, and generated the following report. You can export to csv file for further analysis. You can use excel, python, or PowerShell to further process the data for import stats. To get the report, right-click any trade in the Strategy screen, and choose "Show report". 64 | 65 | ![strategy-report](strategy-report.png "strategy-report") 66 | 67 | Here's the csv file I exported from my study: [FGMR-StrategyReports-SPX.csv](/FGMR/FGMR-StrategyReports-SPX.csv) 68 | 69 | 70 | Check out [Trading System Special: Testing Your Strategy](https://tickertape.tdameritrade.com/trading/trading-system-special-testing-your-strategy-15192) for some starting ideas. 71 | 72 | ## post script ## 73 | 74 | These studies may or may not work on other symbols. With modifications to the parameters, maybe they work better for Gold than the Euro. Welcome to technical analysis and your journey down the rabbit hole. 75 | 76 | ## feedback welcome ## 77 | 78 | Have a suggestion? Found an issue? Reach out to me on twitter, my DM is open to all. If you are a github user, file an issue or make a suggested change and PR to this repo. 79 | 80 | 81 | --- 82 | back to [README.md](/README.md) -------------------------------------------------------------------------------- /FGMR_ADVANCED/FGMR_ADVANCED_Study.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Fear & Greed Mean Reversion Study (FGMR_ADVANCED_Study) 3 | # 4 | # This script adapted from posts from @kerberos007 5 | # https://twitter.com/kerberos007 6 | # 7 | # Want the latest version of this script? 8 | # https://github.com/korygill/technical-analysis 9 | # 10 | # Use on thinkorswim and thinkscript 11 | # author @korygill 12 | # 13 | 14 | script GetBollingerBandPercent 15 | { 16 | input price = close; 17 | input upper = 2; 18 | input lower = 2; 19 | input averageType = AverageType.SIMPLE; 20 | input displace = 0; 21 | input length = 20; 22 | 23 | def upperBand = BollingerBands(price, displace, length, lower, upper, averageType).UpperBand; 24 | def lowerBand = BollingerBands(price, displace, length, lower, upper, averageType).LowerBand; 25 | 26 | plot BBPercent = (price - lowerBand) / (upperBand - lowerBand) * 100; 27 | } 28 | 29 | declare lower; 30 | 31 | input sym = "VIX"; 32 | def price = close(sym); 33 | input averageType = AverageType.SIMPLE; 34 | input displace = 0; 35 | input length = 20; 36 | input signalType = {default BOTH, LONG, SHORT}; 37 | input BO = {PB25, default PB20, PB15, PB12, PB10}; 38 | input SC = {PB25, default PB20, PB15, PB12, PB10}; 39 | input SO = {PB25, default PB20, PB15, PB12, PB10}; 40 | input BC = {PB25, default PB20, PB15, PB12, PB10}; 41 | input BaseLine = 0; 42 | input HalfLine = 50; 43 | input UnitLine = 100; 44 | 45 | plot PB25 = GetBollingerBandPercent(price, 2.5, -2.5); 46 | plot PB20 = GetBollingerBandPercent(price, 2.0, -2.0); 47 | plot PB15 = GetBollingerBandPercent(price, 1.5, -1.5); 48 | plot PB12 = GetBollingerBandPercent(price, 1.2, -1.2); 49 | plot PB10 = GetBollingerBandPercent(price, 1.0, -1.0); 50 | PB25.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES); 51 | PB20.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES); 52 | PB15.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES); 53 | PB12.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES); 54 | PB10.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES); 55 | PB25.HideBubble(); 56 | PB20.HideBubble(); 57 | PB15.HideBubble(); 58 | PB12.HideBubble(); 59 | PB10.HideBubble(); 60 | 61 | plot pZeroLine = BaseLine; 62 | plot pHalfLine = HalfLine; 63 | plot pUnitLine = UnitLine; 64 | pZeroLine.SetDefaultColor(Color.GREEN); 65 | pHalfLine.SetDefaultColor(GetColor(8)); 66 | pUnitLine.SetDefaultColor(Color.RED); 67 | 68 | def BO_PB = if BO == BO.PB10 then PB10 69 | else if BO == BO.PB12 then PB12 70 | else if BO == BO.PB15 then PB15 71 | else if BO == BO.PB25 then PB25 72 | else PB20; 73 | def SC_PB = if SC == SC.PB10 then PB10 74 | else if SC == SC.PB12 then PB12 75 | else if SC == SC.PB15 then PB15 76 | else if SC == SC.PB25 then PB25 77 | else PB20; 78 | def SO_PB = if SO == SO.PB10 then PB10 79 | else if SO == SO.PB12 then PB12 80 | else if SO == SO.PB15 then PB15 81 | else if SO == SO.PB25 then PB25 82 | else PB20; 83 | def BC_PB = if BC == BC.PB10 then PB10 84 | else if BC == BC.PB12 then PB12 85 | else if BC == BC.PB15 then PB15 86 | else if BC == BC.PB25 then PB25 87 | else PB20; 88 | # LONG ----------------- 89 | AddVerticalLine( 90 | Crosses(BO_PB, BaseLine, CrossingDirection.ABOVE) and signalType != signalType.SHORT, 91 | "+++ OS - Buy To Open +++", Color.GREEN, curve.SHORT_DASH 92 | ); 93 | 94 | AddVerticalLine( 95 | Crosses(SC_PB, UnitLine, CrossingDirection.ABOVE) and signalType != signalType.SHORT, 96 | "+++ OB - Sell To Close +++", Color.RED, curve.SHORT_DASH 97 | ); 98 | 99 | # SHORT ----------------- 100 | AddVerticalLine( 101 | Crosses(SO_PB, UnitLine, CrossingDirection.BELOW) and signalType != signalType.LONG, 102 | "--- (OB - Sell to Open) ---", Color.YELLOW, curve.SHORT_DASH 103 | ); 104 | 105 | AddVerticalLine( 106 | Crosses(BC_PB, BaseLine, CrossingDirection.BELOW) and signalType != signalType.LONG, 107 | "--- (OS - Buy To Close) ---", Color.MAGENTA, curve.SHORT_DASH 108 | ); 109 | 110 | AddLabel(yes, sym, COLOR.CYAN); 111 | AddLabel(yes, signalType, COLOR.YELLOW); 112 | PB25.SetdefaultColor(GetColor(4)); 113 | PB20.SetdefaultColor(GetColor(0)); 114 | PB15.SetdefaultColor(GetColor(1)); 115 | PB12.SetdefaultColor(GetColor(2)); 116 | PB10.SetdefaultColor(GetColor(3)); 117 | AddLabel(yes, "%BB25: "+PB25, GetColor(4)); 118 | AddLabel(yes, "%BB20: "+PB20, GetColor(0)); 119 | AddLabel(yes, "%BB15: "+PB15, GetColor(1)); 120 | AddLabel(yes, "%BB12: "+PB12, GetColor(2)); 121 | AddLabel(yes, "%BB10: "+PB10, GetColor(3)); 122 | -------------------------------------------------------------------------------- /PowerShell/Get-StrategyReportCsvStatistics.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | .SYNOPSIS 3 | Output statistics from a thinkorswim strategy file exported as csv. 4 | 5 | .PARAMETER File 6 | Name or of csv file to process. 7 | 8 | .PARAMETER ShowFileContents 9 | If true, will output the contents of the csv file and calculated properties. 10 | 11 | .NOTES 12 | Author Kory Gill, @korygill 13 | 14 | .LINK 15 | https://github.com/korygill/technical-analysis 16 | #> 17 | 18 | [CmdletBinding()] 19 | param ( 20 | [string] 21 | $File = 'D:\temp\StrategyReports_SPX_GapWithStop.csv', 22 | 23 | [switch] 24 | $ShowFileContents 25 | ) 26 | 27 | # 28 | # functions 29 | # 30 | function Convert-CurrencyStringToDecimal ([string]$input) 31 | { 32 | ((($input -replace '\$') -replace '[)]') -replace '\(', '-') -replace '[^-0-9.]' 33 | } 34 | 35 | function Add-Statistic ([string]$statistic, [double]$data) 36 | { 37 | $dbl = [math]::Round($data, 2) 38 | $dblStr = "{0:N2}" -f $dbl 39 | 40 | #Write-Information "$statistic $dblStr" 41 | 42 | $null = $outData.Add( 43 | [PSCustomObject]@{ 44 | 'Statistic'=$statistic 45 | 'DblData'=$dbl 46 | 'Data'=$dblStr 47 | } 48 | ) 49 | } 50 | 51 | function Write-Header 52 | { 53 | Write-Output "$("="*78)" 54 | } 55 | 56 | 57 | # 58 | # start of main script 59 | # 60 | 61 | # Makes debugging from ISE easier. 62 | if ($PSScriptRoot -eq "") 63 | { 64 | $root = Split-Path -Parent $psISE.CurrentFile.FullPath 65 | } 66 | else 67 | { 68 | $root = $PSScriptRoot 69 | } 70 | 71 | Set-Location $root 72 | 73 | if (-not (Test-Path $File)) 74 | { 75 | throw "Cannot open file '$File'." 76 | } 77 | 78 | # read csv file 79 | $outData = [System.Collections.ArrayList]::new() 80 | $content = Get-Content -Path $File 81 | $csvdata = $content | ? {$_ -match ";.*;"} | ConvertFrom-Csv -Delimiter ';' 82 | 83 | $tradeUnitSize = 0; 84 | if ($csvdata.Count) 85 | { 86 | $tradeUnitSize = [math]::Abs($csvdata[0].Amount) 87 | } 88 | 89 | Write-Header 90 | Write-Output "Trade Unite Size is '$tradeUnitSize' (FYI: 1 ES == 50 SPX units)`r`n" 91 | 92 | # convert currency strings to decimal 93 | # calculate properties 94 | foreach ($item in $csvdata) 95 | { 96 | $item.Amount = [double]($item.Amount | Convert-CurrencyStringToDecimal) 97 | $item.Price = [double]($item.Price | Convert-CurrencyStringToDecimal) 98 | $tpl = [double]($item.'Trade P/L' | Convert-CurrencyStringToDecimal) 99 | $item.'Trade P/L' = if ($tpl -eq 0) {""} else {$tpl} 100 | $pl = [double]($item.'P/L' | Convert-CurrencyStringToDecimal) 101 | $item.'P/L' = if ($pl -eq 0) {""} else {$pl} 102 | 103 | if ($tpl -eq 0) 104 | { 105 | $item | Add-Member -MemberType NoteProperty -Name "Points" -Value 0 106 | } 107 | else 108 | { 109 | $apl = [math]::Abs($item.Amount) 110 | $item | Add-Member -MemberType NoteProperty -Name "Points" -Value ($tpl/$apl*($apl/$tradeUnitSize)) 111 | } 112 | } 113 | 114 | if ($ShowFileContents) 115 | { 116 | $csvdata | ft -AutoSize 117 | } 118 | 119 | # 120 | # get only lines that have Trade P/L 121 | # 122 | $tradepl = $csvdata | ? {$_.'Trade P/L'} 123 | 124 | Write-Header 125 | Write-Output "Trade distribution by trade size (1 ES == 50 SPX units)" 126 | $tradepl | Group Amount | Sort {[int]$_.Name} | Select @{n='Trades'; e={$_.Count}}, @{n='TradeSize';e={[int]$_.Name*-1}} | ft 127 | 128 | # 129 | # calc trade length stats 130 | # 131 | $openCloseTrade = [System.Collections.ArrayList]::new() 132 | $firstOpen = $false 133 | $openTrade = $null 134 | $closeTrade = $null 135 | 136 | foreach ($item in $csvdata) 137 | { 138 | if ($item.Side -match "to Open" -and $firstOpen -eq $false) 139 | { 140 | $firstOpen = $true 141 | $openTrade = $item 142 | } 143 | elseif ($item.Side -match "to Close") 144 | { 145 | $closeTrade = $item 146 | } 147 | 148 | # for trades that open and close on the same day, TOS report has close trade before open trade in the file. 149 | # use this logic to match them. 150 | if ($firstOpen -and $closeTrade) 151 | { 152 | $null = $openCloseTrade.Add( 153 | [PSCustomObject]@{ 154 | 'FirstOpenTrade'=$openTrade 155 | 'CloseTrade'=$closeTrade 156 | } 157 | ) 158 | 159 | $firstOpen = $false 160 | $openTrade = $null 161 | $closeTrade = $null 162 | } 163 | } 164 | 165 | # 166 | # all trades 167 | # 168 | $tradeDuration = [System.Collections.ArrayList]::new() 169 | 170 | foreach ($trade in $openCloseTrade) 171 | { 172 | $openDate = [datetime]::Parse($trade.FirstOpenTrade.'Date/Time') 173 | $closeDate = [datetime]::Parse($trade.CloseTrade.'Date/Time') 174 | $numDays = $closeDate - $openDate 175 | $null = $tradeDuration.Add($numDays) 176 | } 177 | 178 | Write-Header 179 | Write-Output "Trade Size by Duration" 180 | $tradeDuration.TotalDays | group | sort {[int]$_.Count}, {[int]$_.Name} | Select @{n='TradeSize'; e={$_.Count}}, @{n='Days';e={$_.Name}} | ft 181 | 182 | # 183 | # buys only 184 | # 185 | $buys = $openCloseTrade | ? {$_.FirstOpenTrade.Side -match "Buy to Open"} 186 | $tradeDuration = [System.Collections.ArrayList]::new() 187 | 188 | foreach ($trade in $buys) 189 | { 190 | $openDate = [datetime]::Parse($trade.FirstOpenTrade.'Date/Time') 191 | $closeDate = [datetime]::Parse($trade.CloseTrade.'Date/Time') 192 | $numDays = $closeDate - $openDate 193 | $null = $tradeDuration.Add($numDays) 194 | } 195 | 196 | Write-Header 197 | Write-Output "Long Trade Size by Duration" 198 | if ($tradeDuration.Count) 199 | { 200 | $tradeDuration.TotalDays | group | sort {[int]$_.Count}, {[int]$_.Name} | Select @{n='TradeSize'; e={$_.Count}}, @{n='Days';e={$_.Name}} | ft 201 | } 202 | else 203 | { 204 | Write-Output "NONE" 205 | } 206 | 207 | # 208 | # sells only 209 | # 210 | $sells = $openCloseTrade | ? {$_.FirstOpenTrade.Side -match "Sell to Open"} 211 | $tradeDuration = [System.Collections.ArrayList]::new() 212 | 213 | foreach ($trade in $sells) 214 | { 215 | $openDate = [datetime]::Parse($trade.FirstOpenTrade.'Date/Time') 216 | $closeDate = [datetime]::Parse($trade.CloseTrade.'Date/Time') 217 | $numDays = $closeDate - $openDate 218 | $null = $tradeDuration.Add($numDays) 219 | } 220 | 221 | Write-Header 222 | Write-Output "Short Trade Size by Duration" 223 | if ($tradeDuration.Count) 224 | { 225 | $tradeDuration.TotalDays | group | sort {[int]$_.Count}, {[int]$_.Name} | Select @{n='TradeSize'; e={$_.Count}}, @{n='Days';e={$_.Name}} | ft 226 | } 227 | else 228 | { 229 | Write-Output "NONE" 230 | } 231 | 232 | # 233 | # stats! 234 | # 235 | Add-Statistic "Total trades:" $($csvdata.Count) 236 | 237 | # get only lines that have Trade P/L 238 | # $tradepl = $csvdata | ? {$_.'Trade P/L'} 239 | Add-Statistic "Total orders:" $($tradepl.Count) 240 | 241 | $n = $tradepl.'Trade P/L' | Measure-Object -Maximum -Minimum -Sum -Average 242 | Add-Statistic "Total P/L:" $($n.Sum) 243 | Add-Statistic "Min Trade P/L:" $($n.Minimum) 244 | Add-Statistic "Max Trade P/L:" $($n.Maximum) 245 | 246 | $winners = $tradepl | ? {$_.'Trade P/L' -ge 0} 247 | Add-Statistic "Winners:" $($winners.Count) 248 | 249 | $losers = $tradepl | ? {$_.'Trade P/L' -lt 0} 250 | Add-Statistic "Losers:" $($losers.Count) 251 | 252 | $n = $winners.'Trade P/L' | Measure-Object -Maximum -Minimum -Sum -Average 253 | Add-Statistic "Winner Total P/L:" $($n.Sum) 254 | Add-Statistic "Winner Min Trade P/L:" $($n.Minimum) 255 | Add-Statistic "Winner Max P/L:" $($n.Maximum) 256 | 257 | $n = $losers.'Trade P/L' | Measure-Object -Maximum -Minimum -Sum -Average 258 | Add-Statistic "Loser Total P/L:" $($n.Sum) 259 | Add-Statistic "Loser Min Trade P/L:" $($n.Minimum) 260 | Add-Statistic "Loser Max P/L:" $($n.Maximum) 261 | 262 | $points = $tradepl.Points | Measure-Object -Sum -Average -Maximum -Minimum 263 | Add-Statistic "Average Points:" $points.Average 264 | Add-Statistic "Maximum Points:" $points.Maximum 265 | Add-Statistic "Minimum Points:" $points.Minimum 266 | 267 | $shortTrades = [System.Collections.ArrayList]::new() 268 | $tplShort = $tradepl | ? {$_.Amount -gt 0} 269 | if ($tplShort) {$shortTrades.AddRange($tplShort)} 270 | 271 | $longTrades = [System.Collections.ArrayList]::new() 272 | $tplLong = $tradepl | ? {$_.Amount -lt 0} 273 | if ($tplLong) {$longTrades.AddRange($tplLong)} 274 | 275 | Add-Statistic "Short Trades:" $shortTrades.Count 276 | Add-Statistic "Long Trades:" $longTrades.Count 277 | 278 | $shortPoints = if ($shortTrades.Count) {$shortTrades.Points} else {0} 279 | $points = $shortPoints | Measure-Object -Sum -Average -Maximum -Minimum 280 | Add-Statistic "Short Average Points:" $points.Average 281 | Add-Statistic "Short Maximum Points:" $points.Maximum 282 | Add-Statistic "Short Minimum Points:" $points.Minimum 283 | 284 | $longPoints = if ($longTrades.Count) {$longTrades.Points} else {0} 285 | $points = $longPoints | Measure-Object -Sum -Average -Maximum -Minimum 286 | Add-Statistic "Long Average Points:" $points.Average 287 | Add-Statistic "Long Maximum Points:" $points.Maximum 288 | Add-Statistic "Long Minimum Points:" $points.Minimum 289 | 290 | $exitType = ($tradepl | ? Strategy -Match 'StopLossLX') 291 | $exit = if ($exitType) {$exitType.Count} else {0} 292 | Add-Statistic "Exit StopLossLX:" $exit 293 | 294 | $exitType = ($tradepl | ? Strategy -NotMatch 'StopLossLX') 295 | $exit = if ($exitType) {$exitType.Count} else {0} 296 | Add-Statistic "Exit NOT StopLossLX:" $exit 297 | 298 | 299 | # 300 | # Output Statistics 301 | # 302 | Write-Header 303 | Write-Output "Statistics for '$($tradepl[0].Strategy)' from '$File'." 304 | Write-Output "From: $($tradepl[0].'Date/Time')" 305 | Write-Output " To: $($tradepl[-1].'Date/Time')" 306 | $outData | Select Statistic, Data | ft 307 | 308 | # Just a line that does nothing so you can set a breakpoint if needed before script exits. 309 | Start-Sleep -Milliseconds 100 310 | -------------------------------------------------------------------------------- /SIERRA_CHART/kg_NewStudyTemplate.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Build, Select Files 3 | "SierraDev\kg_NewStudyTemplate.cpp" 4 | */ 5 | #include "sierrachart.h" 6 | SCDLLName("kg_NewStudyTemplate") 7 | const SCString ContactInformation = "Kory Gill, @korygill (twitter)"; 8 | #define ENABLE_SIERRA_USER_ACCESS_CHECKS 0 9 | #define ENABLE_INTERNAL_USER_ACCESS_CHECKS 1 10 | #define ENABLE_EXPIRATION_CHECKS 1 11 | const char EXPIRATION_DATE[] = "2021-08-01"; 12 | 13 | 14 | #pragma region Useful but not essential to study calculation code 15 | #if ENABLE_INTERNAL_USER_ACCESS_CHECKS 16 | // =========================================================================================== 17 | // Get User Authorization 18 | // =========================================================================================== 19 | int GetUserAuthorization(SCStudyInterfaceRef sc) 20 | { 21 | // AuthorizedUsers 22 | SCString AuthorizedUsers[] = { 23 | "AC125393" // kory 24 | }; 25 | int AuthorizedUsersCount = sizeof(AuthorizedUsers)/sizeof(AuthorizedUsers[0]); 26 | int IsAuthorizedUser = 0; 27 | SCString msg; 28 | 29 | for (int user=0; user= futureDate; 92 | } 93 | 94 | 95 | // =========================================================================================== 96 | // CreateExpirationText 97 | // Text Helper Function 98 | // =========================================================================================== 99 | void CreateExpirationText(SCStudyInterfaceRef sc) 100 | { 101 | // 102 | // Text 103 | // 104 | s_UseTool Tool; 105 | Tool.Clear(); // reset tool structure for our next use 106 | Tool.ChartNumber = sc.ChartNumber; 107 | Tool.DrawingType = DRAWING_TEXT; 108 | Tool.Region = sc.GraphRegion; 109 | Tool.FontFace = sc.ChartTextFont(); 110 | Tool.FontBold = true; 111 | Tool.ReverseTextColor = 0; 112 | Tool.Color = RGB_Red; 113 | Tool.FontSize = 10; 114 | Tool.LineNumber = 0xDEADBEEF; 115 | Tool.AddMethod = UTAM_ADD_OR_ADJUST; 116 | Tool.UseRelativeVerticalValues = 1; 117 | Tool.BeginValue = 50; // vertical % 0 - 100 118 | Tool.BeginDateTime = 50; // horizontal % 1-150 119 | Tool.DrawUnderneathMainGraph = 0; // 0 is above the main graph 120 | 121 | SCString msg = ""; 122 | msg.Append("==============================\r\n"); 123 | msg.Append("| Study %s\r\n"); 124 | msg.Append("| expired on %s.\r\n"); 125 | msg.Append("==============================\r\n"); 126 | 127 | Tool.Text.Format(msg, 128 | sc.GetStudyNameUsingID(sc.StudyGraphInstanceID).GetChars(), 129 | EXPIRATION_DATE 130 | ); 131 | 132 | sc.UseTool(Tool); 133 | } 134 | #endif 135 | #pragma endregion Expiration 136 | 137 | 138 | // =========================================================================== 139 | // LogDateTime 140 | // =========================================================================== 141 | void LogDateTime(SCStudyInterfaceRef sc, SCDateTime& time) { 142 | SCString msg; 143 | msg.Format("now: %.4d-%.2d-%.2d %.2d:%.2d:%.2d", 144 | time.GetYear(), time.GetMonth(), time.GetDay(), 145 | time.GetHour(), time.GetMinute(), time.GetSecond()); 146 | sc.AddMessageToLog(msg, 1); 147 | } 148 | #pragma endregion Useful but not essential to study calculation code 149 | 150 | 151 | // =========================================================================== 152 | // scsf_NewStudyTemplate 153 | // =========================================================================== 154 | SCSFExport scsf_NewStudyTemplate(SCStudyInterfaceRef sc) 155 | { 156 | int i; 157 | 158 | #if ENABLE_INTERNAL_USER_ACCESS_CHECKS 159 | // Lock this study down to just authorized users 160 | int& r_IsAuthorizedUser = sc.GetPersistentIntFast(0); 161 | #endif 162 | 163 | // 164 | // Subgraphs 165 | // 166 | i = 0; 167 | SCSubgraphRef Subgraph_MovingAverage = sc.Subgraph[i++]; 168 | int NumSubgraphs = i; 169 | 170 | // 171 | // Inputs 172 | // 173 | i = 0; 174 | SCInputRef Input_Length = sc.Input[i++]; 175 | 176 | // 177 | // Set Defaults 178 | // 179 | if (sc.SetDefaults) 180 | { 181 | SCString msg; 182 | msg.Format("sc.SetDefaults"); 183 | //sc.AddMessageToLog(msg, 0); 184 | 185 | // Initialize Defaults 186 | sc.GraphName = "New Study Template"; 187 | SCString studyDescription; 188 | studyDescription.Format("%s by %s", sc.GraphName.GetChars(), ContactInformation.GetChars()); 189 | sc.StudyDescription = studyDescription; 190 | sc.AutoLoop = 1; 191 | sc.DrawZeros = 0; 192 | sc.GraphRegion = 0; 193 | sc.DrawStudyUnderneathMainPriceGraph = 0; 194 | 195 | #pragma region Subgraphs 196 | Subgraph_MovingAverage.Name = "Moving Average"; 197 | Subgraph_MovingAverage.DrawStyle = DRAWSTYLE_LINE; 198 | Subgraph_MovingAverage.LineWidth = 2; 199 | Subgraph_MovingAverage.PrimaryColor = RGB_Magenta; 200 | Subgraph_MovingAverage.SecondaryColor = RGB_Yellow; 201 | Subgraph_MovingAverage.SecondaryColorUsed = 1; 202 | #pragma endregion Subgraphs 203 | 204 | #pragma region Inputs 205 | Input_Length.Name = "Length"; 206 | Input_Length.SetDescription("The moving average length."); 207 | Input_Length.SetInt(21); 208 | #pragma endregion Inputs 209 | 210 | return; 211 | } 212 | 213 | 214 | #pragma region Useful but not essential to study calculation code 215 | #pragma region ACCESS CHECKS 216 | // 217 | // Expiration Checks 218 | // 219 | #if ENABLE_EXPIRATION_CHECKS 220 | if (IsExpired(sc)) 221 | { 222 | CreateExpirationText(sc); 223 | return; 224 | } 225 | #endif 226 | 227 | // 228 | // User Access Checks for when distributed via direct dll sharing. 229 | // 230 | #if ENABLE_INTERNAL_USER_ACCESS_CHECKS 231 | if (sc.Index == 0) 232 | { 233 | // 234 | // Security Check 235 | // 236 | r_IsAuthorizedUser = GetUserAuthorization(sc); 237 | } 238 | 239 | if (r_IsAuthorizedUser == 0) 240 | { 241 | if (sc.Index == 0) 242 | { 243 | SCString msg; 244 | msg.Format("You are not authorized to use this study. Contact %s to discuss authorization.", ContactInformation.GetChars()); 245 | sc.AddMessageToLog(msg, 1); 246 | } 247 | return; 248 | } 249 | #endif 250 | 251 | // 252 | // User Access Checks for when distributed via Sierra. 253 | // 254 | #if ENABLE_SIERRA_USER_ACCESS_CHECKS 255 | if (sc.IsUserAllowedForSCDLLName == false) 256 | { 257 | if (sc.Index == 0) 258 | { 259 | SCString msg; 260 | msg.Format("You are not authorized to use this study. Contact %s to discuss authorization.", ContactInformation.GetChars()); 261 | sc.AddMessageToLog(msg, 1); 262 | } 263 | return; 264 | } 265 | #endif 266 | #pragma endregion ACCESS CHECKS 267 | #pragma endregion Useful but not essential to study calculation code 268 | 269 | 270 | // 271 | // MAIN STUDY CODE 272 | // 273 | 274 | // Init variables 275 | SCDateTime CurrentBarDateTime = sc.BaseDateTimeIn[sc.Index]; 276 | 277 | // 278 | // Full recalculation 279 | // 280 | if (sc.IsFullRecalculation && sc.Index == 0) { 281 | } 282 | 283 | 284 | // 285 | // Study Logic 286 | // 287 | sc.ExponentialMovAvg(sc.Close, Subgraph_MovingAverage, Input_Length.GetInt()); 288 | 289 | // Colorization 290 | if (Subgraph_MovingAverage[sc.Index] >= sc.Close[sc.Index]) { 291 | Subgraph_MovingAverage.DataColor[sc.Index] = Subgraph_MovingAverage.PrimaryColor; 292 | } else { 293 | Subgraph_MovingAverage.DataColor[sc.Index] = Subgraph_MovingAverage.SecondaryColor; 294 | } 295 | } 296 | -------------------------------------------------------------------------------- /FGMR/FGMR-StrategyReports-SPX.csv: -------------------------------------------------------------------------------- 1 | Strategy report 2 | Symbol: SPX 3 | Work Time: 3/25/09 - 1/14/19 4 | 5 | 6 | Id;Strategy;Side;Amount;Price;Date/Time;Trade P/L;P/L;Position; 7 | 1;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$806.81;3/25/09;;($353.50);-50.0; 8 | 2;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$909.03;5/8/09;;($7,131.00);-100.0; 9 | 3;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$910.52;5/12/09;;($4,934.50);-150.0; 10 | 4;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$932.49;6/4/09;;($10,549.50);-200.0; 11 | 5;kg_BTFG_STFG_Strat;Buy to Close;200.0;$893.46;6/23/09;($749.50);($749.50);0.0; 12 | 6;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$978.63;7/27/09;;($927.00);-50.0; 13 | 7;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,026.63;8/25/09;;($3,286.50);-100.0; 14 | 8;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,066.60;9/18/09;;($7,401.50);-150.0; 15 | 9;kg_BTFG_STFG_Strat;Buy to Close;150.0;$1,029.71;10/2/09;($863.50);($1,613.00);0.0; 16 | 10;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,088.22;10/19/09;;($2,097.50);-50.0; 17 | 11;kg_BTFG_STFG_Strat;Buy to Close;50.0;$1,043.69;10/29/09;$2,226.50;$613.50;0.0; 18 | 12;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,125.53;12/30/09;;$569.00;-50.0; 19 | 13;kg_BTFG_STFG_Strat;Buy to Close;50.0;$1,115.49;1/22/10;$502.00;$1,115.50;0.0; 20 | 14;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,096.93;1/28/10;;$495.50;50.0; 21 | 15;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,090.05;2/2/10;;$2,098.50;100.0; 22 | 16;kg_BTFG_STFG_Strat;Sell to Close;-100.0;$1,105.49;2/19/10;$1,200.00;$2,315.50;0.0; 23 | 17;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,192.06;4/19/10;;$2,042.50;-50.0; 24 | 18;kg_BTFG_STFG_Strat;Buy to Close;50.0;$1,188.58;5/3/10;$174.00;$2,489.50;0.0; 25 | 19;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,156.39;5/11/10;;$2,459.50;50.0; 26 | 20;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,084.78;5/24/10;;($2,204.00);100.0; 27 | 21;kg_BTFG_STFG_Strat;Sell to Close;-100.0;$1,114.02;6/16/10;($656.50);$1,833.00;0.0; 28 | 22;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,027.65;7/2/10;;$1,579.50;50.0; 29 | 23;kg_BTFG_STFG_Strat;Sell to Close;-50.0;$1,092.17;7/23/10;$3,226.00;$5,059.00;0.0; 30 | 24;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,056.28;8/26/10;;$4,606.00;50.0; 31 | 25;kg_BTFG_STFG_Strat;Sell to Close;-50.0;$1,102.60;9/7/10;$2,316.00;$7,375.00;0.0; 32 | 26;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,177.47;10/15/10;;$7,439.00;-50.0; 33 | 27;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,213.14;11/10/10;;$5,034.50;-100.0; 34 | 28;kg_BTFG_STFG_Strat;Buy to Close;100.0;$1,178.33;11/17/10;$1,697.50;$9,072.50;0.0; 35 | 29;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,280.85;1/20/11;;$9,102.00;-50.0; 36 | 30;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,302.77;2/3/11;;$7,543.50;-100.0; 37 | 31;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,318.13;2/10/11;;$5,879.50;-150.0; 38 | 32;kg_BTFG_STFG_Strat;Buy to Close;150.0;$1,305.47;3/2/11;($733.00);$8,339.50;0.0; 39 | 33;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,301.19;3/14/11;;$8,099.50;50.0; 40 | 34;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,276.71;3/18/11;;$7,364.50;100.0; 41 | 35;kg_BTFG_STFG_Strat;Sell to Close;-100.0;$1,327.44;3/31/11;$3,849.00;$12,188.50;0.0; 42 | 36;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,359.76;5/3/11;;$12,345.50;-50.0; 43 | 37;kg_BTFG_STFG_Strat;Buy to Close;50.0;$1,328.54;5/18/11;$1,561.00;$13,749.50;0.0; 44 | 38;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,316.36;5/25/11;;$13,955.00;50.0; 45 | 39;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,288.60;6/10/11;;$10,599.50;100.0; 46 | 40;kg_BTFG_STFG_Strat;Sell to Close;-100.0;$1,307.64;6/30/11;$516.00;$14,265.50;0.0; 47 | 41;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,339.62;7/7/11;;$13,585.50;-50.0; 48 | 42;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,343.31;7/11/11;;$16,463.00;-100.0; 49 | 43;kg_BTFG_STFG_Strat;Buy to Close;100.0;$1,304.84;7/28/11;$3,662.50;$17,928.00;0.0; 50 | 44;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,171.77;8/10/11;;$15,377.50;50.0; 51 | 45;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,172.87;8/12/11;;$18,577.00;100.0; 52 | 46;kg_BTFG_STFG_Strat;Sell to Close;-100.0;$1,213.00;8/31/11;$4,068.00;$21,996.00;0.0; 53 | 47;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,136.91;9/26/11;;$23,298.00;50.0; 54 | 48;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,124.03;10/5/11;;$23,352.00;100.0; 55 | 49;kg_BTFG_STFG_Strat;Sell to Close;-100.0;$1,206.96;10/13/11;$7,649.00;$29,645.00;0.0; 56 | 50;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,192.56;11/29/11;;$29,776.50;50.0; 57 | 51;kg_BTFG_STFG_Strat;Sell to Close;-50.0;$1,260.87;12/8/11;$3,415.50;$33,060.50;0.0; 58 | 52;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,344.33;2/7/12;;$32,924.50;-50.0; 59 | 53;kg_BTFG_STFG_Strat;Buy to Close;50.0;$1,343.39;3/7/12;$47.00;$33,107.50;0.0; 60 | 54;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,405.52;3/21/12;;$33,239.00;-50.0; 61 | 55;kg_BTFG_STFG_Strat;Buy to Close;50.0;$1,382.18;4/10/12;$1,167.00;$34,274.50;0.0; 62 | 56;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,387.61;4/13/12;;$33,407.00;50.0; 63 | 57;kg_BTFG_STFG_Strat;Sell to Close;-50.0;$1,405.50;5/2/12;$894.50;$35,169.00;0.0; 64 | 58;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,316.09;5/22/12;;$35,196.00;50.0; 65 | 59;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,277.82;6/5/12;;$34,023.50;100.0; 66 | 60;kg_BTFG_STFG_Strat;Sell to Close;-100.0;$1,329.19;6/15/12;$3,223.50;$38,392.50;0.0; 67 | 61;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,355.43;6/21/12;;$39,888.50;-50.0; 68 | 62;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,367.09;7/6/12;;$39,050.50;-100.0; 69 | 63;kg_BTFG_STFG_Strat;Buy to Close;100.0;$1,338.17;7/26/12;$2,309.00;$40,701.50;0.0; 70 | 64;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,385.27;7/31/12;;$40,999.00;-50.0; 71 | 65;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,429.13;9/11/12;;$38,065.50;-100.0; 72 | 66;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,461.19;9/18/12;;$35,583.00;-150.0; 73 | 67;kg_BTFG_STFG_Strat;Buy to Close;150.0;$1,441.48;10/10/12;($2,442.50);$38,259.00;0.0; 74 | 68;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,412.97;10/26/12;;$38,207.50;50.0; 75 | 69;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,379.86;11/12/12;;$36,620.50;100.0; 76 | 70;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,353.36;11/16/12;;$34,931.50;150.0; 77 | 71;kg_BTFG_STFG_Strat;Sell to Close;-150.0;$1,415.95;11/30/12;$5,083.00;$43,342.00;0.0; 78 | 72;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,435.81;12/20/12;;$42,948.00;-50.0; 79 | 73;kg_BTFG_STFG_Strat;Buy to Close;50.0;$1,402.43;12/31/12;$1,669.00;$45,011.00;0.0; 80 | 74;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,461.89;1/8/13;;$45,248.00;-50.0; 81 | 75;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,511.95;2/21/13;;$43,461.00;-100.0; 82 | 76;kg_BTFG_STFG_Strat;Buy to Close;100.0;$1,487.85;2/26/13;($93.00);$44,918.00;0.0; 83 | 77;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,496.94;2/27/13;;$45,870.50;50.0; 84 | 78;kg_BTFG_STFG_Strat;Sell to Close;-50.0;$1,525.20;3/5/13;$1,413.00;$46,331.00;0.0; 85 | 79;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,544.26;3/8/13;;$45,985.00;-50.0; 86 | 80;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,556.22;3/12/13;;$46,107.00;-100.0; 87 | 81;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,588.84;4/15/13;;$47,943.00;-150.0; 88 | 82;kg_BTFG_STFG_Strat;Buy to Close;150.0;$1,541.61;4/19/13;$3,224.50;$49,555.50;0.0; 89 | 83;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,617.55;5/7/13;;$49,135.00;-50.0; 90 | 84;kg_BTFG_STFG_Strat;Buy to Close;50.0;$1,629.05;6/5/13;($575.00);$48,980.50;0.0; 91 | 85;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,625.27;6/7/13;;$49,886.00;50.0; 92 | 86;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,592.27;6/26/13;;$48,429.50;100.0; 93 | 87;kg_BTFG_STFG_Strat;Sell to Close;-100.0;$1,642.89;7/9/13;$3,412.00;$52,392.50;0.0; 94 | 88;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,679.59;7/15/13;;$52,247.00;-50.0; 95 | 89;kg_BTFG_STFG_Strat;Buy to Close;50.0;$1,679.61;8/15/13;($1.00);$52,391.50;0.0; 96 | 90;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,650.66;8/21/13;;$51,998.50;50.0; 97 | 91;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,659.92;8/23/13;;$53,212.50;100.0; 98 | 92;kg_BTFG_STFG_Strat;Sell to Close;-100.0;$1,681.04;9/11/13;$2,575.00;$54,966.50;0.0; 99 | 93;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,685.04;9/13/13;;$54,819.00;-50.0; 100 | 94;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,722.44;9/20/13;;$54,349.50;-100.0; 101 | 95;kg_BTFG_STFG_Strat;Buy to Close;100.0;$1,676.22;10/8/13;$2,752.00;$57,718.50;0.0; 102 | 96;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,691.09;10/11/13;;$58,324.00;50.0; 103 | 97;kg_BTFG_STFG_Strat;Sell to Close;-50.0;$1,720.17;10/17/13;$1,454.00;$59,172.50;0.0; 104 | 98;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,746.48;10/22/13;;$58,763.00;-50.0; 105 | 99;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,747.48;10/24/13;;$58,663.50;-100.0; 106 | 100;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,790.79;11/19/13;;$55,229.50;-150.0; 107 | 101;kg_BTFG_STFG_Strat;Buy to Close;150.0;$1,781.71;12/12/13;($3,019.00);$56,153.50;0.0; 108 | 102;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,777.48;12/16/13;;$56,606.50;50.0; 109 | 103;kg_BTFG_STFG_Strat;Sell to Close;-50.0;$1,809.00;12/19/13;$1,576.00;$57,729.50;0.0; 110 | 104;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,841.47;12/30/13;;$57,749.50;-50.0; 111 | 105;kg_BTFG_STFG_Strat;Buy to Close;50.0;$1,826.96;1/24/14;$725.50;$58,455.00;0.0; 112 | 106;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,790.15;1/29/14;;$57,657.50;50.0; 113 | 107;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,790.88;1/31/14;;$57,662.50;100.0; 114 | 108;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,753.38;2/5/14;;$54,480.50;150.0; 115 | 109;kg_BTFG_STFG_Strat;Sell to Close;-150.0;$1,839.03;2/18/14;$9,134.00;$67,589.00;0.0; 116 | 110;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,831.45;4/15/14;;$68,165.50;50.0; 117 | 111;kg_BTFG_STFG_Strat;Sell to Close;-50.0;$1,879.32;4/23/14;$2,393.50;$69,982.50;0.0; 118 | 112;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,910.60;5/29/14;;$69,511.00;-50.0; 119 | 113;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,923.07;6/3/14;;$69,242.00;-100.0; 120 | 114;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,950.34;6/10/14;;$66,564.50;-150.0; 121 | 115;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$1,976.39;7/8/14;;$65,260.50;-200.0; 122 | 116;kg_BTFG_STFG_Strat;Buy to Close;200.0;$1,929.80;8/1/14;$2,060.00;$72,042.50;0.0; 123 | 117;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,936.34;8/5/14;;$71,236.00;50.0; 124 | 118;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,923.03;8/7/14;;$70,031.00;100.0; 125 | 119;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,933.43;8/11/14;;$72,940.50;150.0; 126 | 120;kg_BTFG_STFG_Strat;Sell to Close;-150.0;$1,980.46;8/20/14;$7,429.00;$79,471.50;0.0; 127 | 121;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,009.08;9/22/14;;$80,211.00;-50.0; 128 | 122;kg_BTFG_STFG_Strat;Buy to Close;50.0;$1,983.34;9/24/14;$1,287.00;$80,758.50;0.0; 129 | 123;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,978.96;9/29/14;;$80,700.50;50.0; 130 | 124;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,970.01;10/6/14;;$79,792.00;100.0; 131 | 125;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,967.68;10/9/14;;$74,157.50;150.0; 132 | 126;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,864.91;10/17/14;;$69,032.50;200.0; 133 | 127;kg_BTFG_STFG_Strat;Sell to Close;-200.0;$1,983.29;10/29/14;$7,580.00;$88,338.50;0.0; 134 | 128;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,030.36;12/12/14;;$86,937.00;50.0; 135 | 129;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,018.98;12/18/14;;$91,994.50;100.0; 136 | 130;kg_BTFG_STFG_Strat;Sell to Close;-100.0;$2,083.25;12/24/14;$5,858.00;$94,196.50;0.0; 137 | 131;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,064.56;3/13/15;;$93,638.50;50.0; 138 | 132;kg_BTFG_STFG_Strat;Sell to Close;-50.0;$2,102.03;4/13/15;$1,873.50;$96,070.00;0.0; 139 | 133;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,081.12;6/10/15;;$97,274.00;50.0; 140 | 134;kg_BTFG_STFG_Strat;Sell to Close;-50.0;$2,121.06;6/19/15;$1,997.00;$98,067.00;0.0; 141 | 135;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,067.00;7/1/15;;$98,588.00;50.0; 142 | 136;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,052.74;7/10/15;;$99,742.00;100.0; 143 | 137;kg_BTFG_STFG_Strat;Sell to Close;-100.0;$2,126.80;7/17/15;$6,693.00;$104,760.00;0.0; 144 | 138;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,942.77;8/27/15;;$107,004.50;50.0; 145 | 139;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,919.65;10/1/15;;$104,021.00;100.0; 146 | 140;kg_BTFG_STFG_Strat;Sell to Close;-100.0;$1,986.63;10/6/15;$5,542.00;$110,302.00;0.0; 147 | 141;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,025.55;12/15/15;;$111,195.00;50.0; 148 | 142;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,023.15;12/22/15;;$111,764.00;100.0; 149 | 143;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,940.34;1/13/16;;$94,392.00;150.0; 150 | 144;kg_BTFG_STFG_Strat;Buy to Open;50.0;$1,916.68;1/15/16;;$91,082.00;200.0; 151 | 145;kg_BTFG_STFG_Strat;Sell to Close;-200.0;$1,927.57;2/18/16;($9,772.00);$100,530.00;0.0; 152 | 146;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,083.10;4/15/16;;$100,648.50;-50.0; 153 | 147;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,102.09;4/21/16;;$100,641.50;-100.0; 154 | 148;kg_BTFG_STFG_Strat;Buy to Close;100.0;$2,052.95;5/5/16;$3,964.50;$104,494.50;0.0; 155 | 149;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,090.06;5/27/16;;$104,044.50;-50.0; 156 | 150;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,093.94;6/1/16;;$103,761.50;-100.0; 157 | 151;kg_BTFG_STFG_Strat;Buy to Close;100.0;$2,031.45;6/27/16;$6,055.00;$110,549.50;0.0; 158 | 152;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,042.69;6/29/16;;$111,953.50;50.0; 159 | 153;kg_BTFG_STFG_Strat;Sell to Close;-50.0;$2,131.72;7/11/16;$4,451.50;$115,001.00;0.0; 160 | 154;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,150.47;9/13/16;;$113,828.50;50.0; 161 | 155;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,146.48;9/16/16;;$114,069.50;100.0; 162 | 156;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,129.92;11/8/16;;$114,591.50;150.0; 163 | 157;kg_BTFG_STFG_Strat;Sell to Close;-150.0;$2,167.49;11/10/16;$3,780.00;$118,781.00;0.0; 164 | 158;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,263.32;12/13/16;;$118,361.00;-50.0; 165 | 159;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,253.77;12/15/16;;$118,432.50;-100.0; 166 | 160;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,286.01;1/30/17;;$116,801.00;-150.0; 167 | 161;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,343.01;2/17/17;;$105,854.50;-200.0; 168 | 162;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,367.50;2/23/17;;$103,509.00;-250.0; 169 | 163;kg_BTFG_STFG_Strat;Buy to Close;250.0;$2,343.00;3/22/17;($10,069.50);$108,711.50;0.0; 170 | 164;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,345.97;3/23/17;;$108,711.00;50.0; 171 | 165;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,342.53;4/18/17;;$108,505.50;100.0; 172 | 166;kg_BTFG_STFG_Strat;Sell to Close;-100.0;$2,381.51;4/25/17;$3,726.00;$112,437.50;0.0; 173 | 167;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,393.68;4/28/17;;$112,911.50;-50.0; 174 | 168;kg_BTFG_STFG_Strat;Buy to Close;50.0;$2,354.69;5/18/17;$1,949.50;$114,387.00;0.0; 175 | 169;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,431.92;6/6/17;;$114,516.50;-50.0; 176 | 170;kg_BTFG_STFG_Strat;Buy to Close;50.0;$2,428.70;6/28/17;$161.00;$114,548.00;0.0; 177 | 171;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,431.39;7/3/17;;$114,429.00;50.0; 178 | 172;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,424.51;7/10/17;;$114,496.00;100.0; 179 | 173;kg_BTFG_STFG_Strat;Sell to Close;-100.0;$2,444.99;7/13/17;$1,704.00;$116,252.00;0.0; 180 | 174;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,455.88;7/18/17;;$116,015.50;-50.0; 181 | 175;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,467.40;7/21/17;;$115,162.00;-100.0; 182 | 176;kg_BTFG_STFG_Strat;Buy to Close;100.0;$2,441.04;8/11/17;$2,060.00;$118,312.00;0.0; 183 | 177;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,468.66;8/15/17;;$118,109.50;50.0; 184 | 178;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,433.75;8/22/17;;$118,442.50;100.0; 185 | 179;kg_BTFG_STFG_Strat;Sell to Close;-100.0;$2,474.42;9/1/17;$2,321.50;$120,633.50;0.0; 186 | 180;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,494.56;9/14/17;;$120,580.50;-50.0; 187 | 181;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,549.99;10/10/17;;$117,797.00;-100.0; 188 | 182;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,575.99;10/31/17;;$115,371.50;-150.0; 189 | 183;kg_BTFG_STFG_Strat;Buy to Close;150.0;$2,572.95;11/16/17;($4,915.50);$115,718.00;0.0; 190 | 184;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,639.78;12/5/17;;$116,228.50;-50.0; 191 | 185;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,752.97;1/11/18;;$108,599.50;-100.0; 192 | 186;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,784.99;1/17/18;;$104,221.00;-150.0; 193 | 187;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,802.60;1/19/18;;$102,675.00;-200.0; 194 | 188;kg_BTFG_STFG_Strat;Buy to Close;200.0;$2,741.06;2/5/18;$805.00;$116,523.00;0.0; 195 | 189;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,690.95;2/7/18;;$116,058.50;50.0; 196 | 190;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,636.75;2/12/18;;$115,738.00;100.0; 197 | 191;kg_BTFG_STFG_Strat;Sell to Close;-100.0;$2,790.54;3/12/18;$12,669.00;$129,192.00;0.0; 198 | 192;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,667.57;3/27/18;;$126,444.50;50.0; 199 | 193;kg_BTFG_STFG_Strat;Sell to Close;-50.0;$2,710.11;4/18/18;$2,127.00;$131,319.00;0.0; 200 | 194;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,733.37;5/14/18;;$131,481.00;-50.0; 201 | 195;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,785.60;6/12/18;;$128,582.50;-100.0; 202 | 196;kg_BTFG_STFG_Strat;Buy to Close;100.0;$2,722.12;6/26/18;$3,736.50;$135,055.50;0.0; 203 | 197;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,727.13;6/29/18;;$134,617.50;50.0; 204 | 198;kg_BTFG_STFG_Strat;Sell to Close;-50.0;$2,788.56;7/10/18;$3,071.50;$138,127.00;0.0; 205 | 199;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,857.19;8/9/18;;$138,307.50;-50.0; 206 | 200;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,898.37;8/31/18;;$135,753.00;-100.0; 207 | 201;kg_BTFG_STFG_Strat;Sell to Open;-50.0;$2,921.75;9/25/18;;$134,658.50;-150.0; 208 | 202;kg_BTFG_STFG_Strat;Buy to Close;150.0;$2,877.53;10/8/18;$2,236.00;$140,363.00;0.0; 209 | 203;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,811.67;10/17/18;;$140,240.00;50.0; 210 | 204;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,667.86;10/26/18;;$132,255.50;100.0; 211 | 205;kg_BTFG_STFG_Strat;Sell to Close;-100.0;$2,806.38;11/8/18;$6,661.50;$147,024.50;0.0; 212 | 206;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,547.05;12/19/18;;$145,020.00;50.0; 213 | 207;kg_BTFG_STFG_Strat;Buy to Open;50.0;$2,442.50;12/27/18;;$146,430.00;100.0; 214 | 208;kg_BTFG_STFG_Strat;Sell to Close;-100.0;$2,580.31;1/14/19;$8,553.50;$155,578.00;0.0; 215 | 216 | 217 | Max trade P/L: $12,669.00; 218 | 219 | Total P/L: $155,578.00; 220 | 221 | Total order(s): 70; --------------------------------------------------------------------------------