Help about TOS function - ThinkOrSwim | futures io social day trading
futures io futures trading


Help about TOS function
Updated: Views / Replies:1,027 / 2
Created: by alchemist74 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

Reply
 
Thread Tools Search this Thread
 

Help about TOS function

  #1 (permalink)
Elite Member
Sofia, Bulgaria
 
Futures Experience: Advanced
Platform: IB,TOS
Broker/Data: IB
Favorite Futures: Options,ES,6E,ZB,SPX,RUT,CL
 
Posts: 47 since Jul 2010
Thanks: 6 given, 42 received

Help about TOS function

Hi,
can anyone to help me with this TOS function for Inertia:
script inertiaTS {
input y = close;
input n = 20;
def x = x[1] + 1;
def a = (n * Sum(x * y, n) - Sum(x, n) * Sum(y, n) ) / ( n * Sum(Sqr(x), n) - Sqr(Sum(x, n)));
def b = (Sum(Sqr(x), n) * Sum(y, n) - Sum(x, n) * Sum(x * y, n) ) / ( n * Sum(Sqr(x), n) - Sqr(Sum(x, n)));
plot InertiaTS = a * x + b;
}

input length = 20;
plot LinReg1 = Inertia(close, length);
plot LinReg2 = InertiaTS(close, length);

My question is what is X (def x = x[1] + 1 and what is n=20 (maybe it is default length? )
I am totaly confused of X meaning.
Is there anybody who can translate this to Java or C++ ?
Thanks in advance.

Reply With Quote
 
  #2 (permalink)
Elite Member
Chicago
 
Futures Experience: Advanced
Platform: ThinkOrSwim
Favorite Futures: options
 
Posts: 11 since Dec 2013
Thanks: 2 given, 8 received

I could be incorrect saying this.

There is a built-in study called Inertia. I am unsure if is the same thing as the sample code provided. Information about the study is at tlc.thinkorswim.com/center/charting/studies/studies-library/G-L/Inertia.html (<--- this is a url and i can't post links yet)

The study takes two parameters
- length for "The number of bars used to calculate the linear regression curve." I believe this is what the 20 value represents in the code.
- rvi lenght for "The number of bars used to calculate the Relative Volatility Index." I believe this is what X is.

With thinkScript (the API for thinkDesktop or what people usually call thinkOrSwim) the [1] means the prior bar/day/whatever.

For example, if I want to see what the prior day high was I would do this
 
Code
plot yHigh = high (period = "day")[1];

If I want to see what the prior day was two days ago I would do this
 
Code
plot yHigh = high (period = "day")[2];

This code can be easily ported to C++ or JAVA. However, with that being said I am sure you use a particular platform that has C++/JAVA as a API?

Reply With Quote
The following user says Thank You to RHcZL0Mfs for this post:
 
  #3 (permalink)
Elite Member
Sofia, Bulgaria
 
Futures Experience: Advanced
Platform: IB,TOS
Broker/Data: IB
Favorite Futures: Options,ES,6E,ZB,SPX,RUT,CL
 
Posts: 47 since Jul 2010
Thanks: 6 given, 42 received


Thx RHcZL0Mfs for your answer.

i dont use API for now. My broker is IB and they have API but i trying to develop simple soft to help me with my option trading. Unfortunately my level of programing(and math) is 0 and my programer trading level is 0 too

so what u mean with: "rvi lenght for "The number of bars used to calculate the Relative Volatility Index." I believe this is what X is." just rvi length or rvi number for that length ?

thx again for your answer and Happy New Year !

Reply With Quote

Reply



futures io > > > > Help about TOS function

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
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
DateTime2ELTime Function westsider EasyLanguage Programming 2 October 28th, 2012 05:36 PM
Tables function aquarian1 Feedback and Announcements 3 December 23rd, 2011 10:42 PM
Ema2 Function in NinjaScript? srgtroy NinjaTrader Programming 3 June 29th, 2011 01:00 AM
using advance search function aquarian1 Traders Hideout 5 December 26th, 2010 04:47 PM


All times are GMT -4. The time now is 07:42 PM.

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-17 in 0.07 seconds with 19 queries on phoenix via your IP 54.163.209.109