thinkscript definitions max - ThinkOrSwim | futures io social day trading
futures io futures trading


thinkscript definitions max
Updated: Views / Replies:696 / 4
Created: by kidvic 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
 

thinkscript definitions max

  #1 (permalink)
Trading for Fun
Los Angeles, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader, ThinkOrSwim
Favorite Futures: Options, Futures
 
Posts: 92 since Mar 2015
Thanks: 13 given, 2 received

thinkscript definitions max

Hi, I was wondering if you have the answer to my scripting question....
For thinkscript.
So I have several different defs,
and I want the one with highest value to be defined in another one...
def a = if true 1 else 0
def b = if true 2 else 0
def c = if true 3 else 0
def d = if true 4 else 0

def result = max(a b c d)

at this point we would get d because its got the highest value... as you know thinkscript will only do this with 2 values.
anyway you would know a workaround? Thanks.

Reply With Quote
 
  #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.

 
  #3 (permalink)
Elite Member
Trubchevsk
 
Futures Experience: Beginner
Platform: tos
Favorite Futures: stocks
 
Posts: 48 since May 2011
Thanks: 34 given, 64 received

Answer
This post has been selected as an answer to the original posters question Answer



kidvic View Post
Hi, I was wondering if you have the answer to my scripting question....
For thinkscript.
So I have several different defs,
and I want the one with highest value to be defined in another one...
def a = if true 1 else 0
def b = if true 2 else 0
def c = if true 3 else 0
def d = if true 4 else 0

def result = max(a b c d)

at this point we would get d because its got the highest value... as you know thinkscript will only do this with 2 values.
anyway you would know a workaround? Thanks.

)
 
Code
                            
max(max(max(a,b),c),d); 


Reply With Quote
The following 3 users say Thank You to growex for this post:
 
  #4 (permalink)
Trading for Fun
Los Angeles, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader, ThinkOrSwim
Favorite Futures: Options, Futures
 
Posts: 92 since Mar 2015
Thanks: 13 given, 2 received


growex View Post
)
 
Code
                            
max(max(max(a,b),c),d); 


Thanks growex, that answered my question. Only thing now, as we got D, how do I get the actual value for D? the def of D was given... but I didn't know the value would not be given. I wanted the number instead in this case we can see that the THEN value is 4. That is what I want...... the then part.
Thanks in advance!


Last edited by kidvic; May 2nd, 2015 at 09:50 PM. Reason: clarification
Reply With Quote
 
  #5 (permalink)
Elite Member
Trubchevsk
 
Futures Experience: Beginner
Platform: tos
Favorite Futures: stocks
 
Posts: 48 since May 2011
Thanks: 34 given, 64 received

def a = if true 1 else 0
def b = if true 2 else 0
def c = if true 3 else 0
def d = if true 4 else 0
def result = max(max(max(a,b),c),d);
the value of "result" variable will be 4, not "D";



just for information....to assign text values use ""
def a = "a";
def a = "/es"


also if you want to name your variables such as 1a,1b,1c (name starts witn a number) use "" also

def "1a" = 16434656;


Last edited by growex; May 4th, 2015 at 12:41 PM.
Reply With Quote
The following user says Thank You to growex for this post:

Reply



futures io > > > > thinkscript definitions max

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
Thinkscript help kidvic ThinkOrSwim Programming 5 May 11th, 2015 11:28 AM
thinkscript purelife173 ThinkOrSwim Programming 0 October 31st, 2014 12:50 AM
Chart definitions for Gom MP and vol ladder fot NT7 tradervic888 The Elite Circle 1 April 27th, 2012 11:47 PM
Possible study with ThinkScript? TonyB ThinkOrSwim 0 March 4th, 2012 11:27 PM
Statistical Definitions for Newbies NMTrader Traders Hideout 1 July 28th, 2009 02:39 AM


All times are GMT -4. The time now is 10:26 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-15 in 0.09 seconds with 27 queries on phoenix via your IP 54.221.76.68