NexusFi: Find Your Edge


Home Menu

 





ThinkScript Portfolio Functions Broken?


Discussion in ThinkOrSwim

Updated
    1. trending_up 3,969 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 1 attachments




 
Search this Thread

ThinkScript Portfolio Functions Broken?

  #1 (permalink)
kula
Houston Texas
 
Posts: 2 since Sep 2016
Thanks Given: 0
Thanks Received: 0

Hi,

Has anyone had success with the ThinkScript Portfolio functions? GetAveragePrice(), GetQuantity(), or GetOpenPL()? TOS keeps giving me no such function errors when trying to use them.

I'm trying to make a simple script on a watchlist or marketwatch column that takes the OpenPL / Trade Price * 100 so I can easily see the % of profits for my covered calls and naked puts so I know if I should close them out if I get good gains and have plenty of DTE. Problem is that I can't seem to get any qty, price, or PL data from my current positions (though I can get all kinds of other data). Is this possible or does TOS have these functions locked down? If so, does anyone know of a clever workaround?

Any help would be greatly appreciated! Thanks!

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
MC PL editor upgrade
MultiCharts
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
 
  #2 (permalink)
kula
Houston Texas
 
Posts: 2 since Sep 2016
Thanks Given: 0
Thanks Received: 0

Ok, I figured out that the portfolio functions only work in custom studies for the chart. I've got my percentage showing as a label on the chart, but anyone know of a way to get it into a column on the watchlist or marketwatch grids? I can't use those functions or my custom study outside of the chart for some reason. It's silly, because I can add the individual fields that I want to the MarketWatch grid, I just can't use any of those fields for calculation.

Reply With Quote
  #3 (permalink)
Alcoa1
Dallas
 
Posts: 1 since Aug 2017
Thanks Given: 0
Thanks Received: 0


As a test of the function GetAveragePrice, I generated this ThinkOrSwim script
def AP = GetAveragePrice();
plot AP_ = AP;

Here's the script.
The output for AP doesn't make any sense.
Does anyone understand it?

Attached Thumbnails
Click image for larger version

Name:	TOS_Study_GetAveragePrice.jpg
Views:	429
Size:	136.9 KB
ID:	240172  
Reply With Quote




Last Updated on August 15, 2017


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts