Why is this not working help

EddieM

New member
Plus
I have this working in paper money it shows me the PL live as I am trading. Shows my money up or down in green or red and my buy in amount I am at. Th gray area title on the end.
But now I moved to live trading and it is not working? Even the time in is not working but it all still works in paper trading.

How can I get it working in live trading?

It is this part that is not working it seems - it just stays gray no matter what with no numbers showing and the time in is not changing to the current buy in time as it dose in paper money working right.
_______________
AddLabel(1, "Qty: " + GetQuantity() +
" Avg $" + Entry +
" P/L: " + AsDollars(PL) + " Max L: " + AsDollars(Entry * GetQuantity()),
if PL == 0 then Color.GRAY
else if PL > 0 then Color.GREEN
else Color.RED);

addlabel(1,
" In: " + ( barssince * chartmin) + " minutes",
if GetOpenPL() > 0 then Color.yellow else Color.yellow);
__________________________

Screenshot 2024-11-14 at 10.27.31 AM.png


Here is the share link
https://tos.mx/!IhORQ6dE

--------------------
#PL_label_days2

#https://usethinkscript.com/threads/changes-days-to-minutes-in-p-l-label.19791/#post-146834
# 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 na = double.nan;
def bn = barnumber();

# get chart agg time
def chartagg = GetAggregationPeriod();
def chartmin = chartagg / (1000 * 60);

input use_line_limits = yes;#Yes, plots line from/to; No, plot line across entire chart
input linefrom = 100;#Hint linefrom: limits how far line plots in candle area
input lineto = 12;#Hint lineto: limits how far into expansion the line will plot

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 bn else LastEntryBar[1];

def barssince = bn - lastentrybar;

plot Entry_ = if bn >= 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(2);
Entry_.SetDefaultColor(Color.white);
Entry_.HideBubble();
Entry_.HideTitle();

plot "1% Stop" = if Entry_ then Entry_ - .01 * Entry else Double.NaN;
"1% Stop".SetDefaultColor(Color.RED);

plot "1% Target" = if Entry_ then Entry_ + .01 * Entry else Double.NaN;
"1% Target".SetDefaultColor(Color.GREEN);

plot "10% Target" = if Entry_ then Entry_ + .10 * Entry else Double.NaN;
"10% Target".SetDefaultColor(Color.YELLOW);

plot "15% Target" = if Entry_ then Entry_ + .15 * Entry else Double.NaN;
"15% Target".SetDefaultColor(Color.MAGENTA);

plot "20% Target" = if Entry_ then Entry_ + .20 * Entry else Double.NaN;
"20% Target".SetDefaultColor(Color.RED);

input balance = 1000;
def current_price = close;
def limit = balance / current_price;

AddLabel(yes, Concat("Money = ", RoundDown(balance)), Color.MAGENTA);
AddLabel(yes, Concat("Can buy: " , RoundDown(limit)) + " Shares", Color.WHITE);

AddLabel(1, "Qty: " + GetQuantity() +
" Avg $" + Entry +
" P/L: " + AsDollars(PL) + " Max L: " + AsDollars(Entry * GetQuantity()),
if PL == 0 then Color.GRAY
else if PL > 0 then Color.GREEN
else Color.RED);

addlabel(1,
" In: " + ( barssince * chartmin) + " minutes",
if GetOpenPL() > 0 then Color.yellow else Color.yellow);
 

Attachments

  • Screenshot 2024-11-14 at 10.10.56 AM.png
    Screenshot 2024-11-14 at 10.10.56 AM.png
    94.6 KB · Views: 17
Last edited:

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

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
418 Online
Create Post

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