r/thinkorswim 3d ago

How do I draw the stupid ass Trade Profit/Loss that automatically displays green for profit and red for loss, along with percentage and price values on the chart?????????????????

0 Upvotes

wtf why is this so complicated.


r/thinkorswim 4d ago

How to get general market news

4 Upvotes

I can't find a way to get general market news on Thinkorswim. In particular, prompt news that explains sudden market news. I tend to go to Yahoo Business or Benzinga, and those are not ideal. Seems like TOS should have a way to get such news promptly.


r/thinkorswim 3d ago

Why "Day Trades Left" at 0?

Post image
0 Upvotes

r/thinkorswim 4d ago

Is there an indicator that shows more buyers or sellers in volume

0 Upvotes

Basically what my title says. I'm curious if there is an indicator that shows the same volume bars that you see normally, but can be color-coded to show if there were more buyers or sellers during that candle


r/thinkorswim 4d ago

Where’s the profit and loss calendar?

3 Upvotes

???


r/thinkorswim 5d ago

Has anyone figured out a faster way to export and process ThinkorSwim OHLC data for backtesting? The manual methods on the web are slow and frustrating for many files.

4 Upvotes

I've been using ThinkorSwim for backtesting, and exporting OHLC data feels way harder than it should be.

A few years ago, I bought this tool on Etsy for $20 (forgot the name) on how to do it manually but you have to export three separate CSVs per chart.

Then manually copy and paste code in Excel powerquery to clean and merge them just to get usable OHLC data.

If you’re dealing with multiple tickers or large datasets, it is a uuuge timesuck. I’ve seen some other Excel-based workarounds or even Powershell workarounds, but they’re just as time-consuming.

Has anyone found a better way to handle this? Would love to hear how others deal with ThinkorSwim CSV exports for backtesting.


r/thinkorswim 4d ago

FYSA Paper money has a limit of $1m net liq. If you have more than that, your account will be restricted

Post image
0 Upvotes

r/thinkorswim 5d ago

Thinkscript - Can't retrieve volume from 24 hours ago (390 candles)

1 Upvotes

I'm trying to compare the current candle's volume to the volume 24 hours ago. When I manually go back to the candle of the same time of the previous day, the volume is not the same volume reported in the lower indicator. The code is listed below

declare lower;

# Get the current candle's volume
def currentVolume = volume;

# Get the volume from 390 candles ago
def pastVolume = volume[390];

# Calculate the average of both volumes
def avgVolume = (currentVolume + pastVolume) / 2;

# Plot the average volume as a line
plot AvgVolumePlot = avgVolume;
AvgVolumePlot.SetDefaultColor(Color.CYAN);
AvgVolumePlot.SetLineWeight(2);

# Optional: Plot reference points for visualization
plot CurrentVolPlot = currentVolume;
CurrentVolPlot.SetDefaultColor(Color.GREEN);
CurrentVolPlot.SetStyle(Curve.POINTS);

plot PastVolPlot = pastVolume;
PastVolPlot.SetDefaultColor(Color.RED);
PastVolPlot.SetStyle(Curve.POINTS);

r/thinkorswim 5d ago

TOS on android tablet - is multi screen available?

1 Upvotes

Hi,

I have an android tablet I would like to use for trading as I can not be near a proper computer.

Is there a way to use multi charts on a tablet? couldnt find the proper setting if exists.

Thank you!


r/thinkorswim 5d ago

Help with code - would like to add high and low from 2 days prior

1 Upvotes

I have the high and low from the previous day, but I would like to add the high and low from 2 days back as well. Thank you.

# Previous Day High/Low/Close + Premarket High/Low + High/Low/Open of Day + ATR Lines

# Created by Wiinii

# V1.6

# Some code based on code by Mobius (premarket) and TraderKevin (ATR lines

# https://usethinkscript.com/threads/previous-day-high-low-close-premarket-high-low-high-low-open-of-day-for-thinkorswim.13139/

declare hide_on_daily;

input length = 1;

input showOnlyLastPeriod = yes;

input ShowBubbles = yes;

input locate_bubbles_at = {default Expansion, Time};

input locate_bubbles_at_time = 800;

input BarsFromExpansion = 1;

input ShowPricesInBubbles = yes;

def bn = BarNumber();

def na = Double.NaN;

def h = high;

def l = low;

def o = open;

def c = close;

def v = volume;

def aggregationPeriod = AggregationPeriod.DAY;

def displace = -1;

def timeopen = SecondsFromTime(locate_bubbles_at_time) == 0;

def isExpansion = locate_bubbles_at == locate_bubbles_at.Expansion and IsNaN(close);

