racer8

Cost Analysis Calculator [racer8]

racer8 已更新   
The Cost Analysis Calculator tells you whether it is ok to trade based on the costs of doing trade. It is a great risk management tool to use to avoid trades that have heavy costs which can negatively affect the chances of profitability. It takes into account commissions & spread cost. Based on your settings, if the cost is too high, the calculator will show you a sign that reads: "Trade cost is high :(". On the otherhand, if costs are low enough to trade, the calculator's sign will say: "Trade cost is low :)" giving you the green light to trade.

The ATR cost parameter defines the maximum amount of trade costs you are willing to take on. It defines the distance (in ATR units) needed to recover trade costs. For example, if the ATR cost parameter is set to 0.20, that means the indicator will only let you trade if costs are below 0.20 ATR. In other words, the price will have to move in the direction of your trade by 0.20 ATR units in order to break-even.
Below are the calculations I used to derive my formula for this indicator...I'm pretty sure these formulas have never been invented before...lol.

Spread cost = absolute value of (#units)*(Bid - Ask)
Total trade cost = commission fee + spread cost

What defines the profit needed to break-even?
Profit = (#units) * (Change in Price needed to profit)
Profit = (#units) * (Distance in ATR)

Profit > Total trade cost
(#units) * (Distance in ATR) > commission fee + spread cost
Distance in ATR > (commission fee + spread cost) / #units
M*ATR > (commission fee + spread cost) / #units

where M represents the ATR cost parameter set at a default value of 0.20 units.

As always, enjoy :D

版本注释:
...
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?