♥ 0 |
Possible to get some help on my Position Size Script getting an error at def currentPrice. There may be more issues I’m not aware of I’m very green at this! Code: # Position Size Calculator based on max % account risk with variable position riskPercent %. # Input max percentage of a portfolio that one stock should be def netliq = GetNetLiq(); ### Risk of Portfolio def twoperc = netliq * (Max_Percent / 100); # Input position risk # Position Size input showlabel = yes; RESOLVED
Marked as spam
|
Private answer
This is not the correct way to reference the current price:
Current price in Thinkscript is always going to be "close":
In addition to that, it is not the correct way to use "PriceType.LAST". Details here showing the proper use of the "PriceType.LAST" constant: https://toslc.thinkorswim.com/center/reference/thinkScript/Constants/PriceType/PriceType-LAST But like I said, it is NOT the correct metric to use to read the current price. In Thinkscript, the most current price is ALWAYS found by using the "close", all by itself.
Marked as spam
|
Please log in to post questions.