Help with a think script problem - ThinkOrSwim | futures io social day trading
futures io futures trading

Help with a think script problem
Updated: Views / Replies:396 / 0
Created: by johnzhou20 Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • 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.

-- Big Mike, Site Administrator

Thread Tools Search this Thread

Help with a think script problem

  #1 (permalink)
Trading Apprentice
vancouver, canada
Futures Experience: None
Platform: Thinkorswim
Favorite Futures: ES
Posts: 1 since Oct 2015
Thanks: 0 given, 0 received

Help with a think script problem

Hello all,

I am trying to edit the think script code for scanning stocks based on compounded returns over a specific length but I can't seem to find a command that can simplify a sequence of time. To show you:

input price = close;
input percent = 19.8;
input Choice = {default greater, less};
input length = 10;

def z = length - 1;

def y = 100*((log(price[z]) - log(price[length])) + (log(price[z - 1]) - log(price[z])) + (log(price[z - 2]) - log(price[z - 1])) + (log(price[z - 3]) - log(price[z - 2])) + (log(price[z - 4]) - log(price[z - 3])) + (log(price[z - 5]) - log(price[z - 4])) + (log(price[z - 6]) - log(price[z - 5])) + (log(price[z - 7]) - log(price[z - 6])) + (log(price[z - 8]) - log(price[z - 7])) + (log(price[z - 9]) - log(price[z - 8])));

plot scan;

switch (Choice){
case greater:
scan = y >= percent;
case less:
scan = y <= -percent;


In essence, what is the command for this ? I would like to go out for further periods of defined lengths such as 1 year based on daily returns for example but I can't seem to find the resources for this on the Thinkscript tutorial website and I also tried to browse the web. I would greatly appreciate any help because once my lengths becomes specified for a period of 30 days or greater, then i receive an error where the command is too complex. It would make my life a lot easier if someone could help (as a side note, I would prefer to use daily cumulative returns here as opposed scaling out to larger time frames such as weekly or monthly. Having said that, knows a simplified method will also allow me to have the opportunity to scan stocks based on lower time frames.)

Thanks for reading

Reply With Quote


futures io > > > > Help with a think script problem

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Wyckoff Hunting for Great Risk/Reward Ratio w/Gary Fullett

Elite only

Digging into the Details of iSystems w/Stage 5 & iSystems

Jun 5

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I get the script of this Indicator? khalid alshalan ThinkOrSwim 8 April 6th, 2014 02:19 PM
Option Script bobp ThinkOrSwim Programming 2 August 7th, 2012 06:42 PM
Need little help with a Ninjatrader script raindrop NinjaTrader Programming 9 April 20th, 2011 10:35 PM
Looking for this script or indicator. rh017548 NinjaTrader Programming 3 May 16th, 2010 07:00 PM
Ninja Script Import Problem jdella NinjaTrader 5 November 6th, 2009 09:57 AM

All times are GMT -4. The time now is 08:09 AM.

Copyright © 2018 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432,
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 2018-05-27 in 0.08 seconds with 19 queries on phoenix via your IP