RawSurprise

Position and Profit/Loss

Helps users track their position and profit/loss in real-time.

Instructions:
  • Open the indicator settings
  • Input your Quantity, Buy Price, Fee, and Target Price

This indicator is designed to provide users with simple real-time tracking of their positions and profit/loss within a trading session. It offers clear and concise information that enables users to understand their current position's profitability, making it easier for them to manage their trades effectively.

Input parameters

qty: Quantity of the position (default value: 100.0). The target label is represented by a green cross
buy_price: Buy price of the position (default value: 1.0).
fee: Fee percentage for the transaction (default value: 0.0016). note that this is not a percentage, but rather a decimal. So 0.0016 is 0.16%
target: Target price for the position (default value: 1.0). This is an extra label to show you where your target is on the chart. The target label is represented by a green cross

In addition to the main profit/loss label, the script also displays two auxiliary labels. The "BuyPrice" label presents the buy price of the position as a red cross symbol on the chart, allowing users to easily identify their entry point. The "targetSell" label displays the target sell price as green cross symbol, indicating the desired exit point for the position. These visual markers help users visualize their trading strategy.

The script takes into account that users may only need this information displayed on the last bar, as continuous updates might not be necessary. By checking if the current bar is the last one, the script ensures that the labels are only displayed when relevant.

Limitations

The script assumes that trading is done using the same quantity; which is not always the case. This will change with subsequent updates.
สคริปต์โอเพนซอร์ซ

ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?