Input Value on Chart Label

M

machie38

New member
Is there anyway you can input a value on a chart label without going to the study setup??
 
rad14733

rad14733

Active member
VIP
Is there anyway you can input a value on a chart label without going to the study setup??
Edited: You can select Text Note from the Tools menu... Select the "T" symbol from the Drawing Set to make it your Active Tool... Right Click where you want the upper left corner of the note and select Add Drawing... Select "T" again and a popup box will appear... Type in the text you want to display and press Ok...
 
Last edited:
M

machie38

New member
Edited: You can select Text Note from the Tools menu... Select the "T" symbol from the Drawing Set to make it your Active Tool... Right Click where you want the upper left corner of the note and select Add Drawing... Select "T" again and a popup box will appear... Type in the text you want to display and press Ok...
What I'm looking to do is this:
I have a Label on the chart that calculates the shares to buy based on the amount of money. I have.
What I'd like to do is be able to edit the amount on the label on the fly so I don't have to keep going into the study setup changing the amount in the input field there
 
rad14733

rad14733

Active member
VIP
What I'm looking to do is this:
I have a Label on the chart that calculates the shares to buy based on the amount of money. I have.
What I'd like to do is be able to edit the amount on the label on the fly so I don't have to keep going into the study setup changing the amount in the input field there
Ok... Well, not sure how well any of the Portfolio Thinkscript functions work in realtime... So you essentially want a study or strategy to calculate based on your currently available funds... Can't really play with that today due to how quirky TOS is working... I'll check around as I think there was a recent topic regarding Portfolio functions...
 
rad14733

rad14733

Active member
VIP
@machie38

What you need is the following snippet of code in your script... Note: Make sure you adhere to the limitations of Portfolio Functions... Each function may also have limitations, the main one being that Show Extended-Hours Trading must be enabled for the instrument type being displayed on your chart... There are also aggregation period limitations...

Code:
def price = close;
def MaxShares = Round(GetTotalCash() / price, 0);
AddLabel(yes, "MaxShares = " + MaxShares, Color.GRAY);
 

Similar threads

Top