I am afraid I already know the answer but in hopes that I am wrong, here is my question: Can I set up a watchlist displaying gains and losses?
The label displays correctly on my charts with no errors.
But it gives the error:
when I attempt to load the script into a watchlist field.
Here is my custom field:
I get around the problem by keeping a detached monitor screen up. But it is a poor substitute for my watchlist which has all my stocks and sell indicators. It would be helpful to see my current gains in the field next to my sell indicators when I am making quick decisions.
How do other people get around watching all the stocks they have in play?
The label displays correctly on my charts with no errors.
But it gives the error:
no such function getaverageprice no such function getquantity
when I attempt to load the script into a watchlist field.
Here is my custom field:
Code:
def cost = GetAveragePrice();
def qty = GetQuantity();
def purchase = qty * cost ;
def present = qty * close ;
plot gainloss = present - purchase ;
gainloss.Hide();
def GLpct = Round(gainloss / purchase, 3) ;
AddLabel(yes, "gain " + gainloss + " " + AsPercent(GLpct), if gainloss > 0 then Color.GREEN else Color.RED );
I get around the problem by keeping a detached monitor screen up. But it is a poor substitute for my watchlist which has all my stocks and sell indicators. It would be helpful to see my current gains in the field next to my sell indicators when I am making quick decisions.
How do other people get around watching all the stocks they have in play?
Last edited: