• Get $40 off VIP by signing up for a free account! Sign Up

Schwab Non-working ThinkScript Portfolio Functions In ThinkOrSwim

Mark1126

New member
Code:
#Example of Average Entry Price with stops

 # Plotting Average Actual Entry with ATR stops

# Mobius

# 01.01.2018

input AtrMultiplier = 2.00;

input Atr_Length = 5;

input Dir = {default long, short};

 plot hide = double.nan;

     hide.setDefaultColor(Color.Black);

def c = if isNaN(close[-1]) then close else c[1];

def ATR = Average(TrueRange(high, close, low), Atr_Length) * AtrMultiplier;

def Entry = if isNaN(GetAveragePrice())

            then Entry[1]

            else GetAveragePrice();

def LastEntryBar = if Entry != Entry[1]

                   then barNumber()

                   else LastEntryBar[1];

plot Entry_ = if barNumber() >= HighestAll(LastEntryBar) and Entry > 0

              then highestAll(if isNaN(close[-1])

                              then Entry

                              else double.nan)

              else double.nan;

     Entry_.SetStyle(Curve.Long_Dash);

     Entry_.SetLineWeight(3);

     Entry_.SetDefaultColor(CreateColor(255,215,0));

     Entry_.HideBubble();

     Entry_.HideTitle();

def PL = if Entry > 0 then Entry - c else 0;

#AddChartBubble(barNumber() == HighestAll(barNumber()), Entry_, "AVG " + AsDollars(Entry), Entry_.TakeValueColor());

plot stop;

     stop.SetLineWeight(2);

     stop.SetdefaultColor(color.red);

switch (Dir)

{

case long:

    stop = if barNumber() >= HighestAll(LastEntryBar) and Entry > 0

           then highestAll(if isNaN(close[-1])

                           then Entry - ATR

                           else double.nan)

           else double.nan;;

case short:

    stop = if barNumber() >= HighestAll(LastEntryBar) and Entry > 0

           then highestAll(if isNaN(close[-1])

                           then Entry + ATR

                           else double.nan)

           else double.nan;;

}



plot tgt;

     tgt.SetLineWeight(2);

     tgt.SetdefaultColor(color.green);

switch (Dir)

{

case long:

    tgt = if barNumber() >= HighestAll(LastEntryBar) and Entry > 0

           then highestAll(if isNaN(close[-1])

                           then Entry + ATR

                           else double.nan)

           else double.nan;;

case short:

    tgt = if barNumber() >= HighestAll(LastEntryBar) and Entry > 0

           then highestAll(if isNaN(close[-1])

                           then Entry - ATR

                           else double.nan)

           else double.nan;;

}

# End Code
Since moving to Schwab, this plots in paper trading but not live trading. I've recopied the code, compared all parameter settings between paper vs live, but can't figure out what is preventing the average price horizontal line from displaying on chart. Is anyone else having this issue?
 
Solution
Currently, thinkscript portfolio functions are not executing as they should.
Schwab is still in the midst of integrating portfolio functions with the Schwab back office.

I am 'assuming' that it will be fixed by the time, they push the next build through over next weekend or hopefully sooner.

But this forum has no affiliation with Charles Schwab, so your guess is as good as mine.

@Mark1126 @perroveloz
Hi, since the merge some of my customs labels not working, I wonder if I am the only one of some of you are experimenting the same issue

this an example of the code thats not working for me

def qty = GetQuantity();
def tp = getaveragePrice();

addlabel (yes, qty, color.white);
addlabel (yes, tp, color.white);

I really appreciate your help
 

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

Currently, thinkscript portfolio functions are not executing as they should.
Schwab is still in the midst of integrating portfolio functions with the Schwab back office.

I am 'assuming' that it will be fixed by the time, they push the next build through over next weekend or hopefully sooner.

But this forum has no affiliation with Charles Schwab, so your guess is as good as mine.

@Mark1126 @perroveloz
 
Last edited by a moderator:
Solution
ThinkScript portfolio functions are currently not working.
Schwab has stated: This is a known issue.
Schwab has not said whether these script functions will be available going forward.

Members are using two alternatives to track their trades
detaching the monitor tab, set to Activity and Positions
and/or
creating a watchlist

The watchlist can utilize the separate built-in portfolio functions, which do work. But they cannot be edited or customized.

To see all your holdings in a watchlist
1. click on one of the watchlists at the top of the list: All (or Current) Account Positions
bnJKLWy.png


To populate the watchlist with Portfolio Functions
1. click on the gear to the right of your columns
2. click on Portfolio
4xPxd49.png
 
Last edited by a moderator:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
443 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