TradingView
tRADERlI-
2022年4月11日下午3點28分

positionsize calculator 

Bitcoin / United States DollarCoinbase

描述

How to use:
Use the cursor to select the time, entry, stop loss, and target position. Enter the trading fee to calculate the reward/risk ratio and the actual reward/risk ratio (including the commission) according to the price you selected.

Known error:
Settings of this script can't be saved as default might due to the interactive price selection function. If anyone knows how to fix it, please let me know.

feature:
The visual Risk/Reward box, have three price labels on the right hand of the box.
Calculate the actual reward/risk ratio based on the trading fee.

The visual Risk/Reward box will extend automatically.

發布通知

Add a breakeven line. When the price hit this line, you can move your stop loss to your entry price.

發布通知

Fixed the breakeven line code. The previous one can cause the script not working

發布通知

Revised the calculation about the actual risk/reward

發布通知

Added alert option. Note that you have to open new alerts every time you enter a new trade and close them after the trade is finished.
Added the risk/reward lost percent function based on the trading fee.

發布通知

Added the English version. You can change it to English version by replacing the code I provided.

發布通知

Fixed Algorithm of calculating position size and actual reward/risk again. Now your position size will be calculated based on the risk per trade, taker and maker fee.

發布通知

Added a couple of simple calculations that could help you determine how much Leverage should use and the lowest win rate required. All the calculation includes the trading fee.
Added Break even label.

發布通知

Added two features.
1. improve the box visual quality.
2. Now you can see the profit you get from the table in real time.

發布通知

Minor adjust

發布通知

Changed some translated words.

發布通知

Change the algorithm of breakeven and added target2 option.

發布通知

fixed the algorithm

發布通知

fixed bug

發布通知

fixed bug
評論
Cervinmole
Hello. Well done for your code.

Question 1 I don't understand how the meaning of the variable 'account'.
Question 2 How can I use your indicator with forex?
➠ Environment:
Traded market = Forex
Pair of currencies traded = GBP/USD
Traded contract size = 100,000 usd
Capital in play for each trade = 2,000 usd (so leverage of: 100,000 / 2,000 = 50)
Average slippage of my broker = 8 ticks (1 tick = 0.00001)

➠ Note:
for a contract of 100,000 usd, each change in the fifth decimal place is worth 1 dollar. Example:
Long Entry Price = 1.20959 ; Output Price = 1.20965 ; Gain = $6.

THANK YOU
tRADERlI-
@Cervinmole, account means how much money your account have. forex can be used directly since position size is only based on your account money and risk per trade. This script is abandoned and there is an ultimate version which is better.
tRADERlI-
@Cervinmole, taker and maker represents trading fee in %. You can change these two var with spread. Just need to change all the calculation equations which have taker or maker var.
EvelynAndEd
谢谢大佬的分享!
Mil_Cheese
super!
Do you have in plans to show real break even points?
May be choose from check-box - 3 types?
For long - entry price + fees, for short - entry price - fees.
1. maker + maker
2. maker + taker or taker + maker
3. maker + maker
Or only the biggest one?
After we can see the price where we can move SL - to get 0 profit and 0 loss.
tRADERlI-
@Mil_Cheese, sure, will add this feature in the next version.
Mil_Cheese
@tRADERlI-, thank you very much !
PS. I did mistake, but I'm sure you understand
3. taker + taker
Cervinmole
@tRADERlI-, Thank you for your very prompt response. 12
Oh well, an another version? super
Nice evening to you
tRADERlI-
@Cervinmole, glad to help
GTcoke
@Mil_Cheese, Can you add more than one admission? It would be perfect if you could add more than one admission. I like your manual entry.
更多