![]() ![]() Write-Output "Out Data $($sohlcpData.Count) items (exported as `$sohlcpData)" # helpful message to show caller our output variable $prevClose = $v | Convert-CurrencyStringToDecimal $close = $v | Convert-CurrencyStringToDecimal $low = $v | Convert-CurrencyStringToDecimal $high = $v | Convert-CurrencyStringToDecimal $open = $v | Convert-CurrencyStringToDecimal # find the lines that contain price information Open this chart in thinkorswim, it has the strategy code in it.įunction Convert-CurrencyStringToDecimal ($input) () Run a PowerShell script I created called Get-OHLC.ps1 which transforms the csv file into a proper object which can be saved, or used in further analysis. The output file has extra information in it and it not a truly valid csv file. () Use the Show Report context menu to save the trades to a csv file. This strategy will put Open, High, Low, Close (OHLC) data in the Name of the buy order. () Add a strategy to a chart that simulates a trade on every bar (1 buy to open, 1 sell to close). This requires a few steps, and once you have done this once, subsequent exports will come naturally. ![]() This article demonstrates how to export historical data from thinkorswim to a csv file, and then convert that output file to something that is a truly valid csv file which can be imported by PowerShell or any other program. I am learning Python, and will move to that in the future. I do a lot of back testing with PowerShell. UPDATE:, a newer version of this post is on thread #20. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |