• The price of VIP membership is increasing to $199 beginning June 1. Click here to lock in the current rate of $149.

Show trades on ThinkorSwim chart screen?

wcsharron

New member
VIP
Does anyone know how to add a line that shows purchases / Shorts on the screen, similar to how they show on the mobile screen? So it would show a line that extends right at the purchase prices.

Any help is greatly appreciated. By the time i draw a manual line i am sometimes out of the trade.
 

wcsharron

New member
VIP
Yes, that shows it at the top or the bottom of the trade, i am specifically trying to code something that extends a line to the right, exactly at the trade price if that makes sense.
 

falcon

New member
By default, for "Show trades" TOS will add a big text box such as [email protected] on top or bottom of the candle stick. If there are multiple trades on the same minute, they will overlap and be very hard to read.

For each trade, i want to just draw a small symbol (such as a up/down triangle, such as up for buy and down for sell, or other similar) at the prices at that candle on the chart. I just want to know the buy and sell places, not the share sizes.

I have been looking for similar script, but doesn't find any. Can someone help me?
 
Last edited:

mashume

Well-known member
VIP
This ONLY WORKS for showing purchase price if the purchase happened on the chart somewhere, i.e. in the last 5 days if the chart shows 5 days of data.
I can't seem to find position size automatically. You'll need to adjust the input of your position size to match your position (unless you have something entirely other in mind. But give this a try.

IT REQUIRES YOU TO SET THE SIZE
IT REQUIRES THE PURCHASE TO BE ON THE CURRENT CHART
AND IT DOESN"T PLOT THE PAID PRICE EXACTLY

I offer it as a starting point ONLY

I suppose you could always set your expected position size before you enter, so that it'll graph immediately.

Code:
declare upper;

# ThinkOrSwim Mobile Style Position Price Indicator
# For Desktop
# Mashume
# 2020-02-28

declare upper;

input size = 100;

def liq = positionNetLiq();
def position = liq / size;

def enter = if position != 0 then
        if position[1] == 0 then position
        else enter[1]
    else double.nan ;

plot entryPrice = enter;

It only works for securities for which the actual purchase candle appears on the chart.

Additionally, I can't get it to give me a proper calculation for the size of a position given the price when the position was opened. That is, I can get a number, round it, and it displays, graphs, etc.. properly, but I can't use it as a divisor without breaking the position calculation.
THIS DOESN"T WORK. Any ideas?
Code:
def s = if !isnan(liq) then round(liq / ((OPEN + CLOSE) / 2), numberOfDigits = 0) else double.nan;
def position = positionNetLiq() / s;

Happy Trading
Mashume
 
Last edited:

wcsharron

New member
VIP
I have been offline lately, but will take a look. I very much appreciate the start. I will test Monday.

For clarity, I am not looking for historical trades, only for real-time like you see when you trade on the phone - if that helps anyone's ideas on how to solutions this.
 

Stolidude

New member
Trading view does it. Instead of putting annoying bubbles over the cart. Something like if order is placed then paint horizontal line = 1. If order is canceled then paint horizontal line = 0
 
Last edited:

katavasiya

New member
Correct - something like this. Basically what they have on the mobile version. So i know it can be done!
Agree, this is so stupid not to have a line with the number + or - of contracts that you have as a position, which does exist in the mobile. Every other platform has it, it is so basic. I don't think TOS desktop has anything like this and its a shame, considering how much invested in this platform, not to have something as basic as your position on the chart.
 

brownbear311

New member
Hi- Below is what I did to display my Trades on TOS chart. I hope this helps.

Check to see if advanced Features are enabled
  1. Log into TD Ameritrade
  2. Select My profile
  3. Under the general tab, make sure "Advanced Features" is set to "Enabled".
Display on Chart
  1. Click on the Gear
  2. General Tab -> Content ->Display -- Make sure "Show Trades" is checked
  3. Click "Setup" typically in the top right
  4. Save workspace as (enter your name)
  5. Close then restart TOS. I right clicked, run as ADMIN. Idk if it matters.
 

iTrade2

New member
VIP
Thanks for sharing but I am confusing. Can you share with us the screen shot of your set up? My TOS is showing the working order on the chart and I did not have to do anything with this setting at all. Sorry, for some reason I can not attract the screen shot for you to see
 

kalyan

New member
Hello all,

I noticed some useful features on my Webull app that are missing in Thinkorswim. I have attached an image to check if its possible to add these feature on TOS windows program.

1. I would like to see: Profit/Loss dollar estimate on the chart. This changes dynamically as I move the stop loss or take profit level (OCO order).

yInMhjJ.jpg


2. I also want to see my Point of sale (POS) listed on the chart. Once my order fills, there is no mark on TOS chart to see at what level my stock was purchased at. I have to go to monitor tab or order entry to see my Trade price. I attached an image of how POS appears on Webull.

2j0RzFb.jpg


Thank you
 

kalyan

New member
Thanks for the quick reply. I have tried Show trades before but its not accurate. It places a price bubble with arrow pointing to candlestick but its not the actual price level. I have to go back with price level tool to place a line at point of purchase. For example, I bought AAPL at 379.87 but the arrow points no where near 379.87. Also it shows all my previous trades which clutters up the screen if I buy and sell multiple times in a day. I have attached a screenshot of my TOS. It will be nice if it showed only the current POS price level on the chart.

U5Purd1.jpg
 

Pensar

Well-known member
VIP
@kalyan Try this code by Mobius -

Code:
# Plotting Average Actual Entry
# Mobius
# 01.01.2018

input HardStop = 3.00;
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 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());
#Alert(c crosses below Entry, "", Alert.Bar, Sound.Chimes);
#Alert(c crosses above Entry, "", Alert.Bar, Sound.Ring);
plot stop;
switch (Dir)
{
case long:
    stop = Entry_ - HardStop;
case short:
    stop = Entry_ + HardStop;
}
#Alert(close crosses stop, "STOP", Alert.Bar, Sound.Bell);
# End Code

Also, try creating a watchlist and select "current account positions". Then, choose your desired columns, such as "Avg Price", "P/L %", "P/L Open", etc.
 

Similar threads

Top