Thinkscripts - ThinkOrSwim Programming | futures io social day trading
futures io futures trading


Thinkscripts
Updated: Views / Replies:39,484 / 105
Created: by optntdr13 Attachments:31

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

Reply
 31  
 
Thread Tools Search this Thread
 

Thinkscripts

  #91 (permalink)
1.Fibs 2.??? 3.Profit
Puerto Rico
 
Futures Experience: Intermediate
Platform: thinkorswim
Broker/Data: TD Ameritrade
Favorite Futures: ES
 
rmejia's Avatar
 
Posts: 384 since Oct 2010
Thanks: 3,597 given, 421 received


courier12 View Post
Has anyone coded the TWAP indicator in ThinkorSwim? TOS has a built in VWAP but not TWAP.

Found this one a while back:

 
Code
input price = FundamentalType.HLC3;
input timeFrame = {default Day, Week, Month, Chart};

script TimeWAP {

input price = hlc3;
input timeFrame = {default Day, Week, Month, Chart};

def yyyyMmDd = getYyyyMmDd();
def periodIndx;
switch (timeFrame) {
case DAY:
    periodIndx = yyyyMmDd;
case WEEK:
    periodIndx = Floor((daysFromDate(first(yyyyMmDd)) + getDayOfWeek(first(yyyyMmDd))) / 7);
case MONTH:
    periodIndx = roundDown(yyyyMmDd / 100, 0);
case Chart:
    periodIndx = 0;
}

def newday = compoundValue(1, periodIndx != periodIndx[1], yes);
rec cumeprice = if newday then price else price + cumeprice[1];
rec cumebarnumber = if newday then 1 else 1 + cumebarnumber[1];

plot TWAP = Round(cumeprice / cumebarnumber, 4);

}

plot TWAP = TimeWAP(fundamental(price));
TWAP.AssignValueColor(if TWAP > TWAP[1] then Color.Dark_Green else if TWAP is equal to TWAP[1] then color.gray else Color.Dark_Red);
TWAP.SetStyle(curve.SHORT_DASH);
TWAP.SetLineWeight(2);
TWAP.HideBubble();

Reply With Quote
The following user says Thank You to rmejia for this post:
 
  #92 (permalink)
Elite Member
Mumbai India
 
Futures Experience: None
Platform: TradeStation
Favorite Futures: Forex
 
Posts: 39 since Nov 2014
Thanks: 58 given, 10 received

Thank you @rmejia .

This is not quite right since it resets after every candle. The TWAP is much smoother, similar to VWAP. Since this indicator calculates every bar, it is quite "jerky" and not smooth


rmejia View Post
Found this one a while back:

 
Code
input price = FundamentalType.HLC3;
input timeFrame = {default Day, Week, Month, Chart};

script TimeWAP {

input price = hlc3;
input timeFrame = {default Day, Week, Month, Chart};

def yyyyMmDd = getYyyyMmDd();
def periodIndx;
switch (timeFrame) {
case DAY:
    periodIndx = yyyyMmDd;
case WEEK:
    periodIndx = Floor((daysFromDate(first(yyyyMmDd)) + getDayOfWeek(first(yyyyMmDd))) / 7);
case MONTH:
    periodIndx = roundDown(yyyyMmDd / 100, 0);
case Chart:
    periodIndx = 0;
}

def newday = compoundValue(1, periodIndx != periodIndx[1], yes);
rec cumeprice = if newday then price else price + cumeprice[1];
rec cumebarnumber = if newday then 1 else 1 + cumebarnumber[1];

plot TWAP = Round(cumeprice / cumebarnumber, 4);

}

plot TWAP = TimeWAP(fundamental(price));
TWAP.AssignValueColor(if TWAP > TWAP[1] then Color.Dark_Green else if TWAP is equal to TWAP[1] then color.gray else Color.Dark_Red);
TWAP.SetStyle(curve.SHORT_DASH);
TWAP.SetLineWeight(2);
TWAP.HideBubble();


Reply With Quote
 
  #93 (permalink)
1.Fibs 2.??? 3.Profit
Puerto Rico
 
Futures Experience: Intermediate
Platform: thinkorswim
Broker/Data: TD Ameritrade
Favorite Futures: ES
 
rmejia's Avatar
 
Posts: 384 since Oct 2010
Thanks: 3,597 given, 421 received



courier12 View Post
Thank you @rmejia .

This is not quite right since it resets after every candle. The TWAP is much smoother, similar to VWAP. Since this indicator calculates every bar, it is quite "jerky" and not smooth

Where do you see the jerkyness ? Looks very similar to the VWAP

Attached Thumbnails
Thinkscripts-twap.png   Thinkscripts-twap2.png   Thinkscripts-twap3.png  
Reply With Quote
The following user says Thank You to rmejia for this post:
 
  #94 (permalink)
