NexusFi: Find Your Edge


Home Menu

 





thinkscript reference


Discussion in ThinkOrSwim

Updated
    1. trending_up 8,095 views
    2. thumb_up 6 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
situhold
calgary ab/canada
 
Posts: 3 since Aug 2014
Thanks Given: 1
Thanks Received: 0

hi,

can someone help me out on this following question?
I like to create a new thinkscript indicator adding a reference to one of my custom indicator. can you show me how to do that if thinkorswim allow me to do so?

thanks


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
After $87M Settles NO: Irans Nuclear Redline Sets Up the …
Prediction Markets & Event Contracts
June 15 Peace Odds Surge From 3.6% to 12.25% After Trump …
Prediction Markets & Event Contracts
Fed Hike Odds at 57% After Warsh: England Surges 12.9%, …
Prediction Markets & Event Contracts
ATFX Suspends Prop Trading Unit ATFunded -- Full Review …
Funded Trading Evaluation Firms
Rubios Good News Within Hours and the 30-Day Math: Why H …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
13 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #2 (permalink)
 
Massive l's Avatar
 Massive l 
OR/USA
Legendary /NQ Trader
 
Experience: None
Posts: 2,129 since Mar 2011
Thanks Given: 1,859
Thanks Received: 5,108

I believe you type in the indicator name and then () after it


Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #3 (permalink)
situhold
calgary ab/canada
 
Posts: 3 since Aug 2014
Thanks Given: 1
Thanks Received: 0


Hi,
There must something wrong I type in the code, it shows high-light red on "myindicator1"
Def test=reference myindicator1();
Please correct me.
Thanks


Reply With Quote
  #4 (permalink)
 
Massive l's Avatar
 Massive l 
OR/USA
Legendary /NQ Trader
 
Experience: None
Posts: 2,129 since Mar 2011
Thanks Given: 1,859
Thanks Received: 5,108

Referencing Pre-Defined Studies
thinkScript allows you to reference studies that are already available on the Charts tab in your code. You use the reference keyword to do this.
plot SMA = reference simplemovingavg;
or
plot SMA = simplemovingavg();
will plot a simple moving average with the default parameters of that study. So long as the study name is followed by parentheses, you don't need to include the word 'reference'. You can change the parameters of the study within reference by inputting them between parentheses.
plot SMA = simplemovingavg(price = volume, length = 20);
will plot a 20 day moving average of the volume. To see the input parameters of a particular study, click on that study in the 'Edit Studies' section of the Charts tab. You will see the available parameters listed in the study properties section.

By default, the first plot of a study is always referenced. However, you can specify the plot you want to reference, as well.
plot bear = reference ElderRay."BearPower"

plot bear = ElderRay(length = 6)."BearPower"


Visit my NexusFi Trade Journal Reply With Quote




Last Updated on September 12, 2014


© 2026 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 - Downloads - Top
no new posts