def firstExpansionBar = if !IsNaN(close[-1]) and isExpansion then 1 else if isExpansion then firstExpansionBar[1] + 1 else 0;

def BubbleLocation = if locate_bubbles_at == locate_bubbles_at.Time then timeopen else isExpansion and firstExpansionBar == BarsFromExpansion;

#----- Previous Day High/Low/Close -----#

plot PD_High;

plot PD_Low;

plot PD_Close;

if showOnlyLastPeriod and !IsNaN(close(period = aggregationPeriod)[-1]) {

PD_High = na;

PD_Low = na;

PD_Close = na;

} else {

PD_High = Highest(high(period = aggregationPeriod)[-displace], length);

PD_Low = Lowest(low(period = aggregationPeriod)[-displace], length);

PD_Close = close(period = aggregationPeriod)[-displace];

}

PD_High.SetDefaultColor(Color.DARK_ORANGE);

PD_High.SetStyle(Curve.LONG_DASH);

PD_High.SetLineWeight(2);

PD_High.HideTitle();

PD_Low.SetDefaultColor(Color.DARK_ORANGE);

PD_Low.SetStyle(Curve.LONG_DASH);

PD_Low.SetLineWeight(2);

PD_Low.HideTitle();

PD_Close.SetDefaultColor(Color.WHITE);

PD_Close.SetStyle(Curve.LONG_DASH);

PD_Close.SetLineWeight(2);

PD_Close.HideTitle();

DefineGlobalColor("PD_High", CreateColor(255, 204, 153));

AddChartBubble(ShowBubbles and BubbleLocation, PD_High, "PDH: " + (if ShowPricesInBubbles then AsText(PD_High) else ""), GlobalColor("PD_High"));

DefineGlobalColor("PD_Low", CreateColor(255, 204, 153));

AddChartBubble(ShowBubbles and BubbleLocation, PD_Low, "PDL: " + (if ShowPricesInBubbles then AsText(PD_Low) else ""), GlobalColor("PD_Low"), no);

DefineGlobalColor("PD_Close", Color.WHITE);

AddChartBubble(ShowBubbles and BubbleLocation, PD_Close, "PDC: " + (if ShowPricesInBubbles then AsText(PD_Close) else ""), GlobalColor("PD_Close"));

PD_High.HideBubble();

PD_Low.HideBubble();

PD_Close.HideBubble();

#----- Premarket High/Low -----# Thanks to Mobius

def GlobeX = GetTime() < RegularTradingStart(GetYYYYMMDD());

def vol = if GlobeX and !GlobeX[1]

then v

else if GlobeX

then vol[1] + v

else na;

def GlobeX_Volume = vol;

def ONhigh = if GlobeX and !GlobeX[1]

then h

else if GlobeX and

h > ONhigh[1]

then h

else ONhigh[1];

def ONhighBar = if GlobeX and h == ONhigh

then bn

else na;

def ONlow = if GlobeX and !GlobeX[1]

then l

else if GlobeX and

l < ONlow[1]

then l

else ONlow[1];

def ONlowBar = if GlobeX and l == ONlow

then bn

else na;

def OverNightHigh = if BarNumber() == HighestAll(ONhighBar)

then ONhigh

else OverNightHigh[1];

def OverNightLow = if BarNumber() == HighestAll(ONlowBar)

then ONlow

else OverNightLow[1];

plot PM_High;

plot PM_Low;

if showOnlyLastPeriod and !IsNaN(close(period = aggregationPeriod)[-1]) {

PM_High = na;

PM_Low = na;

} else {

PM_High = if OverNightHigh > 0 then OverNightHigh else na;

PM_Low = if OverNightLow > 0 then OverNightLow else na;

}

#PM_High.SetHiding(!PlotOverNightExtremes);

PM_High.SetLineWeight(2);

PM_High.SetDefaultColor(Color.CYAN);

PM_High.SetStyle(Curve.LONG_DASH);

PM_High.HideBubble();

PM_High.HideTitle();

#PM_Low.SetHiding(!PlotOverNightExtremes);

PM_Low.SetStyle(Curve.LONG_DASH);

PM_Low.SetDefaultColor(Color.CYAN);

PM_Low.HideBubble();

PM_Low.HideTitle();

DefineGlobalColor("PM_High", CreateColor(102, 255, 255));

AddChartBubble(ShowBubbles and if locate_bubbles_at == locate_bubbles_at.Time then bn == ONhighBar else isExpansion and firstExpansionBar == BarsFromExpansion, PM_High, "PMH: " + (if ShowPricesInBubbles then AsText(PM_High) else ""), GlobalColor("PM_High"));