Elite Member
Jurong Singapore
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: Optimus Futures/Rithmic
Favorite Futures: TF
 
Posts: 72 since Jul 2012
Thanks: 39 given, 7 received


optntdr13 View Post
I just wanted to let folks know that if you are looking for something specific, chances are I have it or wrote it and am more than happy to share with any and all. If you would like to have any T.....D......ARK stuff, I have coded almost every single one of them but won't share publically due to the maketstudies goons I will however send via PM or e-mail and am happy to do so.

Just curious, do you have Cory's Volume Stop V7 on thinkscript?

Reply With Quote
 
  #95 (permalink)
Elite Member
Mumbai India
 
Futures Experience: None
Platform: TradeStation
Favorite Futures: Forex
 
Posts: 39 since Nov 2014
Thanks: 58 given, 10 received


rmejia View Post
Where do you see the jerkyness ? Looks very similar to the VWAP

Thank you @rmejia and I apologize for the delay in getting back.

The other day I was looking at "data" (thin blue line) which is hugging price and is jerky.

The dotted white line is VWAP and the dotted red (and green) line is the TWAP which I did not see the other day.

Really appreciate your quick replies. Have a good weekend!

Attached Thumbnails
Thinkscripts-twap-vs-vwap.png  

Last edited by courier12; January 17th, 2015 at 09:25 AM. Reason: Added Image
Reply With Quote
 
  #96 (permalink)
Elite Member
Mumbai India
 
Futures Experience: None
Platform: TradeStation
Favorite Futures: Forex
 
Posts: 39 since Nov 2014
Thanks: 58 given, 10 received

Avg. Volume by Time of Day

Hi:

Does anyone have an indicator which shows the Average Volume for the past "X" days by time of day?

E.g. On say a 30 min chart of the 6E, display the average volume traded from 8-8:30 am GMT for the past 20 days and overlay on today's volume bar.

Thank you,

Reply With Quote
 
  #97 (permalink)
Elite Member
brooklyn ny usa
 
Futures Experience: Intermediate
Platform: think or swim
Favorite Futures: es
 
Posts: 233 since Nov 2013
Thanks: 394 given, 252 received

hi all
how do I add a moving avg below the chart ?

Reply With Quote
 
  #98 (permalink)
Elite Member
Nanjing, NJ
 
Futures Experience: Intermediate
Platform: CQG/TOS
Broker/Data: Optimus/CQG
Favorite Futures: CL
 
Posts: 102 since Jun 2010
Thanks: 33 given, 71 received

use declare lower;

see here: https://www.thinkorswim.com/tos/thinkScriptHelp.jsp?laf=dark#basicDecl

Reply With Quote
The following user says Thank You to shzhning for this post:
 
  #99 (permalink)
Elite Member
Mumbai India
 
Futures Experience: None
Platform: TradeStation
Favorite Futures: Forex
 
Posts: 39 since Nov 2014
Thanks: 58 given, 10 received

Previous Week High / Low on this week

Hi everyone:

Is there an indicator in TOS which will plot last week's high and low on this week's chart?

Thank you,

Reply With Quote
 
  #100 (permalink)
Trading Apprentice
Colorado Springs, CO
 
Futures Experience: Advanced
Platform: ThinkorSwim
Favorite Futures: /NQ
 
Posts: 1 since Feb 2015
Thanks: 0 given, 1 received


I’ve recently developed some custom studies (via ThinkScript) that I want to use for conditional orders. They are derivatives of the standard MACD and the ForceIndex. I copied the script from those studies exactly as my starting point and scripted from there. The MACDPlus allows for a confirmatory buy or sell curve above or below “Avg” expressed as a percentage that a conditional order can be used when “Value” passes above or below those lines. The FACD is a derivative of both ForceIndex in the form of MACD using 2 ForceIndexes of varying lengths. Looking at the charts in ToS, these scripts plot and indicate correctly…showing the conditional buy and sell opportunities with a vertical line based on the 2 optional criteria for each (i.e. a set number OR an amount above/below the slower indicator)

However, the problem I’m having is not with the charts themselves, but rather using the studies I’ve modified to trigger conditional orders. I use the conditional order pop-up to trigger conditional orders based on the studies…and even though it appears through the script that the orders have been placed correctly utilizing the custom study, actual orders have failed to trigger. Can anyone please help me figure out what going so wrong?

BTW, I was going to include links...but since I'm new to the forum, I have to make at least 5 posts first. Any help is still appreciated.

Attached Files
Register to download File Type: ts MACDPlusSTUDY.ts (2.9 KB, 49 views)
Reply With Quote
The following user says Thank You to pilotchilly for this post:

Reply



futures io > > > > > Thinkscripts

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     


All times are GMT -4. The time now is 06:40 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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 2017-12-18 in 0.13 seconds with 19 queries on phoenix via your IP 54.163.209.109