Converting a Thinkorswim (Java-based) indicator into a Python script? - Matlab, R project and Python | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > Matlab, R project and Python

Converting a Thinkorswim (Java-based) indicator into a Python script?
Started:July 7th, 2016 (04:34 PM) by ClutchAce Views / Replies:135 / 1
Last Reply:July 7th, 2016 (04:34 PM) Attachments:0

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Converting a Thinkorswim (Java-based) indicator into a Python script?

Old July 7th, 2016, 04:34 PM   #1 (permalink)
Trading Apprentice
Cookeville, TN
Futures Experience: Advanced
Platform: R|Trader, Thinkorswim
Favorite Futures: CL, RB, 6E, ZB, DX
Posts: 20 since Oct 2011
Thanks: 3 given, 7 received

Converting a Thinkorswim (Java-based) indicator into a Python script?

Anyone with experience translating Thinkorswim's thinkscript into a Python script? I'm mostly through the phase of matching up equivalent functions in Python and noting syntax quirks, but there's still some 'glue' of the coding which I'm unsure of.

Examples from thinkscript:
1) CompoundValue(int length, IDataHolder visible data, IDataHolder historical data) functions in Thinkscript are calculated per ToS reference "according to the following rule: if a bar number is greater than length then the visible data value is returned, otherwise the historical data value is returned. This function is used to initialize studies with recursion."
-> I can substitute this with if-else (nested) conditionals, I think...

2) Switch-case statements don't exist in Python. Googling "switch case python" yields several links that go into a workaround for Python

So, just looking for anyone to share ideas for translating this correctly.

Last edited by ClutchAce; July 7th, 2016 at 04:57 PM.
Reply With Quote

Old July 7th, 2016, 04:35 PM   #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.


Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > Matlab, R project and Python > Converting a Thinkorswim (Java-based) indicator into a Python script?

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

An Afternoon with FIO trader bobwest

Elite only

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Python Script to see which contract has the most volume Aufidius Matlab, R project and Python 1 July 23rd, 2015 01:57 PM
Converting time based charts to volume and tick based charts SeanKozak Commodities Futures Trading 1 April 1st, 2014 09:05 PM
Help with converting ToS script into Easylanguage (Volatility/STDeviation Indicators) mhc217 EasyLanguage Programming 1 January 11th, 2014 09:19 PM
Converting an eSignal Study to Thinkorswim zenmaster101 ThinkOrSwim Programming 3 March 1st, 2012 05:17 PM
Needed Bid / Ask bar script for thinkorswim Rad4633 ThinkOrSwim 3 October 8th, 2011 02:05 PM

All times are GMT -4. The time now is 03:01 AM.

Copyright © 2016 by All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts

Page generated 2016-10-22 in 0.07 seconds with 19 queries on phoenix via your IP