NexusFi: Find Your Edge


Home Menu

 





Thinkscript help


Discussion in ThinkOrSwim

Updated
    1. trending_up 3,511 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread

Thinkscript help

  #1 (permalink)
kidvic
Los Angeles, CA
 
Posts: 92 since Mar 2015
Thanks Given: 13
Thanks Received: 3

So I have created a script,

I have multiple defs, but want the one with the highest value
def a = if open is 12 then 1 else 0
def b = if close is 21 then 2 else 0
def c = if high is 8 then 3 else

I want it to return the max of the 3, so lets say we have true statements to a and b, that's 1 and 2 . so the max is 2,between both so I want B.

if MAX(a, b, c) worked i'd use it but im out of luck

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
REcommedations for programming help
Sierra Chart
Better Renko Gaps
The Elite Circle
What broker to use for trading palladium futures
Commodities
How to apply profiles
Traders Hideout
 
  #2 (permalink)
mobiusrts
pensacola florida
 
Posts: 7 since Jul 2014
Thanks Given: 0
Thanks Received: 8

Nest the Max() function as many times as needed.
Example:

Max(variable1, Max(variable2, variable3))

Reply With Quote
  #3 (permalink)
kidvic
Los Angeles, CA
 
Posts: 92 since Mar 2015
Thanks Given: 13
Thanks Received: 3



mobiusrts View Post
Nest the Max() function as many times as needed.
Example:

Max(variable1, Max(variable2, variable3))

Thank you but I'm already past this . would you happen ro kmow if there's a way you could put chart bubbles all the way to the right?

Reply With Quote
  #4 (permalink)
mobiusrts
pensacola florida
 
Posts: 7 since Jul 2014
Thanks Given: 0
Thanks Received: 8

If your referring to Chart Labels the only way to display them at the right is to add spaces in the text string on an otherwise blank label. Chart Bubbles can be placed anywhere on the chart. The two different functions are..
AddChart()
AddChartBubble()

Reply With Quote
  #5 (permalink)
kidvic
Los Angeles, CA
 
Posts: 92 since Mar 2015
Thanks Given: 13
Thanks Received: 3


mobiusrts View Post
If your referring to Chart Labels the only way to display them at the right is to add spaces in the text string on an otherwise blank label. Chart Bubbles can be placed anywhere on the chart. The two different functions are..
AddChart()
AddChartBubble()

Ah. What I mean is I have a highestall horizontal line, and I want the text to appear all the way on the right to that line. A label only places it in the top I believe? Correct me if I'm wrong.

Reply With Quote
  #6 (permalink)
mobiusrts
pensacola florida
 
Posts: 7 since Jul 2014
Thanks Given: 0
Thanks Received: 8

You have that correct. A Label is always at the top. A bubble can be anywhere on the chart.

Here's a typical method to display a label in the Right Expansion Area (make sure you have your Expansion Area set to at least 10 bars).

def BubbleLocation = IsNaN(close[1]) and !IsNaN(close[2]);

AddChartBubble(BubbleLocation, "Variable", "Description", Color.Yellow);

Reply With Quote
Thanked by:




Last Updated on May 11, 2015


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts