Show trades on ThinkorSwim chart screen?

W

wcsharron

New member
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.
 
W

wcsharron

New member
Got 50.00 via venmo for anyone that can come up with this solution - just saying, it is that frustrating to me.
 
mc01439

mc01439

Well-known member
2019 Donor
VIP
Go to chart settings under the General tab and check "Show Trades" on the mid-right.
 
W

wcsharron

New member
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.
 
W

wcsharron

New member
Thanks! I am hoping someone has a thought around this!
 
BenTen

BenTen

Administrative
Staff
VIP
@wcsharron Aside from what @mc01439 mentioned, I don't think you can code your trade history onto the chart.
 
M

mashume

Active 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:
W

wcsharron

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

Thank you!
-Chris
 
W

wcsharron

New member
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.
 
P

planethouse

New member
me too - got $50 venmo for anyone that can code this... f'ing absurd that TD does not simply have this as a check box... we're up to $100 with user: wcsharron and my $
 
S

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:
W

wcsharron

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
Correct - something like this. Basically what they have on the mobile version. So i know it can be done!
 
K

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.
 
B

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.
 
I

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
 
W

wcsharron

New member
Still hunting. For clarity, TOS can show you the price of a purchase and sale in the platform....it has the green arrow up or down for Sale.

I am looking for something similar to when you have an order in place that shows the horizontal line of the trade executed.

Still in to pay anyone who can figure this out.

Thanks!
 
P

Pensar

Active member
VIP
Still hunting. For clarity, TOS can show you the price of a purchase and sale in the platform....it has the green arrow up or down for Sale.

I am looking for something similar to when you have an order in place that shows the horizontal line of the trade executed.

Still in to pay anyone who can figure this out.

Thanks!
@wcsharron Maybe look at this post, or you could try the modified code below that I have lately been using.
Note: Please ensure that the below study plots correctly before using.

Code:
# Average Actual Entry
# Mobius
# 01.01.2018

# Removed portions of Mobius' code, added quantity and replaced Mobius' P/L
# calculation with GetOpenPL().
# Color-coded label, edited study look/colors for personal preference

def PL = GetOpenPL();
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.SHORT_DASH);
     Entry_.SetLineWeight(3);
     Entry_.SetDefaultColor(color.BLUE);
     Entry_.HideBubble();
     Entry_.HideTitle();

AddLabel(1, "Qty: " + GetQuantity() + 
         "   Avg Cost $" + Entry +
         "   P/L: " + AsDollars(PL),
         if PL == 0 then color.cyan
         else if PL > 0 then color.green 
         else color.red);
# end code
 
Last edited:
W

wcsharron

New member
This worked!!!!!
Had to buy and sell a few single shares to test, but worth it! Send me a PM with your Venmo and I will send back some cash.

Thank you!!
-Chris
 

Similar threads

Top