I11L

I11L - Risk Adjusted Leveraging

This trading system, called "I11L - Risk Adjusted Leveraging", is designed to manage trades based on the current market volatility relative to its historical average. The system calculates the target number of open trades based on the ATR (Average True Range) indicator and adjusts the leverage accordingly. The system opens and closes trades using a pyramiding approach, allowing multiple positions to be opened at the same time.

Here's a step-by-step explanation of the system:

1. Calculate the ATR with a 14-day period and normalize it by dividing it by the current closing price.
2. Calculate the 100-day simple moving average (SMA) of the normalized ATR.
3. Calculate the ratio of the normalized ATR to its 100-day SMA.
4. Determine the target leverage based on the inverse of the ratio (2 / ratio).
5. Calculate the target number of open trades by multiplying the target leverage by 5.
6. Plot the target number of open trades and the current number of open trades on the chart.
7. Check if there's an opportunity to buy (if the current number of open trades is less than the target) or close a trade (if the current number of open trades is more than the target plus 1).
8. If there's an opportunity to buy, open a long trade and add the trade's name to the openTrades array.
9. If there's an opportunity to close a trade and there are trades in the openTrades array, close the most recent trade by referencing the array and remove it from the array.

This system aims to capture trends in the market by dynamically adjusting the number of open trades and leverage based on the market's volatility. It uses an array to keep track of open trades, allowing for better control over the opening and closing of individual trades.
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?