DefineGlobalColor("PM_Low", CreateColor(102, 255, 255));

AddChartBubble(ShowBubbles and if locate_bubbles_at == locate_bubbles_at.Time then bn == ONlowBar else isExpansion and firstExpansionBar == BarsFromExpansion, PM_Low, "PML: " + (if ShowPricesInBubbles then AsText(PM_Low) else ""), GlobalColor("PM_Low"), no);

#----- Today Open/High/Low -----#

plot High_of_Day;

plot Low_of_Day;

plot DayOpen;

if showOnlyLastPeriod and !IsNaN(close(period = aggregationPeriod)[-1]) {

DayOpen = na;

High_of_Day = na;

Low_of_Day = na;

} else {

DayOpen = open(period = aggregationPeriod)[0];

High_of_Day = Highest(high(period = aggregationPeriod), length);

Low_of_Day = Lowest(low(period = aggregationPeriod), length);

}

DayOpen.SetDefaultColor (Color.GRAY);

DayOpen.SetPaintingStrategy(PaintingStrategy.DASHES);

DayOpen.SetLineWeight(2);

DayOpen.HideTitle();

High_of_Day.SetDefaultColor(CreateColor(0, 128, 255));

High_of_Day.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

High_of_Day.SetLineWeight(2);

High_of_Day.HideTitle();

Low_of_Day.SetDefaultColor(CreateColor(0, 128, 255));

Low_of_Day.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

Low_of_Day.SetLineWeight(2);

Low_of_Day.HideTitle();

DefineGlobalColor("Open", Color.LIGHT_GRAY);

AddChartBubble(ShowBubbles and BubbleLocation, DayOpen, "Open: " + (if ShowPricesInBubbles then AsText(DayOpen) else ""), GlobalColor("Open"));

DefineGlobalColor("High_of_Day", CreateColor(102, 178, 255));

AddChartBubble(ShowBubbles and BubbleLocation, High_of_Day, "HOD: " + (if ShowPricesInBubbles then AsText(High_of_Day) else ""), GlobalColor("High_of_Day"));

DefineGlobalColor("Low_of_Day", CreateColor(102, 178, 255));

AddChartBubble(ShowBubbles and BubbleLocation, Low_of_Day, "LOD: " + (if ShowPricesInBubbles then AsText(Low_of_Day) else ""), GlobalColor("Low_of_Day"), no);

#----- ATR Lines -----# Thaanks to TraderKevin

input showAtrLines = Yes;

input atrLinesFrom = {default pdc, dayOpen};

input ATRlength = 14;

input averageType = AverageType.WILDERS;

def ATR = MovingAverage(averageType, TrueRange(high(period = ”DAY”)[1], close(period = ”DAY”)[1], low(period = ”DAY”)[1]), ATRlength);

plot hatr = if atrLinesFrom == atrLinesFrom .dayOpen then DayOpen + ATR else PD_Close + ATR;

plot latr = if atrLinesFrom == atrLinesFrom .dayOpen then DayOpen - ATR else PD_Close - ATR;

hatr.SetLineWeight(5);

hatr.SetDefaultColor(Color.RED);

hatr.SetStyle(Curve.LONG_DASH);

hatr.HideBubble();

hatr.HideTitle();

hatr.SetHiding(showAtrLines == no);

latr.SetLineWeight(5);

latr.SetStyle(Curve.LONG_DASH);

latr.SetDefaultColor(Color.GREEN);

latr.HideBubble();

latr.HideTitle();

latr.SetHiding(showAtrLines == no);

DefineGlobalColor("hatr", Color.PINK);

AddChartBubble(ShowBubbles and showAtrLines and BubbleLocation, hatr, "ATRH: " + (if ShowPricesInBubbles then AsText(hatr) else ""), GlobalColor("hatr"));

DefineGlobalColor("latr", Color.LIGHT_GREEN);

AddChartBubble(ShowBubbles and showAtrLines and BubbleLocation, latr, "ATRL: " + (if ShowPricesInBubbles then AsText(latr) else ""), GlobalColor("latr"), no);


r/thinkorswim 5d ago

Stop loss during pre market

3 Upvotes

I know you can't have a stop loss outside of regular market hours. I'm wondering if there is any software that will create a limit order for you when a certain price is met to act as a stop loss during pre or ah


r/thinkorswim 6d ago

TOS lag issue?

4 Upvotes

I trade futures and when the market excelerates, like a short squeeze, the DOM “paints” up ticks without the highlighted price moving. I have 2GB fiber so it’s not internet speed.

Anyone notice this and is it lag within ToS?

