How to import existing thinkScript code on ThinkorSwim

try this

CSS:
#// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
#// © blackcat1402
#study("[blackcat] L3 Banker Fund Flow Trend Oscillator", overlay=false)
# Converted and mod by Sam4Cok@Samer800 - 02/2023
# Scan
#input BarColor = yes;
#input SmoothingLength = 13;
def na = Double.NaN;
def last = isNaN(close[1]);
#xrf(values, length) =>
script xrf {
    input values = close;
    input length = 34;
    def r_val;# = float(na)
    r_val = if length >= 1 then
                fold i = 0 to length +1 with p=values do
             if IsNaN(p) or !IsNaN(values[i]) then values[i] else p else Double.NaN;
    plot out = r_val;
}
#xsa(src,len,wei) =>
script xsa {
    input src = close;
    input len = 5;
    input wei = 1;
    def sumf;# = 0.0
    def ma;# = 0.0
    def out;# = 0.0
    sumf = CompoundValue(1, sumf[1] - src[len] + src , src);
    ma   = if IsNaN(src[len]) then Double.NaN else sumf / len;
    out  = if IsNaN(out[1]) then ma else (src * wei + out[1] * (len - wei)) / len;
    plot return = out;
}
def wmCal = (close - Lowest(low, 27)) / (Highest(high, 27) - Lowest(low, 27)) * 100;

#//set up a simple model of banker fund flow trend  
def fundtrend = (3 * xsa(wmCal, 5, 1) - 2 * xsa(xsa(wmCal, 5, 1), 3, 1) - 50) * 1.032 + 50;
#//define typical price for banker fund
def typ = (2 * close + high + low + open) / 5;
#//lowest low with mid term fib # 34
def lol = Lowest(low, 34);
#//highest high with mid term fib # 34
def hoh = Highest(high, 34);
#//define banker fund flow bull bear line
def bullbear = (typ - lol) / (hoh - lol) * 100;
def bullbearline = ExpAverage(bullbear, 13);
#//define banker entry signal
def bankerentry = Crosses(fundtrend, bullbearline, CrossingDirection.ABOVE) and bullbearline < 25;

# Plot the new Chart
#//banker fund entry with yellow candle

plot scan = bankerentry within 3 bars;


#---- END CODE
how do we add this scrip
https://usethinkscript.com/threads/l3-banker-fund-flow-trend-oscillator-for-thinkorswim.14522/
to TOS? I have the VIP membership
 
Last edited by a moderator:
I took the liberty of modifying the popular True Momentum Oscillator by Mobius by making it adaptive to the dominant market cycle. The dominant cycle in this variant is obtained using the band-pass filter method per Chapter 5 of Dr Ehlers' book, "Cycle Analytics for Traders". Here is a screen shot showing the adaptive TMO as the bottom indicator immediately above the volume indicator. Another modification involves replacing the EMA used to smooth the main and signal lines with EhlersSuperSmootherFilter. The SmootherLength is currently set to 6, but can be changed in the properties dialog. Hopefully this adaptive variant will be the game changer you are looking for. Enjoy!

PS - This variant has a property that lets you set the aggregation to a higher time frame. You might consider placing two instances of the indicator on top of each other and setting one to a higher time frame in order to see confluence in the True Momentum Oscillator between the time frames.
Hi Sesqui,
I copied the code
https://usethinkscript.com/threads/adaptive-true-momentum-oscillator-for-thinkorswim.21709/
but am getting some errors. I would appreciate if you can paste the chart link that I can copy and open in shared item. I am looking forward to testing this study.
 
Last edited by a moderator:
The majority of the indicators on this forum require the ability to copy and paste scripts.
Therefore, solving the issues that you are having with copying and pasting is important.

Before jumping to a share link, consider looking into what you are doing to get errors?
@Sesqui's
https://usethinkscript.com/threads/adaptive-true-momentum-oscillator-for-thinkorswim.21709/
has no errors
9X3E2yK.png

When copied correctly, you should not see any errors and the OK button should be green.

Follow the step-by-step instructions here:
https://usethinkscript.com/threads/how-to-import-existing-thinkscript-code-on-thinkorswim.10/
Clicking on the copy to clipboard button will ensure that you are copying the complete code
iNJA4NR.png


If still having difficulty, come back and explain what steps that you took and what errors you are seeing.

@Mpatel
@drivehard18
 
Last edited:
Here is the Strat's "JUST THE 2-2's PLEASE!! with reversals" SCAN for anyone who wants to use it created by CHAT GBT 5:

Code:
# --- Scan: 2D-2U and 2U-2D Reversals (Primary TF only)

def H = high;
def L = low;

# Bar type definitions
def twoup = H > H[1] and L >= L[1];
def twodown = H <= H[1] and L < L[1];

# Bullish reversal
def TwoTwoBull = twoup and twodown[1];

# Bearish reversal
def TwoTwoBear = twodown and twoup[1];

# Scan criteria:
plot scan = TwoTwoBull or TwoTwoBear;
Do you have a TOS link I can use to import properly as a shared item?
 
Do you have a TOS link I can use to import properly as a shared item?

The majority of the indicators on this forum require the ability to copy and paste scripts.
Therefore, solving the issues that you are having with copying and pasting is important.

Follow the step-by-step instructions here:
https://usethinkscript.com/threads/how-to-import-existing-thinkscript-code-on-thinkorswim.10/
Clicking on the copy to clipboard button will ensure that you are copying the complete code
TtxLQyT.png


If still having difficulty, come back and explain what steps that you took and what errors you are seeing.
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
571 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top