♥ 0 |
I am doing a calculation risk amount base on a Inside Bar For example if the risk is PRevHigh-PrevLow then If I want to no loose more thank 50 dollars for example I divide 50/risk then it gives me the total shares I need to buy. I would like to round for example if the risk is 19 cents. So when it divides 50/.19 = 263.15 Those are the shares But since I cannot buy 263.15 I want it to round to 263. How can i do that? I tried rounddown it shows the same. the code is : def risk=50; def riskAmount = PrevHigh – PrevLow; thanks
Marked as spam
|
Private answer
I had to update the title of your question to include a full description of your request. This is very important to ensure other viewers searching for a similar solution will be able to quickly locate this post using the search function of the forum. I also had to move this out of the "Frequently Asked Questions" topic and into the "Chart Studies" topic since your request includes a chart study as it's solution. You are missing only one detail in your attempt to solve this. Here is the link to the language reference for the RoundDown() function on Thinkorswim: https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Math---Trig/RoundDown Go ahead and read those details and you should very quickly identify the one small piece you forgot to include in your attempted solution. Marked as spam
|
Please log in to post questions.