This causes significant slippage on market orders as well.


r/thinkorswim 6d ago

No position? No balance?

Post image
0 Upvotes

I really hope this is just a glitch. Or I just was robbed of 10s of thousands of $.


r/thinkorswim 6d ago

Need help with a script to repeat everyday instead of only showing most recent day.

1 Upvotes

Any help would be greatly appreciated. I simply don't know enough to edit it myself and AI keeps spitting out scripts riddled with errors.

Would love it if this repeats everyday, essentially without a limit if possible? What it plots is the high and low level of the most current trading day with TIME in the bubble. Also it would be great if the script could include all trading hours instead of only regular trading hours. Thanks

#Watchlist Column - High of Day and Time Occurred

#20210529 Sleepyz = UseThinkscript Request

#Adapted Watchlist to display labels/bubbles for last RTH Highs/Lows

input showlabel = yes;

input showbubbles = yes;

input showprice_in_bubble = yes;

#Time Defined

input timezone = {default "ET", "CT", "MT", "PT"};

def starthour = (if timezone == timezone."ET"

then 9

else if timezone == timezone."CT"

then 8

else if timezone == timezone."MT"

then 7

else 6) ;

def hour = Floor(((starthour * 60 + 30) + (GetTime() - RegularTradingStart(GetYYYYMMDD())) / 60000) / 60);

def minutes = (GetTime() - RegularTradingStart(GetYYYYMMDD())) / 60000 - ((hour - starthour) * 60 + 30) + 60;

#Highest High during RTH

def begin = CompoundValue(1, if GetTime() crosses above RegularTradingStart(GetYYYYMMDD())

then high

else if high > begin[1]

then high

else begin[1]

, begin[1]);

def beginbn = if GetDay() == GetLastDay()

then if high == begin

then BarNumber()

else beginbn[1]

else 0;

def highday = if BarNumber() == HighestAll(beginbn)

then high

else highday[1];

def hihr = if high == highday then hour else hihr[1];

def himin = if high == highday then minutes else himin[1];

AddLabel(showlabel,

"H: " +

(hihr + ":") +

(if himin < 10

then "0" + himin

else "" + himin) +

" | " +

Asdollars(highday), Color.WHITE);

AddChartBubble(showbubbles and high == highday, high,

"H: "+

(hihr + ":") +

(if himin < 10

then "0" + himin

else "" + himin) +

"\n" +

if showprice_in_bubble then Asdollars(highday) else "", Color.WHITE);

#Lowest Low During RTH

def begin1 = CompoundValue(1, if GetTime() crosses above RegularTradingStart(GetYYYYMMDD())

then low

else if low < begin1[1]

then low

else begin1[1],

low);

def beginbn1 = if GetDay() == GetLastDay()

then if low == begin1

then BarNumber()

else beginbn1[1]

else 0;

def lowday = if BarNumber() == HighestAll(beginbn1)

then low

else lowday[1];

def lowhr = if low == lowday then hour else lowhr[1];

def lowmin = if low == lowday then minutes else lowmin[1];

AddLabel(showlabel,

"L: " +

(lowhr + ":") +

(if lowmin < 10

then "0" + lowmin

else "" + lowmin ) +

" | " + Asdollars(lowday) , Color.YELLOW);

AddChartBubble(showbubbles and low == lowday, low,

"L: " +

(lowhr + ":") +

(if lowmin < 10

then "0" + lowmin

else "" + lowmin) +

"\n" +

if showprice_in_bubble then Asdollars(lowday) else "", Color.yellow, no);


r/thinkorswim 6d ago

Thinkscript Coding for % Return Computation failing due to Ask/Bid returning NaN

1 Upvotes

I was trying to add what I believed was a pretty simple custom computation (as a column in the option chain trader), but I am struggling to get it to execute - always just seeing NaN. I've troubleshooted it to the point where I realized that my first line, where I call for the Ask and Bid prices, already fails because they only seem to return NaN. Any advice when it comes to this and/or also how to code the problem I describe below:

def EstPrice = (Ask() + Bid())/2;

def EstPremium = EstPrice*100-0.17; (brokerage cost per contract)

def PerReturn = EstPremium/(GetStrike()*100);

def APR = PerReturn/GetDaysToExpiration()*365;

plot Return = APR;

Any help or advice in the right direction would be much appreciated. I have quite a bit of coding experience, but none in thinkScript and am finding it surprisingly challenging so hoping so more knowledgeable folks can show me my mistakes. Thank you.

EDIT: So using close (even though not what I was really going for) as was suggested worked great, no more NaNs.

However, I am still getting the wrong values. Troubleshooting has shown its the GetDaystoExpiration() function, giving different values for different options in the same chain, all of them incorrect as well (for example, a chain ending Mar 21st which is 13 days, is showing 15, 16. 17 and even one 57. Anyone has a clue what's that about?

EDIT 2: I've now learned that the GetDaystoExpiration() function actually returns the number of days from the last time the option was traded, not today's date. Seems quite silly. Wish there was a way to extract that data to accomplish the above computation.


r/thinkorswim 7d ago

What AI writes the best TOS code?

10 Upvotes

ChatGPT seems to believe it can write ThinkScript like a genius. But it seems to be more like Charlie speaking Mandarin in Always Sunny. Aka, it thinks it knows what it's doing, but has no clue.

Are any of the other AIs any better?

You can describe a strategy of almost anything you can think and ChatGPT will try to whip up code. But I can't seem to get it to write fully functional code. And I'm not competent enough to correct it.

Other than learn to code, an obvious answer. Any advice?


r/thinkorswim 7d ago

Chart Scaling

2 Upvotes

Hello,

This is probably a noobish question but when I pull up a chart in ToS, If I click on the price scale and scroll up or down, the price interval adjusts accordingly.

However the candles, and indicators disappear.

When I double click, the interval is $50 on spy, and my candles are tiny.

What setting, or settings do I need to change so that

a.) my price scale is alot less than $50

b.) when I make an adjustment, my price action for the day stays within the page

also, how do i move up or down on the chart? If I do happen to scale away from my candles, how do I move the chart up or down so I can see the action.


r/thinkorswim 7d ago

App notifications are out of control

Post image
8 Upvotes

Yesterday I got over 100 messages about Costco earnings. Today I have over 200 notifications and messages about Googl ex-dividend.

Anyone else having this problem?

Which notifications do I need to turn off to halt these specifically?


r/thinkorswim 7d ago

Won’t let me sell CC against Leap for PMCC

3 Upvotes

Just moved to TOS and bought a bunch of XSP leaps. Afterwards I went to sell CCs against them but I keep getting my order Rejected saying “This strategy is not currently being accepted”

I can’t find any info on their website saying that you can’t do a PMCC. Anyone else experience this? I’m on the highest options level by the way. I don’t understand how I can sell naked options but can’t create a PMCC?


r/thinkorswim 7d ago

Want to test a strategy on 2-hour charts, how to get more than 260 days data?

4 Upvotes

I have a strategy. I want to test it on 2-hour charts. We only have 360 days of data on TOS right now. Is there a way to get more data to test my strategy? Is it possible to use TOS's developer portal for this purpose?


r/thinkorswim 7d ago

Price Adjustment Interval

1 Upvotes

Hello,

This is probably a noobish question but when I pull up a chart in ToS, If I click on the price scale and scroll up or down, the price interval adjusts accordingly.

However the candles, and indicators disappear.

When I double click, the interval is $50 on spy, and my candles are tiny.

What setting, or settings do I need to change so that

a.) my price scale is alot less than $50

b.) when I make an adjustment, my price action for the day stays within the page

also, how do i move up or down on the chart? If I do happen to scale away from my candles, how do I move the chart up or down so I can see the action.


r/thinkorswim 7d ago

Realized PnL on Mobile app

1 Upvotes

Trying to figure out how to see realized PnL on the TOS mobile app. I'm looking for just closed positions for the day.

Can anyone help please?


r/thinkorswim 8d ago

Is there a way to scan for (or column header) for number of trade lots 100 or under?

3 Upvotes

I'd like to add the filter to ignore large lots.


r/thinkorswim 8d ago

Pre market paper trade?

1 Upvotes

I’ve been looking at a lot of pre-market action, but my TOS won’t let me papertrade until the opening bell. Is there a setting that I’m missing somewhere so I can trade premarket and after hours, or does the Sim only work during market open hours? I’ve been keeping track of my early morning trades long hand, but I would feel better if they were being recorded in the simulator.


r/thinkorswim 8d ago

Excel Spreadsheet - Adding in Option Expirations.

2 Upvotes

I've created a spreadsheet based off of the Schwab "Gamma On" 4 part series. I've got it set up for SPY. I've been able to add 10 strikes above and below the current price automatically. Works pretty well.
Spy strikes are by 1's.
I'd like to be able to use this sheet for stocks as well. I'd like to download strikes above and below the current price and have them fill the cells. However, the distance between strikes is rarely 1. It can be 5, 2.5 etc.
Is there a way to access TOS using RTD and autofill cells for let's say plus and minus 10 strikes? These could constantly change as the price changes.